ugroh@t-online.de (Ulrich Groh) さんは書きました:
Am Freitag, 14. Februar 2003 17:22 schrieb Mike FABIAN:
Ludger Sicking
さんは書きました: When I wrote
\begin{CJK*}[dnp]{JIS}{min} \part{Beweistheorie \`a la Gentzen, ...} \end{CJK*}
the problem is that the kanjis don't arise in the table of contents. Have I to use an extra package? Does CJK provide such tricky movements of arguments or should I have to edit the <filename>.toc by myself??
See the attached example file.
I tried the file too. But if I have
% -*- coding: euc-jp -*-
in the file, latex will run into errors (see attachment) . If I delete the first line with the coding information, everything works fine.
Using xemacs on the original file I can see the japanese Hiragana/Kanji .
What goes wrong?
Gnus/XEmacs again converted the encoding in my attachment when sending
it. The attachement you saved isn't really EUC-JP encoded anymore, it
is ISO-2022-JP encoded.
To see that this is so, save the attachement again to disk (don't
edit!) and execute the following in a UTF-8 capable terminal:
mfabian@magellan:/tmp$ iconv -f euc-jp -t utf-8 < ludger-sicking.tex
% -*- coding: euc-jp -*-
\documentclass[12pt]{book}
\usepackage{CJK}
\begin{document}
%\tableofcontents % <- *NOT* OK here because it's outside of \begin{CJK} ... \end{CJK}
\begin{CJK*}[dnp]{JIS}{min}
\tableofcontents % <- OK here because it's within \begin{CJK} ... \end{CJK}
\part{猿も木から落ちる}
\end{CJK*}
\end{document}
mfabian@magellan:/tmp$
You see garbage instead of the Japanese, because the file wasn't
euc-jp encoded, therefore it didn't display in an UTF-8 capable
terminal after converting to UTF-8.
But if you convert from ISO-2022-JP to UTF-8, it works:
mfabian@magellan:/tmp$ iconv -f iso-2022-jp -t utf-8 < ludger-sicking.tex
% -*- coding: euc-jp -*-
\documentclass[12pt]{book}
\usepackage{CJK}
\begin{document}
%\tableofcontents % <- *NOT* OK here because it's outside of \begin{CJK} ... \end{CJK}
\begin{CJK*}[dnp]{JIS}{min}
\tableofcontents % <- OK here because it's within \begin{CJK} ... \end{CJK}
\part{猿も木から落ちる}
\end{CJK*}
\end{document}
mfabian@magellan:/tmp$
The Japanese is displayed correctly in the UTF-8 capable terminal,
i.e. this was really ISO-2022-JP encoded and the conversion to UTF-8
therefore worked.
CJK-LaTeX needs EUC-JP encoding when using \begin{CJK*}[dnp]{JIS}{min}.
By removing the coding system cookie and saving the file, you
have converted it to EUC-JP again.
Emacs opened the file in EUC-JP mode, because of the coding system
cookie. You can also see that in the modeline at the lower left.
Nevertheless Emacs detected the ISO-2022-JP encoding automatically
and displayed it correctly.
When you removed the coding system cookie and saved the changed file
to disk, it was written back to disk in EUC-JP encoding again.
The file was originally EUC-JP encoded on my disk, but it was
unfortunately automatically converted to ISO-2022-JP when I did sent
the mail.
I had the same problem recently with the UTF-8 encoded
korean-Baekmuk-Gulim-UniKS-UTF8-H.ps file which I attached to a mail
to ghugh Song