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

  • 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 – Ignacio Sala Aug 11 '13 at 23:22
  • The arara documentation is a really good tutorial. And this site has some examples if you search :) –  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}

    – Ignacio Sala 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 {}. –  Aug 11 '13 at 23:31
  • @HarishKumar I just finished installing arara and its ready to run with TexWorks. Could you please give me a simple tutorial of how to use it in this particular scenario? – Ignacio Sala Aug 12 '13 at 00:00
  • @HarishKumar Now it should be easier to understand. Thanks – Ignacio Sala Aug 12 '13 at 00:17
  • @HarishKumar My problem is that I still don't know how to use arara syntax in my latex file to process the document. Thanks – Ignacio Sala Aug 12 '13 at 00:23
  • Please check my answer. After correcting the errors in the code, your green button in texworks should work (No need of arara). However, arara is really a cool tool in ones arsenal. Let me know if it doesn't work.:) –  Aug 12 '13 at 02:38

1 Answers1

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.

  • 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! – Ignacio Sala Aug 12 '13 at 09:40
  • This is working great!!!! Thank you so much Harish!!!! I am so happy!!!! – Ignacio Sala Aug 13 '13 at 09:31
  • @IgnacioSala Glad it worked :-) You are making me happy too (by being happy) –  Aug 13 '13 at 09:32