3

I need your help to find a way to process multiple bibtex files in TeXworks for Mac. I have to do this because I am working with multibib. At the moment I select bibtex and press the green bottom to compile, but the second bibliography is not shown on the output file. Thanks in advance for your support!

To process my document, I have to run LaTeX three times and BibTEX two times:

  • latex mydoc

  • bibtex mydoc

  • bibtex sec (How I select a different file name?)

  • latex mydoc

  • latex mydoc

This is a short version of the code I have:

\documentclass{article}
\usepackage{multibib}
\newcites{sec}{\TeX\ and \LaTeX\ References}

\begin{document}
References to the \TeX book \citeltex{Knuth:1991}
and to Lamport’s \LaTeX\ book, which appears
only in the references\nociteltex{Lamport:1994}.
Finally a cite to a Postscript tutorial
\cite{Adobe:1985}.

\bibliographystylesec{alpha}
\bibliographylsec{lit}

\renewcommand{\refname}{Postscript References}
\bibliographystyle{plain}
\bibliography{lit}
\end{document}

The output should look like this:

Output

9
  • Welcome to TeX.SE! Please post a minimum working example (MWE) that illustrates the problem you're trying to solve. In particular, please indicate how you load and use the multibib package and how and where the file sec (short for sec.tex or sec.aux, I presume) comes into play.
    – Mico
    Aug 11 '13 at 22:43
  • @HarishKumar Do you know about a tutorial of how to use arara? Thanks Aug 11 '13 at 23:22
  • The arara documentation is a really good tutorial. And this site has some examples if you search :)
    – user11232
    Aug 11 '13 at 23:24
  • @Mico This is a simple version of what I am trying to do: \usepackage{multibib} \newcites{sec}{Additional Sources} \newpage \renewcommand{\refname}{References} \bibliographystyle{plainnat} \bibliography{library} \bibliographystylesec{plainnat} \bibliographysec{library} Aug 11 '13 at 23:27
  • 1
    Instead of adding code in comments, you may please add it to your question body and use code block button {}.
    – user11232
    Aug 11 '13 at 23:31
3

You have some errors in your code:

  1. \citeltex{Knuth:1991} is wrong. It should be \citesec{Knuth:1991} so that it appears under \TeX\ and \LaTeX\ References. Similarly \nociteltex{Lamport:1994} should be \nocitesec{Lamport:1994}

  2. There is a typo in \bibliographylsec{lit}. It should be \bibliographysec{lit}

With these corrections, the following code works. I have included the xampl.bib file that comes bundled with your TeX distribution (as you have provided none).

\documentclass{article}
\usepackage{multibib}
\newcites{sec}{\TeX\ and \LaTeX\ References}

\begin{document}
References to the \TeX book \citesec{book-full}
and to Lamport’s \LaTeX\ book, which appears
only in the references\nocitesec{article-full}.
Finally a cite to a Postscript tutorial
\cite{book-minimal}.

\bibliographystylesec{alpha}
\bibliographysec{xampl}

\renewcommand{\refname}{Postscript References}
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}

Compile this with pdflatex, bibtex, pdflatex, pdflatex.

enter image description here

With arara

Save the following code as mydoc.tex.

% arara: pdflatex
% arara: bibtex: { files: [ mydoc, sec ] }
% arara: pdflatex
% arara: pdflatex
\documentclass{article}
\usepackage{multibib}
\newcites{sec}{\TeX\ and \LaTeX\ References}

\begin{document}
References to the \TeX book \citesec{book-full}
and to Lamport’s \LaTeX\ book, which appears
only in the references\nocitesec{article-full}.
Finally a cite to a Postscript tutorial
\cite{book-minimal}.

\bibliographystylesec{alpha}
\bibliographysec{xampl}

\renewcommand{\refname}{Postscript References}
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}

Then run arara mydoc from command line (from the same folder as the mydoc.tex file).

For a more detailed analysis of texworks with multibib, refer to this answer by Paulo: answer by Paulo.

3
  • Thank you for your answer. I try making these changes and it looks like one step missing in the processing of the file. I compile using pdflatex, bibtex, pdflatex, pdflatex. The postscript References are shown perfectly, but the Tex and Latex References are not. Maybe I have to run the the bibtex a second time for the (sec.aux) file. Can you help me with this? Thanks in advance for your continuous support! Aug 12 '13 at 9:40
  • This is working great!!!! Thank you so much Harish!!!! I am so happy!!!! Aug 13 '13 at 9:31
  • @IgnacioSala Glad it worked :-) You are making me happy too (by being happy)
    – user11232
    Aug 13 '13 at 9:32

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.