This module adds kanji (Chinese and Japanese) and hangul (Korean) character support in latex.
Important
You don't need this extension at all.
Just specify the preamble used in XeLaTeX below and compile it.
Installation:
> pip install sphinxcontrib-cjk
In conf.py
:
extensions = ['sphinxcontrib.cjk'] LATEX_PREAMBLE = r''' \usepackage{xeCJK} \setCJKmainfont{MS Mincho} \setCJKsansfont{MS Gothic} ''' latex_elements = { ... 'preamble': LATEX_PREAMBLE, ... }
Somewhere in the document:
:xecjk:`漢字`
Generate pdf:
> make latex > xelatex doc.tex
In conf.py
:
extensions = ['sphinxcontrib.cjk'] latex_elements = { ... 'preamble': r'\usepackage{CJKutf8}', ... }
Somewhere in the document:
:cjk:`漢字`
or specify the style to use:
:cjk:`漢字 <min>`
Available value for style:
- gbsn (简体宋体, simplified Chinese)
- gkai (简体楷体, simplified Chinese )
- bsmi (繁体细上海宋体, traditional Chinese)
- bkai (繁体标楷体, traditional Chinese)
- min (明朝 Mincho)
- goth (ゴシック Gothic)
- maru (丸ゴシック Maru Gothic)
- song (宋体, simsun.ttc, default)
- fs (仿宋, simfant.ttf)
- kai (楷书, simkai.ttf)
- hei (黑体, simhei.ttf)
- li (隶书, simli.ttf)
- you (幼圆, simyou.ttf)
Example:
:cjk:`漢字 <min>`
If you didn't supply the font, it will be fall back to 'song'.
Generate pdf:
> make latex > pdflatex doc.tex
- http://tex.stackexchange.com/questions/15516/how-to-write-japanese-with-latex
- http://latex-my.blogspot.co.id/2010/06/cjk-support-in-latex.html
I only test this module in the following condition:
- Windows 10 x64
- Document encoding in UTF-8
- Kanji only
- Generate PDF using MiKTeX
First public release.