寫在前面的話:國科大最新版的模板在這裏(https://github.com/mohuangrui/ucasthesis),利用它來寫博後出站報告的相關介紹在這裏;html
本篇博文是針對另外一個模板進行介紹的,如下內容僅可做爲參考。python
使用CASthesis模板(https://github.com/xiaoyao9933/UCASthesis,介紹裏說這個版本是在ThuThesis的基礎上修改的),自帶的說明以下。git
使用須知 ======== 1. 本模板需使用texlive 2014或以上版本編譯。 2. 肯定系統中存在xfig,transfig依賴(Mac OSX 系統可嘗試經過port進行安裝)。 3. 確保當前系統已安裝配置SimSun,SimHei,KaiTi,FangSong字體,若是您使用的是Linux和Mac OSX系統,請自行 以「fc-cache 添加 win 字體」爲關鍵字經過Google搜索解決方案)。 備用方案:若是您並不想安裝其餘字體,而僅使用系統自帶的兼容字體(不建議這樣作),則可利用如下命令交互式地完成字體配置 python zhfonts.py 使用方法 ======== 1. 編譯示例文檔 xelatex main bibtex main xelatex main xelatex main 說明:也可使用 pdflatex/latex+dvipdfmx 生成文檔。 2. 編寫本身的論文 參考示例文檔: main.tex 主控文檔 data/ 論文具體內容 ref/ 參考文獻目錄 figures/ 圖片目錄
直接編譯自帶的文件 main.tex: xelatex main , 出現了一些小問題,如今把它們的解決辦法記錄下來。github
根據上面的「使用須知「逐條覈對。app
1. 軟件和系統環境:dom
$ uname -a Linux 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux $ latex -v pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015) kpathsea version 6.2.1 Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Compiled with libpng 1.6.17; using libpng 1.6.17 Compiled with zlib 1.2.8; using zlib 1.2.8 Compiled with xpdf version 3.04
2. xfig,transfig依賴確認ide
$ rpm -qa | grep -i xfig $ rpm -qa | grep -i transfig $ sudo yum install xfig $ rpm -qa | grep -i xfig xfig-3.2.5-23.a.el6.x86_64 xfig-common-3.2.5-23.a.el6.x86_64 $ rpm -qa | grep -i transfig transfig-3.2.5-10.el6.x86_64
2.test 嘗試編譯 main.tex 文件,結果報錯以下,這表示缺失字體,使用須知中的第3步必不可少。字體
$ xelatex main This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode (./main.tex LaTeX2e <2015/01/01> Babel <3.9l> and hyphenation patterns for 79 languages loaded. (./ucasthesis.cls Document Class: ucasthesis 2012/07/28 4.8dev University of Chinese Academy of S ciences Thesis Template (/usr/local/texlive/2015/texmf-dist/tex/generic/ifxetex/ifxetex.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/ctex/ctexbook.cls (/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/expl3-code.tex) (/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/l3unicode-data.def) (/usr/local/texlive/2015/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def)) Document Class: ctexbook 2015/05/16 v2.0.2 Chinese adapter for class book (CTEX ) (/usr/local/texlive/2015/texmf-dist/tex/latex/l3packages/xparse/xparse.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/base/fix-cm.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/base/ts1enc.def)) (/usr/local/texlive/2015/texmf-dist/tex/latex/ms/everysel.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/ctex/config/ctexopts.cfg) ************************************************* * ctex warning: "deprecated-option" * * Option `cs4size' is deprecated. * Option `zihao=-4' is set. ************************************************* ************************************************* * ctex warning: "deprecated-option" * * Option `nocap' is deprecated. * Option `scheme=plain' is set. ************************************************* ************************************************* * ctex warning: "deprecated-option" * * Option `nofonts' is deprecated. * Option `fontset=none' is set. It is better to use fontset option. ************************************************* (/usr/local/texlive/2015/texmf-dist/tex/latex/base/book.cls Document Class: book 2014/09/29 v1.4h Standard LaTeX document class (/usr/local/texlive/2015/texmf-dist/tex/latex/base/bk12.clo)) (/usr/local/texlive/2015/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xecjk/xeCJK.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st y) (/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec-patches.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/base/fontenc.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/euenc/eu1enc.def) (/usr/local/texlive/2015/texmf-dist/tex/latex/euenc/eu1lmr.fd)) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xunicode/xunicode.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/tipa/t3enc.def (/usr/local/texlive/2015/texmf-dist/tex/latex/euenc/eu1lmss.fd)) (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/graphics.cfg) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xetex-def/xetex.def)))) (/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xunicode/xunicode.sty *** Reloading Xunicode for encoding 'EU1' *** ) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg)) (/usr/local/texlive/2015/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty (/usr/local/texlive/2015/texmf-dist/tex/generic/ulem/ulem.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/environ/environ.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/trimspaces/trimspaces.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty))) (/usr/local/texlive/2015/texmf-dist/tex/latex/zhnumber/zhnumber.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/zhnumber/config/zhnumber-utf8.cfg )) (/usr/local/texlive/2015/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-plain-boo k.def) (/usr/local/texlive/2015/texmf-dist/tex/latex/ctex/ctex-cs4size.clo)) (/usr/local/texlive/2015/texmf-dist/tex/latex/ctex/config/ctex.cfg) (/usr/local/texlive/2015/texmf-dist/tex/latex/base/ifthen.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/calc.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/txfonts.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/caption/subcaption.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/caption/caption3.sty))) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/indentfirst.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/paralist/paralist.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/footmisc/footmisc.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/cjk/texinput/CJKnumb.sty) (./fontname.def ************************************************* * fontspec warning: "script-not-exist" * * Font 'SimSun' does not contain script 'CJK'. ************************************************* LaTeX Font Warning: Font shape `EU1/txr/m/n' undefined (Font) using `EU1/lmr/m/n' instead on input line 2. ) (/usr/local/texlive/2015/texmf-dist/tex/latex/ntheorem/ntheorem.sty Style `ntheorem', Version 1.33 <2011/08/15> ) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/array.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/longtable.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/booktabs/booktabs.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/natbib/natbib.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/puenc.def) (/usr/local/texlive/texmf-local/tex/latex/html/url.sty)) Package hyperref Message: Driver (autodetected): hxetex. (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/hxetex.def (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/stringenc.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/local/texlive/2015/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/latexconfig/color.cfg)) Package hyperref Warning: Option `pdfpagelabels' has already been used, (hyperref) setting the option has no effect on input line 141. ) (./ucasthesis.cfg) (./ucastils.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/multirow/multirow.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/tools/tabularx.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/diagbox/diagbox.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/pict2e/pict2e.sty (/usr/local/texlive/2015/texmf-dist/tex/latex/pict2e/pict2e.cfg) (/usr/local/texlive/2015/texmf-dist/tex/latex/pict2e/p2e-xetex.def)) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp.sty `Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/defpattern.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-basic.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-addons.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-snap.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-exp.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-trigo.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-pas.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-random.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-eqn.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-upn.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/fp/fp-eval.sty))) (/usr/local/texlive/2015/texmf-dist/tex/latex/float/float.sty)) (./main.aux (./data/chap01.aux) (./data/chap02.aux) (./data/ack.aux) (./data/resume.aux)) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/omltxmi.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/omstxsy.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/omxtxex.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/utxexa.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/tipa/t3cmr.fd) ABD: EverySelectfont initializing macros (/usr/local/texlive/2015/texmf-dist/tex/latex/caption/ltcaption.sty) (/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./main.out) (./main.out) (./data/cover.tex) Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\\' on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) \kern -2.00792pt (hyperref) removed on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\lower' on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\hbox' on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) \kern -1.50562pt (hyperref) removed on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\spacefactor' on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\@m' on input line 30. Package hyperref Warning: pdfproducer: xdvipdfmx will use its own setting (hyperref) instead of the value given on input line 30. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\\' on input line 32. <use "figures/ucaslogo.pdf" > (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/ot1txr.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/utxmia.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/utxsya.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/utxsyb.fd) (/usr/local/texlive/2015/texmf-dist/tex/latex/txfonts/utxsyc.fd) ************************************************* * fontspec warning: "script-not-exist" * * Font 'SimSun' does not contain script 'CJK'. ************************************************* [1] [2] [3] [4] [5] [6] LaTeX Font Warning: Font shape `EU1/TimesNewRoman(0)/m/sc' undefined (Font) using `EU1/TimesNewRoman(0)/m/n' instead on input line 32. [1] [2] [3] [4] (./main.toc [5]) Underfull \vbox (badness 10000) has occurred while \output is active [6] (./main.lof) [7] [8] (./main.lot) [9] [10] (./data/chap01.tex Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\let' on input line 7. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\CJK@q' on input line 7. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\let' on input line 7. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\let' on input line 7. LaTeX Font Warning: Font shape `OMS/TimesNewRoman(0)/m/n' undefined (Font) using `OMS/txsy/m/n' instead on input line 13. Overfull \hbox (5.96889pt too wide) in alignment at lines 88--98 [][] [1] Overfull \hbox (2.00749pt too wide) in paragraph at lines 153--173 $[]$ $[]$ Underfull \vbox (badness 10000) has occurred while \output is active [2] Underfull \hbox (badness 10000) in paragraph at lines 222--222 []|\EU1/TimesNewRoman(0)/m/n/11.04124 Waxman Underfull \vbox (badness 10000) has occurred while \output is active [3] Underfull \hbox (badness 10000) in paragraph at lines 337--342 Underfull \vbox (badness 10000) has occurred while \output is active [4] Underfull \vbox (badness 10000) has occurred while \output is active [5] Underfull \vbox (badness 10000) has occurred while \output is active [6] Underfull \vbox (badness 10000) has occurred while \output is active [7]) Underfull \vbox (badness 10000) has occurred while \output is active [8] (./data/chap02.tex Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\let' on input line 7. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\CJK@q' on input line 7. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\let' on input line 7. Package hyperref Warning: Token not allowed in a PDF string (Unicode): (hyperref) removing `\let' on input line 7. <use "figures/hello.pdf" > <use "figures/thu-fig-logo.pdf" > <use "figures/thu-text-logo.pdf" > <use "figures/thu-fig-logo.pdf" > <use "figures/thu-text-logo.pdf" > LaTeX Warning: `h' float specifier changed to `ht'. LaTeX Warning: `h' float specifier changed to `ht'. <use "figures/thu-whole-logo.pdf" > <use "figures/thu-whole-logo.pdf" > [9]) Underfull \vbox (badness 10000) has occurred while \output is active [10] (./main.bbl) (./data/appendix01.tex [11] [12] [13] Underfull \hbox (badness 10000) in paragraph at lines 103--103 []|\EU1/TimesNewRoman(0)/m/sc/11.04124 Waxman Underfull \vbox (badness 10000) has occurred while \output is active [14] <use "figures/thu-lib-logo.pdf" > Underfull \vbox (badness 10000) has occurred while \output is active [15] Underfull \vbox (badness 10000) has occurred while \output is active [16] Underfull \hbox (badness 10000) in paragraph at lines 206--206 []|\EU1/TimesNewRoman(0)/m/sc/11.04124 Waxman <use "figures/hello.pdf" > [17] Underfull \vbox (badness 10000) has occurred while \output is active [18]) [19] [20] (./data/ack.tex) [1] (./data/resume.tex [2] Underfull \hbox (badness 10000) in paragraph at lines 3--5 Underfull \hbox (badness 10000) in paragraph at lines 9--11 ) [3] [4] (./main.aux (./data/chap01.aux) (./data/chap02.aux) (./data/ack.aux) (./data/resume.aux)) xdvipdfmx:fatal: pdf_ref_obj(): passed invalid object. Output file removed. LaTeX Font Warning: Some font shapes were not available, defaults substituted. ) (see the transcript file for additional information) Error 256 (driver return code) generating output; file main.pdf may not be valid. Transcript written on main.log.
我曾一度覺得是 xdvipdfmx 的問題,去谷歌上搜了一圈,沒找到解決辦法。後來在水木論壇上的TeX和LaTeX版塊提問,纔算解決了問題。ui
可見,有一個能及時互動和反饋的論壇,是多麼多麼的重要!this
3. 安裝配置SimSun,SimHei,KaiTi,FangSong字體
首先查詢本機已安裝的字體,發現這4種字體都已經安裝過了,但經水木網友Smoulder指出,SimSun 字體可能安裝不對,具體內容在水木論壇的帖子(關於 CASthesis 樣例文件編譯的問題,請指教)中。
$ fc-list | grep -i SimSun SimSun\-ExtB:style=Normal,oby?ejné,Standard,Κανονικ?,Regular,Normaali,Normál,
Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta SimSun:style=13 SimSun:style=12 SimSun:style=09 SimSun:style=11 SimSun:style=10 SimSun:style=08 SimSun:style=17 SimSun:style=16 SimSun:style=15 SimSun:style=14 SimSun:style=03 SimSun:style=02 SimSun:style=01 SimSun:style=18 SimSun:style=06 SimSun:style=05 SimSun:style=04 SimSun:style=33 SimSun:style=32 SimSun:style=29 SimSun:style=31 SimSun:style=30 SimSun:style=28 SimSun:style=37 SimSun:style=36 SimSun:style=35 SimSun:style=34 SimSun:style=23 SimSun:style=21 SimSun:style=39 SimSun:style=38 SimSun:style=20 SimSun:style=27 SimSun:style=26 SimSun:style=25 SimSun:style=24 SimSun:style=52 SimSun:style=49 SimSun:style=48 SimSun:style=57 SimSun:style=56 SimSun:style=55 SimSun:style=54 SimSun:style=43 SimSun:style=42 SimSun:style=41 SimSun:style=59 SimSun:style=40 SimSun:style=58 SimSun:style=47 SimSun:style=46 SimSun:style=45 SimSun:style=44 SimSun:style=73 SimSun:style=72 SimSun:style=69 SimSun:style=68 SimSun:style=70 SimSun:style=76 SimSun:style=74 SimSun:style=63 SimSun:style=62 SimSun:style=61 SimSun:style=79 SimSun:style=60 SimSun:style=78 SimSun:style=67 SimSun:style=66 SimSun:style=65 SimSun:style=64 SimSun:style=84$ fc-list | grep -i SimHei 黑體,SimHei:style=Normal,oby?ejné,Standard,Κανονικ?,Regular,Normaali,Normál,Normale,
Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta $ fc-list | grep -i KaiTi 楷體,KaiTi:style=Normal,oby?ejné,Standard,Κανονικ?,Regular,Normaali,Normál,Normale,
Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta 華文楷體,STKaiti:style=Regular $ fc-list | grep -i FangSong 仿宋,FangSong:style=Normal,oby?ejné,Standard,Κανονικ?,Regular,Normaali,Normál,Normale,
Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta 華文仿宋,STFangsong:style=Regular
緣由:找到 fonts.scale 文件,搜索 SimSun 字體爲 Adobe 字體,並不是 Windows 字體:
vijayab.ttf -misc-simsun-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific
解決辦法:從新安裝 Windows 字體。
先將 /usr/share/fonts 目錄中原有的 Windows+Adobe 字體刪除掉,新建文件夾 /usr/share/fonts/chinese/TrueType,再從 C:\indows\Fonts 中拷貝全部的 TrueType 字體到該目錄下,具體方法參見 http://waddy.iteye.com/blog/2051496 。
$ sudo mkdir /usr/share/fonts/chinese/TrueType $ sudo cp /media/.../Windows/Fonts/*.ttf /usr/share/fonts/chinese/TrueType $ sudo cp /media/.../Windows/Fonts/*.TTF /usr/share/fonts/chinese/TrueType $ sudo cp /media/.../Windows/Fonts/*.ttc /usr/share/fonts/chinese/TrueType $ sudo chmod 755 /usr/share/fonts/chinese/TrueType/* $ cd /usr/share/fonts $ sudo mkfontscale $ sudo mkfontdir $ sudo fc-cache -fv $ reboot # 重啓計算機
從新查詢 CASthesis 所須要的4種字體,其中,SimSun 字體的結果已經好了,原來這樣纔是對的,之前都沒看出來,仍是太菜啊!
$ fc-list | grep -i SimSun 新宋體,NSimSun:style=Regular SimSun\-ExtB:style=Normal,oby?ejné,Standard,Κανονικ?,Regular,Normaali,Normál,Normale,
Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta 宋體,SimSun:style=Regular
4. 重啓並再次編譯 main.tex,提示字體缺失:「Courier New".
按第3步的辦法,去網上下載了這個字體,並安裝。再次編譯的時候,就不會報這個錯誤了。
5. 重啓並再次編譯 main.tex,警告:提示有重複定義的標籤,這屬於嚴重錯誤,必須解決掉。
重複定義的標籤名爲{sec:bib},在文件 ./UCASthesis-master/data/chap01.tex 中,將其中一個更改便可,習慣上保留參考文獻的標籤爲 \label{sec:bib},那麼就改掉另一個。
\section{章節引用} \label{sec:eg4cha} % \label{sec:bib} 引用章標題的例子:第\chapterref{cha:china}章(本模板定義的\verb|\chapterref| 命令生成的中文數字方式),第\ref{cha:china}章(默認的阿拉伯數字方式),附錄\ref{cha:engorg}。 \section{參考文獻} \label{sec:bib} 固然參考文獻能夠直接寫 bibitem,雖然費點功夫,可是好控制,各類格式能夠本身隨意改 寫。
6. 編譯示例文檔 main.tex,終於成功啦,好開心!
$ xelatex main $ bibtex main $ xelatex main $ xelatex main ... Output written on main.pdf (44 pages). Transcript written on main.log.
over.