-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Q36 如何设置支持中文,需要哪些包,编译器。。。 #44
Comments
目前主流支持中文有两种方式,一种是 ctex 宏包支持方式\documentclass[UTF8]{article}
\usepackage{lipsum}
\usepackage[UTF8,scheme=plain]{ctex}
\begin{document}
\lipsum[1]
中文
\end{document} 你可以使用 pdflatex 或者 xelatex 进行编译,如果主文档大部分是英文,用 pdflatex 就好,如果主文档是中文文档,推荐使用 xelatex(速度慢挺多的)。 xeCJK 宏包支持方式在使用 pdflatex 编译英文文档时,并不好使用系统字体,如果需要调用系统字体,需要使用 fontspec 指定系统字体,并使用 xelatex 进行编译。类似的,中文如果使用系统字体,可以使用 xeCJK 包,指定中文字体。 \documentclass[UTF8]{article}
\usepackage{lipsum}
\usepackage{xeCJK}
\setCJKmainfont[BoldFont={FZHei-B01},ItalicFont={FZKai-Z03}]{FZShuSong-Z01}
\setCJKsansfont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZHei-B01}
\setCJKmonofont[BoldFont={FZHei-B01},ItalicFont={FZHei-B01}]{FZFangSong-Z02}
\begin{document}
\lipsum[1]
中文
\end{document} 其中使用到的字体分别是
字体文件见:方正字体,提取码:njy9。 |
pr 已经接受了。 |
使用系统已有中文字体 \documentclass{article}
\usepackage{lipsum}
\usepackage{xeCJK}
\setCJKmainfont[BoldFont={SimHei},ItalicFont={STKaiti}]{SimSun}
\setCJKsansfont[BoldFont={SimHei},ItalicFont={STKaiti}]{STKaiti}
\setCJKmonofont[BoldFont={Fangsong},ItalicFont={Fangsong}]{Fangsong}
\begin{document}
\lipsum[1]
中文 \textit{楷体} \textbf{黑体}
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
看下我的pull request, 有空处理下,基本没改,就是试试pull request, waiting for merge...
The text was updated successfully, but these errors were encountered: