ustcSlides icon indicating copy to clipboard operation
ustcSlides copied to clipboard

Develop

Open hzh8311 opened this issue 9 years ago • 1 comments
trafficstars

use ctex package instead of CJKutf8 package to handle Chinese character. So it no need to use \zh{} or \zhb{} to wrap the Chinese character.

hzh8311 avatar Jul 05 '16 11:07 hzh8311

Dear Zhihua. I finally got around to look into ctex.

In my tests, I got it to work under xelatex and lualatex. Under the pdflatex and plain latex I got into some issues, e.g., some font problems, and sometimes the documents would not compile for other reasons. So I changed my package to

  1. check if we are compiling under xelatex or lualatex
  2. if so, check if the ctex package is available
  3. if both is true, i.e., we have ctex and are either under xelatex or lualatex, use ctex and \let \zh to \relax and \zhb to \mbox, i.e., render the commands harmless (\zhb does still the line break protection, as it is supposed to)
  4. otherwise, if CJKutf8 is available, use it and define \zh and \zhb as before
  5. otherwise, \let \zh to \relax and \zhb to \mbox and hope for the best

This way, I can compile my example documents under all four compilers. The problems that were reported in the past should then no longer occur under xelatex and lualatex.

thomasWeise avatar Aug 31 '16 01:08 thomasWeise