CJK-LaTeX using a CJK-environment in \part{}
Hi folks, again some questions....? (Why do we live? What are we? Where do we go?.....) I want to use a CJK-environment in a \part{} command, so I wrote: \part{Beweistheorie \`a la Gentzen, % \begin{CJK*}[dnp]{JIS}{min}% <some kanji>\ (Takeuti) und <some kanji>\ (Arai) % \end{CJK*} % --- Die Theorie $\Tpa$% } After saving at is euc-jp I latexed the file and the output was [52] ! Use of \@part doesn't match its definition. <argument> \def \reserved@a { \def \@currenvir {CJK*}\edef \@currenvline {\on... l.6092 } ? Any ideas?? 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?? Thank you for your help. Best regards, Ludger
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.
--
Mike Fabian
Hi Mike, hi all others,
\begin{CJK*}[dnp]{JIS}{min}
\tableofcontents % <- OK here because it's within \begin{CJK} ... \end{CJK}
\part{1n$bLZ$+$iMn$A$k}
\end{CJK*} Ok. That should work.
But I choose the "dirty" (i. e. ugly) method: I have to edit my toc file by hand, because I want to use bold math symbols in the chapter titles, so I add a CJK-environment as well. So my "solution" was: I wrote \part[some silly stuff -- my prof is an idiot ;-) Die Theorie $\TPA$]{Beweistheorie \`a la\\Gentzen,\\\begin{CJK*}[dnp]{JIS}{min}C]Fb\ (Takeuti) und\\?70f\ (Arai)\end{CJK*}\\[2ex]\thispagestyle{empty} Die Theorie $\TPA$} and edited the produced toc file by hand: Instead of \contentsline {part}{\numberline {II}some silly stuuff -- my prof is an idiot ;-) Die Theorie $\textnormal {\textbf {T}}_{\textnormal {\textbf {PA}}}$}{55} in the toc-file I wrote \contentsline {part}{\numberline {II}Beweistheorie \`a la Gentzen, \begin{CJK*}[dnp]{JIS}{min}C]Fb\ (Takeuti) und ?70f\ (Arai)\end{CJK*}\\Die Theorie $\textnormal {\textbf {T}}_{\textnormal {\textbf {PA}}}$}{55} The output is really beautiful.... Thank you, Mike. Best regards, Ludger
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? -- Mit freundlichen Gruessen / Best regards Ulrich Groh
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
Mike FABIAN
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
[...]
You see garbage instead of the Japanese,
No, you see correct Japanese in the mail, because Gnus/XEmacs the
ISO-2022-JP which looked like garbage in the UTF-8 terminal became
correct again when the mail was sent with the
Content-Type: text/plain; charset=iso-2022-jp
header. But you can reproduce it yourself in an UTF-8 cabable terminal
(mlterm, xiterm, xterm ...).
--
Mike Fabian
Am Samstag, 15. Februar 2003 12:43 schrieben Sie:
ugroh@t-online.de (Ulrich Groh) さんは書きました:
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:
Maybe (sure) a stupid question: But how to start a UTF-8 capable terminal? -- Mit freundlichen Gruessen / Best regards Ulrich Groh
ugroh@t-online.de (Ulrich Groh) さんは書きました:
Am Samstag, 15. Februar 2003 12:43 schrieben Sie:
ugroh@t-online.de (Ulrich Groh) さんは書きました:
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:
Maybe (sure) a stupid question: But how to start a UTF-8 capable terminal?
In case of mlterm or xiterm, just start it with LC_CTYPE set to an UTF-8 locale. The default font settings are already OK. For example LC_CTYPE=en_GB.UTF-8 mlterm (any UTF-8 locale is OK of course, you can also use ja_JP.UTF-8 whatever). And if you didn't set LC_CTYPE explicitely, you can of course also use LANG=en_GB.UTF-8 mlterm because LC_CTYPE then inherits from LANG. Or use the big hammer LC_ALL=en_GB.UTF-8 mlterm If you are already running in UTF-8 by default, you don't have to do anything of course, then it should already work. When the terminal has started, check again with the 'locale' command whether the settings look right. This is because you might have configured your terminals to always start a login shell and then your ~/.profile is read which may override the locale settings again. Then you should be able to output text in various languages, for example: mfabian@magellan:~$ for i in fr_FR cs_CZ de_DE ja_JP ko_KR zh_TW; do LANG=$i.UTF-8 date; done sam fév 15 15:24:23 CET 2003 So úno 15 15:24:23 CET 2003 Sam Feb 15 15:24:23 CET 2003 2003年 2月 15日 土曜日 15:24:23 CET 2003. 02. 15. (토) 15:24:23 CET 六 2月 15 15:24:23 CET 2003 mfabian@magellan:~$ For xterm on SuSE 8.1 you have to change your font settings. Either via the command line: LANG=ja_JP.UTF-8 xterm -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 -fw -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1 Or by adding the following to your ~/.Xresources to use Unicode fonts by default: XTerm*locale: true XTerm*fontMenu*fontdefault*Label: Default XTerm*font: -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1 XTerm*wideFont: -misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1 XTerm*font1.Label: efont 12 pixel XTerm*font1: -efont-fixed-medium-r-normal-*-12-120-75-75-c-60-iso10646-1 XTerm*wideFont1: -efont-fixed-medium-r-normal-*-12-120-75-75-c-120-iso10646-1 XTerm*font2.Label: misc 13 pixel XTerm*font2: -misc-fixed-medium-r-semicondensed-*-13-120-75-75-c-60-iso10646-1 XTerm*wideFont2: -misc-fixed-medium-r-normal-*-13-120-75-75-c-120-iso10646-1 XTerm*font3.Label: efont 14 pixel XTerm*font3: -efont-fixed-medium-r-normal-*-14-140-75-75-c-70-iso10646-1 XTerm*wideFont3: -efont-fixed-medium-r-normal-*-14-140-75-75-c-140-iso10646-1 XTerm*font4.Label: efont 16 pixel XTerm*font4: -efont-fixed-medium-r-normal-*-16-160-75-75-c-80-iso10646-1 XTerm*wideFont4: -efont-fixed-medium-r-normal-*-16-160-75-75-c-160-iso10646-1 XTerm*font5.Label: misc 18 pixel XTerm*font5: -misc-fixed-medium-r-normal-*-18-120-100-100-c-90-iso10646-1 XTerm*wideFont5: -misc-fixed-medium-r-normal-*-18-120-100-100-c-180-iso10646-1 XTerm*font6.Label: efont 24 pixel XTerm*font6: -efont-fixed-medium-r-normal-*-24-240-75-75-c-120-iso10646-1 XTerm*wideFont6: -efont-fixed-medium-r-normal-*-24-240-75-75-c-240-iso10646-1 The efont-unicode.rpm package is useful when you use UTF-8 a lot. The setting XTerm*locale: true is ignored by the xterm in SuSE Linux 8.1. The current xterm, which will be in SuSE Linux 8.2 uses this resource to start luit automatically in non-UTF-8 locales. Because the above font settings use Unicode fonts, it wouldn't work like that without luit in non-UTF-8 locales like de_DE@euro for example. But luit can fix that problem, see the man page of luit: man luit> Luit is a filter that can be run between an arbitrary man luit> application and a UTF-8 terminal emulator. It will con man luit> vert application output from the locale's encoding into man luit> UTF-8, and convert terminal input from UTF-8 into the man luit> locale's encoding. With the old xterm in SuSE Linux 8.1, luit never starts automatically, you always have to start it manually when needed. xterm with version
= 173 can start luit automatically if "XTerm*locale: true" is set.
--
Mike Fabian
Am Samstag, 15. Februar 2003 12:43 schrieb Mike FABIAN:
ugroh@t-online.de (Ulrich Groh) さんは書きました:
mfabian@magellan:/tmp$ iconv -f euc-jp -t utf-8 < ludger-sicking.tex
With this I got garbage.
But if you convert from ISO-2022-JP to UTF-8, it works:
True . But still it don't work with latex. -- Mit freundlichen Gruessen / Best regards Ulrich Groh
ugroh@t-online.de (Ulrich Groh) さんは書きました:
Am Samstag, 15. Februar 2003 12:43 schrieb Mike FABIAN:
ugroh@t-online.de (Ulrich Groh) さんは書きました:
mfabian@magellan:/tmp$ iconv -f euc-jp -t utf-8 < ludger-sicking.tex
With this I got garbage.
But if you convert from ISO-2022-JP to UTF-8, it works:
True .
But still it don't work with latex.
Of course this file doesn't work with latex in UTF-8 encoding. If you
want to use UTF-8 encoding, you have to change the \begin{CJK}...
statement. The file was intended to be EUC-JP encoded, but it was
converted to ISO-2022-JP by the mail software. If you convert it back
to EUC-JP encoding, it works with latex.
--
Mike Fabian
Am Samstag, 15. Februar 2003 17:13 schrieben Sie:
ugroh@t-online.de (Ulrich Groh) さんは書きました:
Am Samstag, 15. Februar 2003 12:43 schrieb Mike FABIAN:
ugroh@t-online.de (Ulrich Groh) さんは書きました:
mfabian@magellan:/tmp$ iconv -f euc-jp -t utf-8 < ludger-sicking.tex
With this I got garbage.
But if you convert from ISO-2022-JP to UTF-8, it works:
True .
But still it don't work with latex.
Of course this file doesn't work with latex in UTF-8 encoding. If you want to use UTF-8 encoding, you have to change the \begin{CJK}... statement. The file was intended to be EUC-JP encoded, but it was converted to ISO-2022-JP by the mail software. If you convert it back to EUC-JP encoding, it works with latex.
No I got it. It is working!!! Thanks a lot for helping me to understand the system. -- Mit freundlichen Gruessen / Best regards Ulrich Groh
participants (4)
-
Ludger Sicking
-
Ludger Sicking
-
Mike FABIAN
-
ugroh@t-online.de