我正在使用book
类的选项combine
。当我格式化以下示例时,引用排版为[0,0]
而不是[1,2]
。参考书目项目都以零开头。我没有在发布的示例中导入文件,但导入的文件也会发生同样的事情。我想要解决这个问题。
\documentclass[book]{combine}
\usepackage[numbers]{combnat}
\begin{document}
\title{The collection}
\author{A. N. Editor}
\date{\today}
\maketitle
\tableofcontents
\chapter{First chapter}
\section{Introduction}
Chapter citations: \cite{article01, article02}.
\bibliographystyle{plainnat}
\begin{thebibliography}{2}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi: #1}\else
\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi
\bibitem[Name(1986)]{article01}
Author Name.
\newblock My article.
\newblock \emph{Mathematics}, 1986.
\bibitem[Two(1987)]{article02}
Author Two.
\newblock Another article.
\newblock \emph{Statistics}, 1987.
\end{thebibliography}
\end{document}
答案1
这是一个解决方法。
该包以一种看似与选项不兼容的方式combnat
重新定义了命令。\@lbibitem
numbers
因此我们首先加载natbib
选项numbers
并保存\@lbibitem
\usepackage[numbers]{natbib}
\makeatletter
\let\old@lbibitem\@lbibitem
\makeatother
然后我们加载combnat
选项numbers
并恢复\@lbibitem
\usepackage[numbers]{combnat}
\makeatletter
\let\@lbibitem\old@lbibitem
\makeatother
梅威瑟:
\documentclass[book]{combine}
\usepackage[numbers]{natbib}
\makeatletter
\let\old@lbibitem\@lbibitem
\makeatother
\usepackage[numbers]{combnat}
\makeatletter
\let\@lbibitem\old@lbibitem
\makeatother
\begin{document}
\title{The collection}
\author{A. N. Editor}
\date{\today}
\maketitle
\tableofcontents
\chapter{First chapter}
\section{Introduction}
Chapter citations: \cite{article01, article02}.
\bibliographystyle{plainnat}
\begin{thebibliography}{2}
\providecommand{\natexlab}[1]{#1}
\providecommand{\url}[1]{\texttt{#1}}
\expandafter\ifx\csname urlstyle\endcsname\relax
\providecommand{\doi}[1]{doi: #1}\else
\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi
\bibitem[Name(1986)]{article01}
Author Name.
\newblock My article.
\newblock \emph{Mathematics}, 1986.
\bibitem[Two(1987)]{article02}
Author Two.
\newblock Another article.
\newblock \emph{Statistics}, 1987.
\end{thebibliography}
\end{document}
输出(引用):
输出(参考书目):