使用组合类的参考书目

使用组合类的参考书目

我正在使用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重新定义了命令。\@lbibitemnumbers

因此我们首先加载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} 

输出(引用):

在此处输入图片描述

输出(参考书目):

在此处输入图片描述

相关内容