How to configure TeXstudio editor for multibib?
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 Options
→ Configure TeXstudio
. In the window that opens, choose Build
on the left side:
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 Tools
→ User
, you will have arara
with a short cut.
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
.