9

I want to use multiple bibliographies for which I am using following code. However, I realize that I need to configure my text editor to properly process this code but I don't have any idea how.

\documentclass[12pt]{article}

\usepackage{multibib}

\newcites{journal,conference}{Refereed Journal Articles, Refereed Conference Publications}

\begin{document}
Hi, this is an example of the multibib.
\bibliographystylejournal{plain}
\nocitejournal{*}
\bibliographyjournal{journal}

\bibliographystyleconference{plain}
\nociteconference{*}
\bibliographyconference{conference}

\end{document}

My conference.bib and journal.bib file are:

@inproceedings{entry1,
    author = {Author name},
    address = {address},
    booktitle = {Some conference},
    title = {Title},
    year = {2013},
}

and

@article{entry2,
    author = {Author name},
    journal = {Some Journal},
    title = {Title},
    year = {2013},
}

Ask asked by Harish Kumar, here is the screenshot of my TexStudio configuration. enter image description here

Ask asked by Harish Kumar, here is my log and output after compiling with arara enter image description here enter image description here

Tash
  • 433
  • 1
    It is better to use arara with which you will not have to struggle. –  Jun 08 '14 at 22:24
  • @HarishKumar. What is this 'arara'? Can you please give some details how to make multiple bibliographies using 'arara'? – Tash Jun 09 '14 at 00:33
  • I have added an answer with details. Hope that is useful. If you have any further queries, feel free to ask. –  Jun 09 '14 at 01:27
  • @HarishKumar. Thanks. I will try this and let you know how it went. – Tash Jun 09 '14 at 13:58
  • @HarishKumar Today finally I installed the arara. Initially it gave me an error that 'arara' could not be started. I figured out there was an error in the path because with cut paste from your instructions, the -1 changed to -|. So I fixed it and ran it again from the user command that was created. Apparently it ran arara but no bibliography is produced. I only get one line of text in the output. (I copied your MWE). – Tash Jun 13 '14 at 02:01
  • How can i post the image? I tried pasting but I guess there is some other way that i don't know. – Tash Jun 13 '14 at 02:35
  • @HarishKumar. I could only include image in my initial question so I have posted it. My log says No file journal.bbl and No file conference.bbl – Tash Jun 13 '14 at 02:57
  • Please post your log too in the question. If you have run my code exactly, there shouldn't be any problem. BTW does arara start like in my last screen shot? –  Jun 13 '14 at 03:00
  • @HarishKumar. I have posted both above. – Tash Jun 13 '14 at 03:08
  • I think you typed 1 in "C:/Program Files/arara/arara.exe" -v -l % | txs:///view. It is ell → l not 1 (one). Can you confirm this? –  Jun 13 '14 at 07:22
  • @HarishKumar. You were right, I changed it to ell. However, it still did not work. Then I played around with the spaces between all characters and finally it worked. Thank you very much Harish. – Tash Jun 13 '14 at 12:01
  • Tash: Glad it worked finally. Happy multibibing. :) –  Jun 13 '14 at 12:03

2 Answers2

8

arara is a cool tex automation tool. It comes bundled with TeX Live. If you using MiKTeX, you can install it by yourself. It comes with a neat documentation which you can refer to, for more details.

Coming to your problem, there are three steps.

Running multibib

If you define your multibib like:

\newcites{journal, conference}{Refereed Journal Articles, Refereed Conference Publications}

You have to run (assuming your main file is main.tex)

pdflatex main
bibtex main
bibtex journal
bibtex conference
pdflatex main
pdflatex main

Now we will see how to do these compilations using arara.

Install arara

If you are using TeX Live, you may skip this step. Install arara and ensure that arara.exe is in your system path. The installer will give an option to do this, hence be watchful to read the instructions during installation.

Integrate arara with texstudio

In texstudio, go to OptionsConfigure TeXstudio. In the window that opens, choose Build on the left side:

enter image description here

Under User Commands, type

"C:/Program Files/arara/arara.exe" -v -l % | txs:///view

(replace C:/Program Files/arara/ with your path) or

arara -v -l % | txs:///view

(if arara is in system path)

as in the above figure. Also don't forget to give this a name (user0: Arara). Now OK the window.

Now under the menu ToolsUser, you will have arara with a short cut.

enter image description here

Putting directives

You have to provide directives to arara on a document basis. For details, refer to arara manual. Now for your case, put these somewhere in your document (I prefer just before \documentclass)

% arara: pdflatex: {synctex: yes}
% !arara: makeindex
% arara: bibtex: { files: [ journal, conference ] }
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}

! makes an arara directive passive (i.e., a comment)

Code:

% arara: pdflatex: {synctex: yes}
% !arara: makeindex
% arara: bibtex: { files: [ journal, conference ] }
% arara: pdflatex: {synctex: yes}
% arara: pdflatex: {synctex: yes}
\documentclass[12pt]{article}

\usepackage{multibib}

\newcites{journal, conference}{Refereed Journal Articles, Refereed Conference Publications}

\usepackage{filecontents} \begin{filecontents}{conference.bib} @inproceedings{entry1, author = {Author name}, address = {address}, booktitle = {Some conference}, title = {Title}, year = {2013}, } \end{filecontents} \begin{filecontents}{journal.bib} @article{entry2, author = {Author name}, journal = {Some Journal}, title = {Title}, year = {2013}, } \end{filecontents} \begin{document} Hi, this is an example of the multibib. \bibliographystylejournal{plain} \nocitejournal{*} \bibliographyjournal{journal}

\bibliographystyleconference{plain} \nociteconference{*} \bibliographyconference{conference}

\end{document}

Save the above code and in TeXstudio, choose arara and compile. In my case, the short cut is Alt+shift+F1 to invoke arara.

enter image description here

0

Replace the bibtex % command (Options - Commands - bibtex) with a custom script such as bibtexall.cmd %

The content of bibtexall.cmd is as follows. I learned from the TeXstudio support forum, but I modified the script from there a little bit so it makes more sense to me.

@echo off
if "%1"=="" goto end

for %%f in ("%~dp1*.aux") do bibtex "%%f"

@echo on :end

Place it right next to bibtex.exe (I'm using MiKTeX, so it's in miktex/bin)

Every time you update the custom bibliography, run bibtex in TeXstudio (F8).

It will parse every existing aux file in the same folder as the tex file, which could generate a lot of warnings saying some don't contain useful bibtex information, but I figure that's okay.

The Linux (bash) version can be found in the multibib package manual.

Yvon
  • 171