A few months back, I posted about my decision to use LaTeX for writing my thesis, in preference to Word or something of that ilk. I seem to get a few Google hits from other people interested in using LaTeX in the humanities, so I will occasionally post useful things I’ve gleaned, even though it will be of no interest to most readers …
So here’s one. In theses (and monographs), historians generally separate their bibliographies into different sections for the different types of sources — for example, “Primary sources” and “Secondary sources”. It wasn’t obvious to me how to do this in standard LaTeX/BibTeX, which just puts all of your references into a single bibliography.1 So, last night while procrastinating, I went looking for the answer and found it. There are several options listed there, but the only one I tried was the multibib package, and it works just fine for me.
It works like this: in the preamble, after calling the package,2 specify the name of each bibliography you need, along with a unique (and preferably, short) identifying key. For example, to make separate bibliographies for primary and for secondary sources, you might do the following:
\usepackage{multibib}
\newcites{pri}{Primary sources}
\newcites{sec}{Secondary sources}
The \newcites command takes the existing citation commands (eg \cite) and redefines them so that there is an equivalent for each of your bibliographies (in this case, \citepri and \citesec). You then use these instead of the standard citation commands:
This is a sentence about a primary source.\footcitepri{aston:1914} And this one refers to some specific pages in a secondary source.\footcitesec[1-5]{bialer:1980}
\newcites does the same thing for the bibliography commands, so at the end of the document (or wherever you want to place them) you would have something like this:
\bibliographystylepri{jox.bst}
\bibliographypri{all.bib}
\bibliographystylesec{jox.bst}
\bibliographysec{all.bib}
Then you run bibtex, as you would normally do, but now you have to run it once for each bibliography, eg:
% bibtex pri
% bibtex sec
Then latex it up again a couple of times to get the references right (again, as you normally would) and voila:


