最近有人向我介绍了如何使用 排版 LaTeX 文档makefile
,我很喜欢这个想法。但是,当我有参考书目时,事情就变得复杂了。首先,我使用包 生成参考书目文件filecontents
。这是我的 MWE
% !Mode:: "TeX:UTF-8"
% !BIB TS-program = biber
\documentclass[english]{article}
\usepackage{babel}
\usepackage[colorlinks = false, pdfborderstyle ={/S/D}]{hyperref}
\usepackage[style = numeric, sorting = none, maxnames = 3, minnames = 2, backref = true, backrefstyle = three, arxiv = abs, doi = true]{biblatex}
\DeclareFieldFormat[article]{title}{}
\usepackage{doi}
\usepackage{filecontents}
\begin{filecontents*}{biber.bib}
@article
{
a.aad.atlas_2011_2.76_tev_jet,
author = {G. Aad and others},
title = {Measurement of the inclusive jet cross section in $p p$ collisions at $\sqrt({s} = 2.76 \mathrm{TeV}$ and comparison to the inclusive jet cross section at $\sqrt({s} = 7 \mathrm{TeV}$ using the ATLAS detector},
journal = {The European Physical Journal C},
year = {2013},
month = {August},
volume = {73},
number = {2509},
doi = {10.1140/epjc/s10052-013-2509-4},
}
@article
{
a.aad.atlas_2011_7_tev_jet,
author = {G. Aad and others},
journal = {Journal of High Energy Physics},
month = {February},
title = {Measurement of the inclusive jet cross-section in proton-proton collisions at $\sqrt({s} = 7 \mathrm{TeV}$ using $4.5 \mathrm{fb}^{−1}$ of data with the ATLAS detector},
volume = {02},
number = {153},
year = {2015},
doi = {10.1007/JHEP02(2015)153},
addendum = {\textbf{Erratum}: \cite{a.aad.erratum_atlas_2011_7_tev_jet}},
}
@article
{
a.aad.erratum_atlas_2011_7_tev_jet,
author = {G. Aad and others},
title = {Erratum: Measurement of the inclusive jet cross-section in proton-proton collisions at $\sqrt{s} = 7 \mathrm{TeV}$ using $4.5 \mathrm{fb}^{−1}$ of data with the ATLAS detector},
journal = {Journal of High Energy Physics},
year = {2015},
month = {September},
volume = {09},
number = {141},
doi = {10.1007/JHEP09(2015)141},
}
\end{filecontents*}
\addbibresource{biber.bib}
\begin{document}
I will cite \cite{a.aad.atlas_2011_7_tev_jet}, which has the erratum, first, then \cite{a.aad.atlas_2011_2.76_tev_jet}.
\newpage
\pagestyle{plain}
\printbibliography
\end{document}
当我使用编辑器(texshop)排版时,一切都很好,但是,当涉及到makefile
main=test
run:
pdflatex $(main)
bibtex $(main).aux
pdflatex $(main)
rm -f $(main).aux
rm -f $(main).bbl
rm -f $(main).bcf
rm -f $(main).log
rm -f $(main).out
rm -f $(main).run.xml
rm -f $(main).synctex.gz
rm -f $(main).toc
rm -f *.bib
它开始给我各种错误信息
I found no \citation commands---while reading file note.aux
我不确定如何让它工作,有人可以帮我吗?
提前致谢!
答案1
该latexmk
脚本非常有用,makefile
因为它可以检测并自动执行所有必要命令的序列:在您的情况下,它将能够调用pdflatex
then biber
(而不是bibtex
)then again 至少两次pdflatex
......
latexmk -pdf document.tex
要清理所有中间文件,请使用以下-c
选项:
latexmk -c -pdf document.tex
请注意,这只会进行清理,因此如果您想排版然后清理,您可以执行以下操作:
latexmk -pdf document.tex
latexmk -c -pdf document.tex