使用XeLaTeX/XeTeX编译中文文档

本文介绍了如何使用XeLaTeX和XeTeX编译中文文档,强调其对中文字体的良好支持,特别是可以使用系统字体如微软雅黑。通过CTeX套装中的WinEdt编辑器,详细说明了如何配置菜单以添加XeTeX编译选项,以及解决可能出现的UTF-8编码问题。最后,鼓励读者尝试这种强大的文档排版工具。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近需要写一些文档,就重新用到了LaTeX。不得不说,这个东西真是个好东西,之前在学校写论文那会就已经充分发现它相对于Word来排版的优势。不过之前所写的文档都是用的现成模板,而且其中的中文字体多是宋体。现在老是觉着用微软雅黑排出来的中文版式比宋体更漂亮,因此就想把之前的格式均转化成微软雅黑的。但是普通的中文都是使用CJK包来扩展,而且可以支持的中文字体也很有限,最近搜索后发现XeLaTeX对中文支持很好(这东东是日本人开发的),可以使用各种系统字体,于是就配置使用了下,的确不错。

首先需要安装MikTeX的环境啦,这里还是推荐CTex套装,里边包含了各种编译版本,可以去http://www.ctex.org/CTeXDownload下载。注意,最好直接下载Full Version的版本,这里边包含了各种需要的编译组件。而包含Basic MikTeX的版本需要在使用相应的库时再从网上下载(甚至安装时也要下载相关包,本人在公司用时就由于网络连接的问题而无法下载相应的内容而安装失败)。

CTex中含有的WinEdt是一个很好的可视化.tex编辑器,特别是对于程序员来说各种UI界面异常的熟悉,具体用法就不多说了。在该环境里边写好一个.tex文件

This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode (./yunchou.tex LaTeX2e <2024-11-01> patch level 2 L3 programming layer <2025-01-18> (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/base/book.cls Document Class: book 2024/06/29 v1.4n Standard LaTeX document class (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/base/bk10.clo)) (./package.tex (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/ctex/ctex.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-xetex.def)) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/ctex/ctexpatch.sty) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/base/fix-cm.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/base/ts1enc.def)) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def (d:/Texlive 2024/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber.sty (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg)) (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def (d:/Texlive 2024/texlive/2024/texmf-dist/tex/latex/cte
03-15
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值