5

I'm trying to run quite literally this exact example: specific citation style using multibib

\documentclass{scrartcl}

\usepackage[resetlabels,labeled]{multibib}

\newcites{A}{References2}

\begin{document}
Reference without prefix \cite{bb} and a reference with prefix \citeA{aa}.

\bibliographystyle{plain}
\bibliography{lit}                 

\bibliographystyleA{plain}
\bibliographyA{lit}                   

\end{document}

with lit.bib containing

@Article{aa,
  author =   {Author, A.},
  title =    {Title},
  journal =  {Journal},
  year =     2000
}

@Article{bb,
  author =   {Brother, B.},
  title =    {Titling},
  journal =  {Ann. J.},
  year =     2002
}

And it is giving me a [?] instead of the A1 reference. Any ideas?

I have compiled using the sequence:

PDFLaTeX
BibTeX
PDFLaTeX
PDFLaTeX
  • You have to run also bibtex A – egreg Jan 16 '14 at 23:14
  • what's bibtex A? – Matt Stokes Jan 16 '14 at 23:19
  • With multibib active, the command \newcites{A}{Title} makes LaTeX produce also a file called A.aux (I suggest a better name than A). That file contains the citation commands pertaining to the secondary bibliography and you have to run BibTeX also on that file. – egreg Jan 16 '14 at 23:22
  • is there a way I can modify the Bibtex command to automatically do this each time? Currently it is: bibtex %.aux. – Matt Stokes Jan 16 '14 at 23:24
  • What editor are you using? – egreg Jan 16 '14 at 23:25
5

When \newcitesA{References2} is processed, LaTeX opens a new auxiliary file called A.aux, where it will store the citation keys pertaining to the secondary bibliography.

So, if you document is named paper.tex, you need to do the following sequence of commands in order to get the whole job done:

pdflatex paper
bibtex paper
bibtex A
pdflatex paper
pdflatex paper

Persuading your frontend (Texmaker) into doing also the supplementary step is quite hairy. The simplest thing is to run the third step from a terminal.

If you have a fairly recent TeX Live distribution (not the outdated TeX Live 2009 that comes with Ubuntu 12), you can use arara; just add some directives at the top of your main LaTeX file like below:

% arara: pdflatex
% arara: bibtex
% arara: bibtex: { files: [ A ] }
% arara: pdflatex
% arara: pdflatex

\documentclass{scrartcl}

\usepackage[resetlabels,labeled]{multibib}

\newcites{A}{References2}

\begin{document}
Reference without prefix \cite{bb} and a reference with prefix \citeA{aa}.

\bibliographystyle{plain}
\bibliography{lit}

\bibliographystyleA{plain}
\bibliographyA{lit}

\end{document}

and tell Texmaker to use arara for compiling your document, see Integration of arara in Texmaker

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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