如果我在环境\cite
中调用tabularx
并biblatex
加载defernumbers=true
和sorting=none
,则引用不会得到数字。
我收到以下警告:
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) file
(biblatex) and rerun LaTeX afterwards.
但无论我重播多少次,都没有任何biber
变化pdflatex
。
如果我将tabularx
环境更改为普通tabular
引用,就会得到一个数字。
我已经将此事提请 PLK(biblatex
维护者)注意在biblatex
错误追踪器上他说道:
这是因为
sorting=none
调用了一个特殊的检查来查看引用顺序是否已更改,以便可以为 biber 发出重新运行消息。出于某种原因,tabularx
每次都会触发此操作。您只需运行一次 latex 就会看到一些奇怪的事情发生,然后您会得到.bcf
:<bcf:citekey order="1">gob</bcf:citekey> <bcf:citekey order="3">michael</bcf:citekey> <bcf:citekey order="4">tobias</bcf:citekey>
缺少“2”顺序。使用普通的
tabular
,它就在那里。所以tabularx
做一些奇怪的事情,比如处理\cite
两次。我认为值得把这个问题作为一个 TSE 问题来问,因为tabularx
那里的人都在那里。
问题:
梅威瑟:
\documentclass[10pt]{article}
\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@Article{gob,
title = {I've Made a Huge Mistake: The Hermano Story},
author = {Bluth, Gob},
journal = {Journal of Magicians},
year = {2003},
volume = {1},
number = {1},
pages = {1--10},
}
@Article{michael,
title = {Her?},
author = {Bluth, Michael},
journal = {Sudden Valley},
year = {2003},
volume = {1},
number = {1},
pages = {1--10},
}
@Article{tobias,
title = {Never-nudism},
author = {F{\"u}nke, Tobias},
journal = {Blue Man Group},
year = {2003},
volume = {1},
number = {1},
pages = {1--10},
}
\end{filecontents}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[%
backend=biber,
defernumbers=true,
style=numeric,
sorting=none,
]{biblatex}
\addbibresource{bibliography.bib}
\usepackage{tabularx}
\begin{document}
\section{A section}
Check this out~\cite{gob}.
\section{A section}
% With plain tabular, it works with sorting=none or no sorting option.
% \begin{tabular}{ll}
% \textbf{The term \enquote{issue} is used to refer to:} & \textbf{Reference(s)} \\ \hline
% An issue. & \cite{michael}
% \end{tabular}
% With tabularx, it does not work with sorting=none.
\begin{tabularx}{\textwidth}{ll}
\textbf{The term \enquote{issue} is used to refer to:} & \textbf{Reference(s)} \\ \hline
An issue. & \cite{michael}
\end{tabularx}
\nocite{tobias}
\printbibliography
\end{document}
额外的信息:在最新的稳定biblatex
版本中,数字被完全省略,只显示括号。在 dev 3.0 版本中,所有参考书目条目都分配有数字 0。但这并不重要,因为.bcf
在两种情况下都会出现相同的问题:
问题中的这个编号
.bcf
也出现在发布的 2.9 版本中biblatex
。由于问题已在 3.0 中修复,因此进一步运行 2.9 会抛出错误,但这种奇怪的tabularx
行为仍然存在。— PLK
答案1
您可以在最后一次运行时进行引用(这意味着引用文本不用于列宽计算,但大多数情况下它不是太重要。(更仔细的定义可以使用文本而不重复 biblatex 正在使用的任何信息)
\documentclass[10pt]{article}
\usepackage{filecontents}
\begin{filecontents}{bibliography.bib}
@Article{gob,
title = {I've Made a Huge Mistake: The Hermano Story},
author = {Bluth, Gob},
journal = {Journal of Magicians},
year = {2003},
volume = {1},
number = {1},
pages = {1--10},
}
@Article{michael,
title = {Her?},
author = {Bluth, Michael},
journal = {Sudden Valley},
year = {2003},
volume = {1},
number = {1},
pages = {1--10},
}
@Article{tobias,
title = {Never-nudism},
author = {F{\"u}nke, Tobias},
journal = {Blue Man Group},
year = {2003},
volume = {1},
number = {1},
pages = {1--10},
}
\end{filecontents}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[%
backend=biber,
defernumbers=true,
style=numeric,
sorting=none,
]{biblatex}
\addbibresource{bibliography.bib}
\usepackage{tabularx}
\begin{document}
\section{A section}
Check this out~\cite{gob}.
\section{A section}
% With plain tabular, it works with sorting=none or no sorting option.
% \begin{tabular}{ll}
% \textbf{The term \enquote{issue} is used to refer to:} & \textbf{Reference(s)} \\ \hline
% An issue. & \cite{michael}
% \end{tabular}
% With tabularx, it does not work with sorting=none.
\let\zz\hfuzz
\begin{tabularx}{\textwidth}{ll}
\textbf{The term \enquote{issue} is used to refer to:} & \textbf{Reference(s)} \\ \hline
An issue. & \ifx\zz\hfuzz\cite{michael}\fi
\end{tabularx}
\nocite{tobias}
\printbibliography
\end{document}