首页 技术 正文
技术 2022年11月19日
0 收藏 590 点赞 2,426 浏览 18983 个字

写在前面的话:国科大最新版的模板在这里(https://github.com/mohuangrui/ucasthesis),利用它来写博后出站报告的相关介绍在这里

本篇博文是针对另一个模板进行介绍的,以下内容仅可作为参考。

使用CASthesis模板(https://github.com/xiaoyao9933/UCASthesis,介绍里说这个版本是在ThuThesis的基础上修改的),自带的说明如下。

使用须知
========
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 , 出现了一些小问题,现在把它们的解决办法记录下来。

根据上面的“使用须知“逐条核对。

1. 软件和系统环境:

$ 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依赖确认

$ rpm -qa | grep -i xfig$ rpm -qa | grep -i transfig$ sudo yum install xfig     $ rpm -qa | grep -i xfig
xfig-3.2.-.a.el6.x86_64
xfig-common-3.2.-.a.el6.x86_64$ rpm -qa | grep -i transfig
transfig-3.2.-.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.texPackage 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 WaxmanUnderfull \vbox (badness 10000) has occurred while \output is active [3]
Underfull \hbox (badness 10000) in paragraph at lines 337--342Underfull \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.texPackage 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 WaxmanUnderfull \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--5Underfull \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版块提问,才算解决了问题。

可见,有一个能及时互动和反馈的论坛,是多么多么的重要!

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=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=
SimSun:style=$ 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 ( pages).
Transcript written on main.log.

over.

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,000
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,512
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,358
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,141
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,771
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,849