From 05528b7222d1bf0bca15f0b45081a6fc2e627fbe Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sat, 1 Mar 2014 17:22:18 +0800 Subject: [PATCH] update README --- README.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 008fd66..aa5962b 100644 --- a/README.rst +++ b/README.rst @@ -15,6 +15,23 @@ - 使用\ `Sphinx`_\ 制作文档 - 生成的文档发布在此博文(待定)中 +sphinx中文支持 +-------------- + +sphinx在利用LaTeX生成PDF时,对中文支持不够,因而修改sphinx如下: + +#. 将\ ``sphinx/texinputs/Makefile``\ 中的\ ``pdflatex``\ 替换成\ ``xelatex``; +#. 修改\ ``sphinx/writers/latex.py``\ ,在231行左右对中文做特殊处理; + + .. code-block:: python + + if builder.config.language == 'zh_CN': + self.elements['babel'] = '' + self.elements['inputenc'] = '' + self.elements['utf8extra'] = '' + +#. 修改\ ``conf.py``\. + .. _`陈皓`: http://coolshell.cn/haoel .. _`Andriki`: http://andriki.com/mediawiki/index.php?title=Linux:%E8%B7%9F%E6%88%91%E4%B8%80%E8%B5%B7%E5%86%99Makefile .. _`Sphinx`: http://sphinx-doc.org/