Shiny.
With a standard bibliography TeXShop can bibtex it for you, but it appears not to know about multibib, so you have to do it from the command line (not a big deal for me as I always have several Terminal windows open anyway). Apparently iTeXmac does do multibib, and a lot more besides, but for the moment I am happy with TeXShop so I haven’t tried this yet.
More information about multibib can be found here.
- For that matter, I’m not sure how to do it in Word/Endnote either; I usually ended up cutting and pasting by hand. I’m sure there must be a better way!
- Note that if you also use the jurabib package (and if you are writing in the humanities, you almost certainly are, or should be), you need to call that first, before multibib.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License. Terms and conditions beyond the scope of this license may be available at airminded.org.
Possibly-related posts:
-
Thanks for the details on this. It really helped me understand better the problems I was having with this. I am just starting a humanities PhD and really want to go the Tex route on a Mac ;)
One thing. I am not overly geeky ;) when you refer to “With a standard bibliography TeXShop can bibtex it for you, but it appears not to know about multibib, so you have to do it from the command line’, what command would you use? I presume from Terminal.
I just want a plain bibliography without citations etc. and use ‘\nocite{*}’ with the single .bib which works but not sure if that is OK with multibib?
Apart from the multiple bibliography bit Texshop works well, especially with Xetex.
Thanks.
-
Thanks Brett.
I finally worked out a solution for my needs (i.e. a bibliography with no text/citing and with multiple .bib files) in the form of ‘bibtopic’ found here;
http://www.ctan.org/tex-archive/macros/latex/contrib/bibtopic/
Probably the best option for a straight bibliography and it also has options for citing and use of as many .bib files as you want (max. is 16 in TeX I believe).
If you are using TexShop on the Mac like me and Brett, then you will need to manually run bibtex from the Terminal as he says. Just to clarify that step, once you have installed ‘bibtopic’ and made your .tex file with \usepackage{bibtopic} included in the preamble (see below) I did this;
Open Terminal (in Utilities folder). select ‘New Shell’ from the menu. Type;
cd
add a space, then drag the folder containing the .tex file (and .bib files) which will then add the correct path to the file and press return. Then enter;
bibtex ‘whateverfile1′
you can see the file names in the console window when you run latex the first time. bibtopic shows these which helps. they are shown with a number added to the end, Like this (your file names will be different);
“Package bibtopic Warning: Please (re)run BibTeX on the file(s):
(bibtopic) bibtopic1
(bibtopic) bibtopic2
(bibtopic) and after that rerun LaTeX.”Press return and repeat for the number of .aux files there are. Then return to Latex and run, when it should work. If not double check the correct file paths and the manual.
Here is a sample .tex code which should work with ‘bibtopic’ including notation which can be deleted.
\documentclass{article}
\usepackage{bibtopic}
%add whatever other parts to the preamble. natbib is compatible.
%I also set \bibliographystyle here but it can be set for each section.
%also works with xetex/ xelatex on the mac.\begin{document}
\begin{btSect}{bibfilegoeshere}
\section*{title goes here}
\btPrintAll
\end{btSect}% \btPrintAll means all contents of all .bib files gets printed which is
%what I wanted. other options allow citing from document. see manual.\begin{btSect}{otherbibfilegoeshere}
\section*{other title goes here}
\btPrintAll
\end{btSect}
\end{document}Once working customise as you wish. It supports ‘natbib’ and other packages including the Xetex/XeLatex engines.
I am no expert so DO read the manual! but hope this helps others.
-
Happy to spare others some of the pain ;)
-
Thanks for the information on multibib.
However, in order to get multibib working correctly via Texshop I’ve been force to edit the bbl files manually. Without such editing the final latex output insisted upon omitting one particular reference and placing another particular reference in the wrong place at the start of the bibliography. Very weird. The database was quite small (only approx. 150 references) so it is still manageable to edit the bbl files manually but I’m a little worried that for larger databases I won’t be able to spot the gaps or misplacements. I was wondering whether this had happened to anyone else. If so, what is the solution?
Owen
-
Brett: from the above screenshots I can see you’ve had no problems getting the parentheses around the publisher in your references. I’m also using jurabib but whatever I do (using the oxford option in \jurabibsetup{}, different values for \bibliographystyle{} for example) I can’t get the parentheses to appear! I’m currently adding a ( to the location and a ) to the date to simulate the effect. Any ideas? If you have the preamble from your LaTeX file that might help (I can see if using that gets it to work and work backwards.) Hope you don’t mind me asking like this!
I’m on a Mac by the way, using Textmate and BibDesk.
-
Hi everyone,
This is a really helpful comment thread, since it deals with TeXShop and BiBTeX on the Mac, but I think I’m running a bit behind here, since I am not very good with UNIX. I have a relatively simple question about how to just get a simple bibliography using the author-date style and a .bib file generated from my bibliography manager, BookEnds.
Anyway, I have a simple sample document set-up which begins:
\documentclass[11 pt]{article}
\usepackage{fullpage}
\usepackage{natbib}\begin{document}
\citet{Example07}
\end{document}
My really simple question is:
1. Where do I put the .bib file?
2. Do I need (and where do I put the) .bst file?
3. What’s the exact command from the Terminal to run BibTeX?
4. Can’t I just run BibTeX from TeXShop on the .aux file?
5. Where do I put the \bibliography{} command? (and what goes in the {}?)OK, that’s actually five questions. But I would be grateful for any advice you all might have.
David
P.S. By the way, read your earlier comments on EndNote here, and I agree on the difficulties of going back, once you’ve started down this road. However, I originally started using BookEnds for OS X, mainly because it crashes rarely compared to EndNote, but also because it allows me to group my citations like a fast Mac app. It’s also cheaper than EndNote, imports from EndNote, and exports BibTeX. The only drawback is lack of Spotlight support.
-
After some experimenting, I unfortunately have to conclude that multibib does not like the APA bibliography style (apacite.sty). The .aux files that are generated during the first run of ‘latex’ do not have any \citation commands. This is rather annoying since my school dictates to use this bibliography style. I am not on a Mac (Ubuntu), but I guess there should be no difference in behaviour, right?
Would you happen to know an alternative? -
As a follow-up, I managed to get done what I wanted using the chapterbib package. I followed the guide located here:
http://swp.yngve.com/packages/chapterbib.txt
I thought it might interest you. Especially, point 5 helped me a lot. I now get a separate list of references in my appendices using apacite. Only thing is, that if you use a reference in the appendix (e.g. in a paper) that is not used in the ‘root’ document, then that reference will also show up in the ‘root’ references list. Not 100% perfect, but I think it is ok now. -
Hi all,
Very helpful comments so far! But I have one additional question: I’m using MacTex with BibDeskt and TextMate. After a long search through the web I found a .bst file according to my needs (The Quarterly Journal of Economics) but do not know where to store that file. I found (all?) pre-installed .bst files in “/usr/local/texlive/2007/texmf-dist/bibtex/bib/” so I droped the qje.bst in the same folder (under “economics” but also tried “harvard”).
I followed the instruction from the .bst file and therefore included the following lines:
\usepackage[square]{harvard} \bibliographystyle{qje}
\newcounter{forroman}
\usepackage{ulem}
\newcommand{\asroman}[1]{
\setcounter{forroman}{#1}
\Roman{forroman}
}Now, TextMate does tell me that it cannot find the qje.bst. So, how do I make it to find the correct qje.bst?
Hoping anyone of you has already done that trick and can help me out!
Thanks a lot!
pas
-
Hi there,
i am sorry cause i got to digg this one out again, but unfortunately i am still stuck with the combination of texshop, natbib and multibib.What i understood is that texshop isnt just working from the getgo, just i like it usually does. i just don´t know how to manually run bibtex.
if my file is called workingpaper.tex, shouldn´t i just open the MAC OS X terminal got to that directory and type bibtex workingpaper.tex ?? if i do so i just get bibtex: command not found.anyway the system is running, texshop compiles everything usually.
i also tried itexmac, but i couldn´t get it to typeset.-> the best way for me would be to keep texshop. I just need a little more help with the terminal running bibtex thing…
-
Hi, i have a problem with multibib. This my sample:
\documentclass{article}
\usepackage{multibib}\newcites{publi}{Publications}
\begin{document}
blalalalalal \cite{uschold96}
blalalalallala \citepubli{dutot07}.\bibliographystyle{plain}
\bibliography{These}\renewcommand{\refname}{Publications}
\bibliographystylepubli{plain}
\bibliographypubli{These}\end{document}
But only the first reference (uschold96) appears. The compilator can’t find the second citation. i d’ont konw why.
Than you for your help! -
ummm…
it’s all very well
how to do thia dn that and what not
but can come one please explain where to place what files?!?

22 comments
Comments feed for this article
Trackback link: http://airminded.org/2006/02/25/multiple-bibliographies-in-latex/trackback/