# Two Bibliographies: one for main text and one for appendix

I have a manuscript in which has the following structure:

Main Text
Bibliography
Appendix


However, there are citations which are only cited in the appendix, and they show up in the main bibliography. I would like to split my Bibliography into two different sections, so that the structure of the paper would look like this:

Main Text
Bibliography for Main Text
Appendix
Bibliography for Appendix


I'm currently using bibtex and a single .bib file, and creating the bibliography with

\bibliographystyle {someBibStyleFile}
\bibliography {bibFileName}


I'm interested in a method to split my single bibliography into main bibliography and appendix bibliography with minimal changes to the rest of the document. I'm aware that biblatex is more powerful than bibtex, but I'm not prepared to make the switch before the deadline of this project. There are many related bibliography-with-multiple-sections type of questions, but I didn't see one that covers this case.

Here's a solution with the biblatex package. The following shows how to do it. Make sure you run bibtex on all auxiliary files, all *[0-9]-blx.aux files.

\documentclass{article}

\usepackage{filecontents}
\usepackage{biblatex}

\begin{filecontents}{myrefs.bib}
@Book{Knuth:1990,
author    = {Knuth, Donald E.},
title     = {The {\TeX}book},
year      = {1990},
isbn      = {0-201-13447-0},
}

@Book{Lamport:94,
author    = {Lamport, Leslie},
title     = {\LaTeX: A Document Preparation System},
year      = {1994},
isbn      = {0-021-52983-1},
}
\end{filecontents}

\begin{document}

\section{First}
{\LaTeX} is aTuring-complete
(procedural) markup language and
typesetting processor~\parencite{Lamport:94}.

\printbibliography
\appendix
\section{Second}
\begin{refsection}
The ultimate reference of {\TeX} is~\parencite{Knuth:1990}.
\end{refsection}

\end{document}


• I was hoping for a solution that didn't use biblatex – Joe Feb 18 '13 at 5:46
• @Joe Any reason why you don't want to use biblatex? – user10274 Feb 18 '13 at 6:12
• @PatrickT No, I meant bibtex. – user10274 May 14 '16 at 8:34
• Apologies, I was trying to compile it with XeLaTeX. I have successfully compiled it with PDFLaTeX and it looks just like your screenshot (a single .aux file was produced). But no luck with XeLaTeX. Since I was interested in XeLaTeX, I apparently hadn't tried with PDFLaTeX. – PatrickT May 15 '16 at 8:58
• I deleted the comment above where I claimed that I had tried with PDFLaTeX, obviously not true. Problem came from having various shortcuts to compile with different engines and getting mixed up about which shortcut was calling which engine... sigh. – PatrickT May 15 '16 at 9:00

with multibibyou can define more than one bib.

\RequirePackage{filecontents}
\begin{filecontents}{myrefs.bib}
@Book{Knuth:1990,
author    = {Knuth, Donald E.},
title     = {The {\TeX}book},
year      = {1990},
isbn      = {0-201-13447-0},
}

@Book{Lamport:94,
author    = {Lamport, Leslie},
title     = {{\LaTeX}: A Document Preparation System},
year      = {1994},
isbn      = {0-021-52983-1},
}
\end{filecontents}

\documentclass{article}
\usepackage{multibib}
\newcites{latex}{\LaTeX-Literature}%  \citelatex, \nocitelatex, ...

\begin{document}

\section{First}
\citelatex{Lamport:94} wrote \LaTeX.

\bibliographystylelatex{alpha}
\bibliographylatex{myrefs}

\appendix
\section{Second}
The ultimate reference~\cite{Knuth:1990}

\bibliographystyle{plain}
\bibliography{myrefs}

\end{document}


with \newcites{suffix}{heading} you can define the special macros. The example has to be run with

pdflatex <file>
bibtex <file>.aux
bibtex latex.aux
pdflatex <file>


every additional bib needs its own bibtex run and can have a different bibstyle:

You can use the bibunits package and structure your document as follows

\documentclass{book}
\usepackage{bibunits}

\defaultbibliography{<bib-file>}
\defaultbibliographystyle{<preferred bib style>}

\begin{document}
\begin{bibunit}
Main Text
\putbib
\end{bibunit}

\begin{bibunit}
Appendix
\putbib
\end{bibunit}
\end{document}

• It is not clear to me how do you put the two different bibliographys as requested. As is, this seems to print the same biblio in two different places. – leo Feb 18 '13 at 4:41
• This is the standard way bibunit works, \putbib just prints a list of references for the \cite commands in the current unit. – Andrew Swann Dec 5 '13 at 20:11

Another possible solution is to simply compile the body and the appendix separately, and then append them on the back end. A basic script to do this would look like:

latex body.tex
bibtex body.aux
latex body.tex
latex body.tex
dvips -P pdf body.dvi
ps2pdf body.ps

latex appendix.tex
bibtex appendix.aux
latex body.tex
latex body.tex
dvips -P pdf appendix.dvi
ps2pdf appendix.ps

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=main.pdf body.pdf appendix.pdf


In this situation, you would need to surround your appendix.tex with appropriate preamble, \begin{document}, and \end{document}.

The last command (appending via Ghostscript) is taken from the second-ranked answer here. You need to run latex at least thrice, as explained here.

A streamlined script that I wrote (and regularly use), and which you can run from your Linux terminal, is available on GitHub here. It has a few more bells and whistles (syntax checking, deletion of temporary LaTeX compilation files, etc.). The basic syntax is combiner body.tex appendix.tex master.pdf.