我正在尝试使用以下命令在 MacOS Sierra 10.13.6 和 Debian 8(pdfTex 3.14159265-2.6-1.40.19)上获取报告的相同输出 PDF:
pdflatex rapport_m2
biber rapport_m2
biber rapport_m2
pdflatex rapport_m2
pdflatex rapport_m2
我的问题是我无法在 Debian OS 上获得引用,我得到的是“未定义的引用”,而在 MaOS 上则不太可能,在 MaOS 上我可以获得所有有效的引用(我谈论的是参考书目)。
您可以看到两个版本的编译日志:
生成的页面数量也不同(MacOS 上有 39 页,而 Debian 上只有 37 页)。
以下是我的报告的所有标题.tex
以及所有选项和包:
article{Hamilton_1998,
author = {{Hamilton}, A.~J.~S.},
title = {{Linear Redshift Distortions: a Review}},
booktitle = {The Evolving Universe},
year = {1998},
editor = {{Hamilton}, D.},
volume = {231},
series = {Astrophysics and Space Science Library},
pages = {185},
adsnote = {Provided by the SAO/NASA Astrophysics Data System},
adsurl = {http://adsabs.harvard.edu/abs/1998ASSL..231..185H},
bdsk-url-1 = {http://dx.doi.org/10.1007/978-94-011-4960-0_17},
doi = {10.1007/978-94-011-4960-0_17},
eprint = {astro-ph/9708102}
}
\end{filecontents}
%\documentclass[11pt,french,oneside]{report}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%\usepackage[francais]{babel}
%\usepackage[style=ext-authoryear, backend=biber]{biblatex}
%\usepackage{hyperref}
\documentclass[11pt,french,oneside]{report}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{indentfirst}
\usepackage{lastpage}
\usepackage{amsmath,amssymb}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage{epsfig}
\usepackage{graphics}
\usepackage{multirow}
\usepackage{vmargin}
\usepackage{float}
\usepackage{psboxit,pstcol}
\usepackage{tabularx}
%\usepackage[style=authoryear]{biblatex}
%\usepackage{biblatex}
%\usepackage[backend=biber,style=authoryear]{biblatex}
\usepackage[style=ext-authoryear, backend=biber]{biblatex}
\usepackage[hyperfootnotes=false,colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink,noabbrev]{cleveref}
\Crefname{appendix}{l'Appendice}{les Appendices}
\usepackage{setspace}
\usepackage{needspace}
\usepackage{caption}
%\usepackage{hyperref}
%\usepackage[nameinlink,noabbrev]{cleveref}
\renewcommand*{\bibfont}{\small}
% Default fixed font does not support bold face
\DeclareFixedFont{\ttb}{T1}{txtt}{bx}{n}{9} % for bold
\DeclareFixedFont{\ttm}{T1}{txtt}{m}{n}{9} % for normal
% Custom colors
\usepackage{color}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\usepackage{listings}
% Python style for highlighting
\newcommand\pythonstyle{\lstset{
language=Python,
basicstyle=\ttm,
otherkeywords={self}, % Add keywords here
keywordstyle=\ttb\color{deepblue},
emph={MyClass,__init__}, % Custom highlighting
emphstyle=\ttb\color{deepred}, % Custom highlighting style
stringstyle=\color{deepgreen},
frame=tb, % Any extra options here
showstringspaces=false,
%commentstyle=\fontseries{lc}\selectfont\itshape,columns=fullflexible],
commentstyle=\ttb\selectfont\itshape,columns=fullflexible],
numbers=left,
stepnumber=1,
}}
% Python environment
\lstnewenvironment{python}[1][]
{
\pythonstyle
\lstset{#1}
}
{}
% Python for external files
\newcommand\pythonexternal[2][]{{
\pythonstyle
\lstinputlisting[#1]{#2}}}
\DefineBibliographyExtras{french}{\restorecommand\mkbibnamefamily}
\setlength\bibitemsep{\baselineskip}
\addbibresource{\jobname.bib}
\renewcommand*{\nameyeardelim}{\addcomma\space}
\newcommand*{\x}{\mathsf{x}\mskip1mu}
\DeclareCiteCommand{\cite}[\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{\usebibmacro{cite}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\cite}[\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\printtext[bibhyperref]{\usebibmacro{citeyear}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\newcommand{\emptysection}[1]{%
\begingroup\renewcommand\addcontentsline[3]{}%
\section{#1}\endgroup%
}
\makeatletter
\newlength{\chapter@number@width}
\def\@makechapterhead#1{%
{\normalfont
\setlength{\parindent}{0pt}%
\vspace*{10pt}%
\settowidth{\chapter@number@width}{%
\hbox{\color{white}\LARGE\bfseries
\hspace{\dimexpr 1mm+3pt}%
\thechapter
\hspace{\dimexpr 1mm+3pt}%
}}
\hbox{%
\vtop{%
\hsize=\dimexpr\chapter@number@width+\tabcolsep+2\fboxrule+\tabcolsep
\begin{tabular}[t]{@{}c}
\scshape\strut\makebox[0pt]{\hspace{0pt plus 1 fill minus 1 fill}\@chapapp\hspace{0pt plus 1 fill minus 1 fill}} \\
\fboxsep=0pt
\colorbox{black}{\vbox{%
\hbox{\vbox to \dimexpr 1mm+3pt{}}
\hbox{\color{white}\LARGE\bfseries
\hspace{\dimexpr 1mm+3pt}%
\thechapter
\hspace{\dimexpr 1mm+3pt}%
}
\hrule height 0.4pt depth 0pt width 0pt
\hbox{\vbox to 6pt{}}
\hbox{\parbox{0pt}{\Huge\bfseries\vphantom{E}}}
}}%
\end{tabular}%
}%
\vtop{%
\advance\hsize by -\dimexpr\chapter@number@width+2\fboxrule+\tabcolsep
\hspace*{-0.5cm}\begin{tabular}[t]{c}
\scshape\strut\vphantom{\@chapapp} \\
\fboxsep=0pt
\colorbox{white}{\vbox{%
\hbox{\vbox to \dimexpr 1mm+3pt{}}
\hbox{\LARGE\bfseries
\hspace{\dimexpr 1mm+3pt}%
\phantom{\thechapter}
\hspace{\dimexpr 1mm+3pt}%
}
\hrule height 0.4pt depth 0pt width \hsize
\hbox{\vbox to 6pt{}}
\hbox{\hspace*{20pt}\parbox{\dimexpr\textwidth-2mm-6pt-\chapter@number@width-\tabcolsep-2\fboxrule-20pt}{\Huge\bfseries #1}}
}}%
\end{tabular}%
}%
}%
\vspace{50pt}%
}
}
\def\@makeschapterhead#1{%
{\normalfont
\setlength{\parindent}{0pt}%
\vspace*{10pt}%
\settowidth{\chapter@number@width}{%
\hbox{\color{white}\LARGE\bfseries
\hspace{\dimexpr 1mm+3pt}%
\thechapter
\hspace{\dimexpr 1mm+3pt}%
}}
\hbox{%
\vtop{%
\hsize=\dimexpr\chapter@number@width+\tabcolsep+2\fboxrule+\tabcolsep
\begin{tabular}[t]{@{}c}
\scshape\strut\makebox[0pt]{\hspace{0pt plus 1 fill minus 1 fill}\phantom{\@chapapp}\hspace{0pt plus 1 fill minus 1 fill}} \\
\fboxsep=0pt
\colorbox{black}{\vbox{%
\hbox{\vbox to \dimexpr 1mm+3pt{}}
\hbox{\color{white}\LARGE\bfseries
\hspace{\dimexpr 1mm+3pt}%
\phantom{\thechapter}%
\hspace{\dimexpr 1mm+3pt}%
}
\hrule height 0.4pt depth 0pt width 0pt
\hbox{\vbox to 6pt{}}
\hbox{\parbox{0pt}{\Huge\bfseries\vphantom{E}}}
}}%
\end{tabular}%
}%
\vtop{%
\advance\hsize by -\dimexpr\chapter@number@width+2\fboxrule+\tabcolsep
\hspace*{-0.5cm}\begin{tabular}[t]{c}
\scshape\strut\vphantom{\@chapapp} \\
\fboxsep=0pt
\colorbox{white}{\vbox{%
\hbox{\vbox to \dimexpr 1mm+3pt{}}
\hbox{\LARGE\bfseries
\hspace{\dimexpr 1mm+3pt}%
\phantom{\thechapter}
\hspace{\dimexpr 1mm+3pt}%
}
\hrule height 0.4pt depth 0pt width \hsize
\hbox{\vbox to 6pt{}}
\hbox{\hspace*{20pt}\parbox{\dimexpr\textwidth-2mm-6pt-\chapter@number@width-\tabcolsep-2\fboxrule-20pt}{\Huge\bfseries #1}}
}}%
\end{tabular}%
}%
}%
\vspace{50pt}%
}
}
\setlength\parindent{0pt}
%%%% debut macro pour changer les marges localement %%%%
\newenvironment{changemargin}[2]{\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{0pt}%
\setlength{\rightmargin}{0pt}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{0pt plus 1pt}%
\addtolength{\leftmargin}{#1}%
\addtolength{\rightmargin}{#2}%
}\item }{\end{list}}
%%%% fin macro %%%%
%\setmarginsrb{2.3cm}{0.3cm}{2.1cm}{1cm}{0.55cm}{1cm}{1cm}{1cm}
\setmarginsrb{2.3cm}{0.0cm}{2.1cm}{1cm}{1.3cm}{0.5cm}{0.4cm}{1cm}
\pagestyle{fancy}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrulewidth}{0.4pt}
\chead{\hspace{-0.3cm}\textit{Rapport \hspace{-0.3cm}}}
\lhead{\epsfig{file=logo_sdc_small.jpg,height=1cm,width=2cm}}
\rhead{\epsfig{file=logo_par3_small.png,height=1cm,width=2cm}}
\lfoot{\textit{christian joe}}
\cfoot{\hspace{1.6cm} \textit{ - \'etude des mat\'eriaux - }}
\rfoot{\thepage/\pageref{LastPage}}
\makeatletter
\g@addto@macro\appendix{%
\cleardoublepage
\hypertarget{appendixstart}{}%
\addtocontents{toc}{
\protect\contentsline{chapter}{\protect\hyperlink{appendixstart}{Appendice}}{}{}%
}%
}
\makeatother
\usepackage[nameinlink,noabbrev]{cleveref}
\renewcommand{\arraystretch}{1.25}
\begin{document}
我通过以下写作引用:\autocite{2009MNRAS.399.2107K}
不幸的是,在 Debian OS 上,我无法正确显示参考资料,我只看到了name
出现在 中\autocite{name}
。
从所有这些信息中,任何人都可以告诉我问题出在哪里,我的意思是为什么这两个操作系统的输出有这种差异?
更新 1:确实,这是一个问题,biber
并且出现了以下消息:
Output written on rapport_m2.pdf (37 pages, 1289330 bytes).
Transcript written on rapport_m2.log.
INFO - This is Biber 2.12
INFO - Logfile is 'rapport_m2.blg'
INFO - Reading 'rapport_m2.bcf'
INFO - Found 23 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'rapport_m2.bib' for section 0
INFO - LaTeX decoding ...
FATAL - Caught signal: SEGV
Likely your .bib has a very bad entry which causes libbtparse to crash: Inappropriate ioctl for device
./compil_rapport: line 14: 24506 Segmentation fault biber rapport_m2
这似乎来自于我参考文献“@article”中逗号的问题:但为什么我在 MacOS 上没有遇到问题,而在 Debian/Linux 上却遇到了这个问题,这很奇怪......
更新2:通过执行以下操作,我可以获取有关我的问题的更多信息:
$ biber --tool --debug debug_bib.tex
INFO - This is Biber 2.12 running in TOOL mode
INFO - Logfile is 'debug_bib.tex.blg'
INFO - DEBUG mode: all messages are logged to 'debug_bib.tex.blg'
INFO - Looking for bibtex format file 'debug_bib.tex'
Use of uninitialized value $benc in string eq at /usr/share/perl5/Biber/Input/file/bibtex.pm line 1465.
INFO - LaTeX decoding ...
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 11, warning: 63 characters of junk seen at toplevel
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 418, warning: 2105 characters of junk seen at toplevel
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 418, warning: "}" in strange place -- should get a syntax error
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 418, syntax error: found "}", expected one of: start of entry ("{" or "(") or quoted string ({...} or "...")
invalid token near line 419 (text was '\')
invalid token near line 419 (text was '\')
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 470, warning: 5 characters of junk seen at toplevel
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Biber/Input/file/bibtex.pm line 1516.
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 470, syntax error: found "#", expected one of: start of entry ("{" or "(") or quoted string ({...} or "...")
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 550, warning: 907 characters of junk seen at toplevel
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Biber/Input/file/bibtex.pm line 1516.
invalid token near line 550 (text was '\')
/tmp/Dh8o_Onbpd/debug_bib.tex_27990.utf8, line 550, syntax error: found "ppendix", expected one of: start of entry ("{" or "(") or quoted string ({...} or "...")
invalid token near line 551 (text was '\')
invalid token near line 552 (text was '\')
invalid token near line 553 (text was '\')
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/Biber/Input/file/bibtex.pm line 1516.
warning: overriding existing definition of macro "feb"
warning: overriding existing definition of macro "may"
warning: overriding existing definition of macro "nov"
warning: overriding existing definition of macro "mar"
warning: overriding existing definition of macro "oct"
warning: overriding existing definition of macro "aug"
warning: overriding existing definition of macro "jul"
warning: overriding existing definition of macro "apr"
warning: overriding existing definition of macro "jun"
warning: overriding existing definition of macro "jan"
warning: overriding existing definition of macro "dec"
warning: overriding existing definition of macro "sep"
FATAL - Caught signal: SEGV
Likely your .bib has a very bad entry which causes libbtparse to crash: Inappropriate ioctl for device
我的文件 debug_bib.tex 位于此链接:用于调试 biber 的 latex 源代码
更新 3:
这里是 MacOS 版本的 biber 的输出(它可以编译):
warning: overriding existing definition of macro "mar"
warning: overriding existing definition of macro "jul"
warning: overriding existing definition of macro "feb"
warning: overriding existing definition of macro "sep"
warning: overriding existing definition of macro "nov"
warning: overriding existing definition of macro "may"
warning: overriding existing definition of macro "oct"
warning: overriding existing definition of macro "jun"
warning: overriding existing definition of macro "aug"
warning: overriding existing definition of macro "apr"
warning: overriding existing definition of macro "jan"
warning: overriding existing definition of macro "dec"
warning: comma(s) at end of name (removing)
author, warning: comma(s) at end of name (removing)
Use of uninitialized value $end in substitution (s///) at /opt/local/lib/perl5/vendor_perl/5.28/Biber/Input/file/bibtex.pm line 1023.
Use of uninitialized value $end in substitution (s///) at /opt/local/lib/perl5/vendor_perl/5.28/Biber/Input/file/bibtex.pm line 1023.
INFO - This is Biber 2.11
INFO - Logfile is 'rapport_m2.blg'
INFO - DEBUG mode: all messages are logged to 'rapport_m2.blg'
INFO - Reading 'rapport_m2.bcf'
INFO - Found 23 citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'rapport_m2.bib' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source 'rapport_m2.bib'
INFO - Overriding locale 'fr-FR' defaults 'variable = shifted' with 'variable = non-ignorable'
INFO - Overriding locale 'fr-FR' defaults 'normalization = NFD' with 'normalization = prenormalized'
INFO - Sorting list 'nyt/global//global/global' of type 'entry' with template 'nyt' and locale 'fr-FR'
INFO - No sort tailoring available for locale 'fr-FR'
INFO - Writing 'rapport_m2.bbl' with encoding 'latin1'
INFO - Output to rapport_m2.bbl
与.blg
文件关联:
以及.blg
Debian 的:
比较它们会很有趣,但是却很困难。