2010年10月19日 星期二

解決index的中文問題


> i run latex on the file.. it runs file; then i run makeindex on the
> file, it runs fine.  then i run latex on the file again, and it
> starts complaining.

makeidx.sty uses \write, (not \immediate\write) for index entries
which means that the output to the index file is delayed until the
whole page is output.  You thus have to do two things.

  . Move \printindex into a CJK environment

  . Insert \newpage after \printindex.

Below is my (slightly changed) version which works just fine.


    Werner


======================================================================


\documentclass[12pt]{article}

\usepackage{CJKutf8}
\usepackage{pinyin}
\usepackage[vietnam]{babel}
\usepackage{makeidx}


\makeindex


\begin{document}

\begin{CJK}{UTF8}{bsmi}

我是美國人\index{美國 mỹ quốc}

我不會說中文\index{cannot speak}

\printindex
\newpage

\end{CJK}

\end{document}

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-master: t
%%% End:

0 意見:

張貼留言