6

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
  • Bibtex command in Texmaker Ubuntu 12.04. By is there a way I mean in the configure texmaker options should I be changing the Bibtex command to differ from bibtex %.aux – Matt Stokes Jan 16 '14 at 23:26
  • I can make user profiles to manually run bibtex %.aux but is there any way to chain the bibtex command to multiple .aux files? Can I do some means of chaining via |? – Matt Stokes Jan 16 '14 at 23:33
  • In this specific case, I don't think it's as simple as that. Instead use a automated compilation tools like latexmk or arara. LaTeXmk is configured in Texmaker by Configure texmaker-->Quick Build-->LaTeXMK+View PDF and it should automate and resolve the number of runs required for bibtex. – texenthusiast Jan 17 '14 at 17:34

1 Answers1

6

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

egreg
  • 1,121,712