MacTeX 下设置 CTeX 默认中文字体

1. 遇到问题

这回找到一些report/thesis/开题报告的模版,主要是中文的。 php

Why can’t I compile the simplest TeX file of only 6 lines?html

This combination of packages is attempting to load the xeCJK package twice: once on line 11 of ctex-xecjk-engine.def from the ctex package, and then again on line 43 of xeCJK-listings.sty from the listings package. The clash you are getting is that the options are different in each case (the first one specifies [BoldFont,normalindentfirst] while the second gives no options).linux

始终遇到以下错误git


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "[SIMKAI.TTF]" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

看起来是个很广泛的错误,github

解决方法也很一致:web

  • 修改/usr/local/texlive/2013/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def 文件,把其中的 [SIMKAI.TTF] , [SIMFANG.TTF] 改为KaiTi, FangSong就能够了

结果怎么都不行!!app

2. What happened???

显然在TexLive 2012以前用的是以上字体名字。
MacTeX 下设置 CTeX 默认中文字体就用的正确的字体变量名。svg

  • 修改/usr/local/texlive/2013/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def 文件,把其中的 [SIMKAI.TTF] , [SIMFANG.TTF] 改为STKaiti, STFangsong就能够了

3. 扩充阅读

在Mac下使用LaTeX的中文字体 提到了Mac下的 系统的“字体册”,英文版叫Font Book。但并非照文章里说的用 “PostScript名字” 就能够了!!学习

要找到真正的变量名,要用fc-list,好比MacTex 2010 XeLatex中文支持,而后找相似 STKaiti:style=regular 的字串!!
好比在个人机器上(TexLive2014, ML 10.9.5), 普通宋体既不是Songti,也不是STSongti,而是STSong,坑爹啊~~~
当上面的文章又说 所以需将"[SIMKAI.TTF]"改成“KaiTi_GB2312” ,并且 适用于MacTex 2013和MacTex 2014 — 偶滴神啊~~~字体

4. 完整学习

有空仍是完整学习一下CTex的知识