Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use multibib to apply more than one bibliography in my document. The problem is when using more than 9 entrys, there occurs an indentation.

\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}

How can I avoid this indentation?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The indentation has nothing to do with multibib but stems from the fact that you enlarging the biblabels with "A ". BibTeX calculates somewhat correctly that the largest label is "10" (see the bbl file), where you want the largest label to be "A 10". The simplest option to circumvent this is to use

\setbiblabelwidth{1000}

from the multibib pakage. The other, more involved option is to hack the bibliography style to output the actually desired labels to the bbl file.

share|improve this answer

The problem is that multibib, with the resetlabels option, always passes 0 for computing the label width, which is an error, in my opinion.

You can solve the issue with another patch:

\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

The \AtBeginDocument and the \catcode trick are necessary because multibib redefines \thebibliography at begin document.

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.