BITNP / BIThesis

📖 北京理工大学非官方 LaTeX 模板集合,包含本科、研究生毕业设计模板及更多。🎉 (更多文档请访问 wiki 和 release 中的手册)
https://bithesis.bitnp.net
LaTeX Project Public License v1.3c
691 stars 97 forks source link

macOS 在 TeX Live 2018 下使用 XeLaTeX 编译模板时出现问题 #21

Closed xaxaxa1313 closed 4 years ago

xaxaxa1313 commented 4 years ago

您好,我是正在使用bithsis中毕业论文模版的学生。在对模版使用xelatex编译时,出现了Recipe terminated with error.来源:LaTex(拓展)的报错,同时正文中参考文献的部分变成了这样正文.....yuFeiJiZongTiDuoXueKeSheJiYouHuaDeXianZhuangYuFaZhanFangXiang2008。请问如何解决这一问题,谢谢。

spencerwooo commented 4 years ago

后者是因为参考文献编译器 biber 编译不完整导致的,参考文献编译不完整是由于前面 xelatex 编译失败导致的,所以你需要解决你第一步编译失败的问题。请详细说明一下你的编译环境,包括:

另外,非常有可能是因为你 TeX Live 版本不够,至少需要升级 TeX Live 2019。

xaxaxa1313 commented 4 years ago

谢谢!我的TeX Live是2018的,我先升级试试看 操作系统:macos TEX live版本:tex live2018 编辑器:VS Code 报错信息:

xelatex: unrecognized option `-pdf'
xelatex: unrecognized option `-outdir=/Users/ydsds/Desktop/graduation-thesis 2'
xelatex: unrecognized option `-cd'
* fontspec warning: "script-not-exist"
* 
* Font 'STSong' does not contain script 'CJK'.Package biblatex Warning: Conflicting options.
(biblatex)                'eventdate=iso' requires 'seconds=true'.
(biblatex)                Setting 'seconds=true' on input line 181.

No file main.aux.
ABD: EverySelectfont initializing macros
*geometry* driver: auto-detecting
*geometry* detected driver: xetex

Package hyperref Warning: Rerun to get /PageLabels entry.No file main.bbl.
(./misc/0_cover.tex
*************************************************
* fontspec warning: "script-not-exist"
* 
* Font 'STSong' does not contain script 'CJK'.
*************************************************
*************************************************
* fontspec warning: "script-not-exist-latn"
* 
* Font 'STXihei' does not contain script 'CJK'.
*  'Latin' script used instead.
*************************************************
[1]) [1] (./chapters/0_abstract.tex
*************************************************
* fontspec warning: "script-not-exist"
* 
* Font 'STHeiti' does not contain script 'CJK'.
*************************************************LaTeX Warning: Citation 'dengImageNetLargescaleHierarchical2010' on page 3 undefined on input line 29.

) (./misc/4_reference.tex [3]

./misc/4_reference.tex:39: LaTeX Error: \itemcmd undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.39 \renewcommand{\itemcmd}
                            {

LaTeX Warning: Empty bibliography on input line 45.

) (./misc/5_appendix.tex [4]) (./misc/6_acknowledgements.tex [5]) [6] (./main.aux)

Package rerunfilecheck Warning: File `main.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.

LaTeX Warning: There were undefined references.

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                main
(biblatex)                and rerun LaTeX afterwards.

 )
spencerwooo commented 4 years ago

更新吧,一定是 TeX Live 2018 的问题了。模板里参考文献格式有一部分是仅限 TeX Live 2019 及以上的。

hushidong commented 4 years ago

texlive中的biblatex-gb7714-2015版本较老,但本模板中用了一些新的设置,所以会有问题。

两种解决方案 1.是安装新的texlive 2.是下载新的gb7714-2015.bbx|cbx放到main.tex同目录下。

@spencerwooo 其实可以把这两个文件放进来避免用户使用老版texlive时出错。新的gb7714-2015.bbx|cbx是兼容老版texlive的。

xaxaxa1313 commented 4 years ago

