CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
965 stars 124 forks source link

Please provide the Traditional Chinese version of the `CTEX 宏集手册` #668

Open amalgame21 opened 11 months ago

amalgame21 commented 11 months ago

I found the manual in ctex/ctex.dtx but I failed to build it myself. I can only compile the first 27 pages and hit an error with xelatex ctex.dtx command. Also, the formatting of the compiled pdf are way off.

Also, after I translated it with opencc, some of the character are missing because the predefined font does not support Traditional Chinese.

It would be great if the Traditional Chinese version of the manual is provided, or just translate it with opencc or other tools.

SwitWu commented 11 months ago

To avoid the compiling error, change the 2727 line:

https://github.com/CTeX-org/ctex-kit/blob/bf4f3e10d0c1da5d07925d0f28b4a8397994d775/ctex/ctex.dtx#L2727

into

% \section{\protect\LuaLaTeX{} 下的中文支持方式}
muzimuzhi commented 11 months ago

I found the manual in ctex/ctex.dtx but I failed to build it myself. I can only compile the first 27 pages and hit an error with xelatex ctex.dtx command.

See PR #670.

amalgame21 commented 11 months ago

Thank you very much! After manually modified in /usr/share/texmf-dist/tex/latex/ctex/ctxdoc.cls, it can now be complied successfully!

However some of the font cannot be displayed properly after converting to Traditional Chinese. This is the output of page 2: ctex cht

So many broken character displayed as an F within a box. Do you know how to change to some Traditional Chinese compatible font, say, Noto Sans CJK TC? I have looked into the source code, seems line 10579-11073 are font-related, but I cannot locate which line is the one to modify.

By the way, at least it is readable to me now, thank you very much for your help!

muzimuzhi commented 11 months ago

I have looked into the source code, seems line 10579-11073 are font-related, but I cannot locate which line is the one to modify.

First, different (default) font configs are chosen per OS https://github.com/CTeX-org/ctex-kit/blob/3dbff76e1d364aa7f82edfbba9a6ff97d2fae2e6/ctex/ctex.dtx#L10280-L10294 In each ctex-fontset-<name>.def, the configs used under xelatex is the forth argument of \ctex_fontset_case:nnnn.

For example for recent macOS (no older than 10.11), the related configs in ctex-fontset-macold.def for xelatex is https://github.com/CTeX-org/ctex-kit/blob/3dbff76e1d364aa7f82edfbba9a6ff97d2fae2e6/ctex/ctex.dtx#L10901-L10917

For a doc in traditional Chinese, you may also need to adapt ctex settings, such as https://github.com/CTeX-org/ctex-kit/blob/3dbff76e1d364aa7f82edfbba9a6ff97d2fae2e6/ctex/ctex.dtx#L9782-L9799