多行文字和缩进

多行文字和缩进

我使用 multibib 在文档中应用多个参考书目。问题是,当使用超过 9 个条目时,会出现缩进。

\documentclass{article}

\usepackage[resetlabels]{multibib}
\newcites{lit}{Literature1}
%\newcites{lit2}{Literature2}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\thebibliography}{%
  \section*{\refname}\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
}{}{}{}
\makeatother

\usepackage{filecontents}

\begin{filecontents}{Lit1.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A02,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A03,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A04,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A05,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A06,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A07,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A08,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A09,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A10,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{A11,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
\end{filecontents}


\begin{document}

\makeatletter\renewcommand{\@biblabel}[1]{[A\,#1]}\makeatother
\nocitelit{*}
\bibliographystylelit{plain}
\bibliographylit{Lit1}

\end{document}

我怎样才能避免这种压痕?

答案1

缩进与你用“A”放大文献标签无关,multibib而是源于此。BibTeX 计算得比较正确,最大的标签是“10”(参见文件bbl),而你希望最大的标签是“A 10”。最简单的规避方法是使用

\setbiblabelwidth{1000}

来自multibib包。另一个更复杂的选项是破解书目样式以将实际需要的标签输出到文件中bbl

答案2

问题在于multibib,使用该resetlabels选项时,总是会0计算标签宽度,在我看来,这是一个错误。

您可以使用另一个补丁解决该问题:

\usepackage{etoolbox}
\makeatletter
\patchcmd{\thebibliography}{%
  \section*{\refname}\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
}{}{}{}
\begingroup\catcode`#=12
\AtBeginDocument{
  \patchcmd\thebibliography
    {\advance\@tempcnta#1}
    {\advance\@tempcnta#1\else\@tempcnta#1}
    {}{}
}
\endgroup
\makeatother

由于在文档开始时重新定义,因此\AtBeginDocument\catcode技巧是必要的。multibib\thebibliography

在此处输入图片描述

相关内容