在overleaf上使用LaTeX寫中文論文,編譯時報錯:The font “XXX” cannot be found
首先:確保compiler編譯器是選擇 “XeLaTeX”
其次:了解到
諸如:
{Times New Roman PS Std} 、{Mosquito Formal Std} 、{Lucida Sans Typewriter Std}、{Lucida Sans Typewriter} 等這些英文字體
和 {Adobe Song Std} 、{Adobe Song Std}、{Adobe Heiti Std}、{Adobe Kaiti Std} 等這些中文字體
都是受版權保護,沒法在overleaf服務器上使用的。
最后,在LaTeX技術交流群的管理員的建議(寫信給 support 詢問解決方案,它們24小時都有人值班,全球各個州都有人 )下,向 overleaf 的 support 團隊發了求助信息,
很快就得到了回復:(我沒想到效率這么高,真的給力!)
Hello,
Thanks for getting in touch. SimSun is loaded by the zhfont package. It is a commercial font, and therefore not present on Overleaf's servers. (Neither are the Adobe Chinese fonts available on Overleaf, for the same reason.)
To get this project compiled on Overleaf, you would therefore need to remove lines 100–107 in headinfo.tex, and then add \usepackage{ctex}. This package uses the Fandol fonts as default, and already includes facilities of zhfonts and zhspacing.
You should also remove the lines
\def\lq{`}\def\rq{'}
\zhspacing
in main.tex. This template also makes it compulsory to have a \chairman and \appraiser.
I hope this helps.
Best,
LianTze
—
Dr. LianTze Lim
Overleaf TeXpert
按照這個建議提示修改之后,就可以編譯成功了,即使還是會有error,不影響編譯就行……
附:
Dr. LianTze Lim 也是這個問題(https://tex.stackexchange.com/questions/377749/trouble-setting-new-font-in-overleaf)的回答者,感謝。
番外:
在LaTeX技術交流群里邂逅了 Dr. LianTze Lim !
馬來西亞TeX達人-林蓮枝采訪記錄 :http://blog.sina.com.cn/s/blog_5e16f1770102dx39.html