把Tex Live跟新到2020后还是出现一样的问题。

报错信息:

Readyxelatex: unrecognized option `-pdf'
xelatex: unrecognized option `-outdir=/Users/caoaoxiang/Desktop/graduation-thesis'
xelatex: unrecognized option `-cd'
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex)
Package fontspec Warning: Font "Songti SC Light" does not contain requested
(fontspec)                Script "CJK".

Package fontspec Warning: Font "Songti SC Light" does not contain requested
(fontspec)                Script "CJK".

Package fontspec Warning: Font "STXihei" does not contain requested Script
(fontspec)                "CJK".

[1]) [1] (./chapters/0_abstract.tex

Package fontspec Warning: Font "Heiti SC" does not contain requested Script
(fontspec)                "CJK".
[1] [2]) (./misc/2_toc.tex (./main.toc) [3]) (./chapters/1_chapter1.tex
第1章
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/umsb.fd)

LaTeX Warning: Citation 'yuFeiJiZongTiDuoXueKeSheJiYouHuaDeXianZhuangYuFaZhanFangXiang2008' on page 1 undefined on input line 26.

LaTeX Warning: Citation 'simonyanVeryDeepConvolutional2015' on page 1 undefined on input line 30.

[1]) (./misc/3_conclusion.tex [2]

LaTeX Warning: Citation 'dengImageNetLargescaleHierarchical2010' on page 3 undefined on input line 29.

) (./misc/4_reference.tex [3]

LaTeX Warning: Empty bibliography on input line 45.

) (./misc/5_appendix.tex [4]) (./misc/6_acknowledgements.tex [5]) [6] [7] (./main.aux)

LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                main
(biblatex)                and rerun LaTeX afterwards.

 )

屏幕快照 2020-05-01 上午9 25 39 屏幕快照 2020-05-01 上午9 25 56

hushidong commented 4 years ago

LaTeX Warning: There were undefined references. Package biblatex Warning: Please (re)run Biber on the file: (biblatex) main (biblatex) and rerun LaTeX afterwards.

)

根据提示,你没有运行biber

spencerwooo commented 4 years ago

@hushidong 大佬好!

其实可以把这两个文件放进来避免用户使用老版texlive时出错。新的gb7714-2015.bbx|cbx是兼容老版texlive的。

了解,我还没研究过这个,等后面有时间我试一下把参考文献样式直接集成进去。


@xaxaxa1313 我觉得你应该是 VS Code 的整个编译过程配置还有问题,你重点看一下 VS Code LaTeX Workshop 里的编译命令设置,应该需要 xelatex » biber » xelatex » xelatex 四步走的。可以重点参考一下教程这里的介绍:使用 VS Code 撰写与编译 LaTeX 模板

xaxaxa1313 commented 4 years ago

我按照教程中进行了latexmk的编译配置,出现以下报错 屏幕快照 2020-05-01 上午11 15 45 屏幕快照 2020-05-01 上午11 15 58 谢谢各位大佬,麻烦了

hushidong commented 4 years ago

看你的提示biber是在运行了,但出错了,有点像biber没有按好。

首先在命令行试一下biber命令能否运行。

如果不行的话,先完善一下perl环境,就是安装一下perl。试试biber能否运行。

看起来像我安装手机中的biber缺些库,提示的是lib:xml.上述操作还不行,安装一下这个库,用cpan或者cpanm命令安装。

以前我在手机安的记录 https://blog.csdn.net/xenonhu/article/details/92060939 现在termux支持又有问题了,一些库我还没找到方法,但有参考价值。

hushidong commented 4 years ago

如果解决不了可以换一下mac专用的tex发行版,不按texlive了。

spencerwooo commented 4 years ago

之前我用 macOS 的同学用的确实用是 MacTeX 不是 TeX Live,可能是这个原因?

hushidong commented 4 years ago

比如mactex等,百度搜一下看看。

hushidong commented 4 years ago

@spencerwooo 好的,😄😄

xaxaxa1313 commented 4 years ago

谢谢大佬们!更新MacTex后问题解决