[Tex/LaTex] Multiple bibliographies without BibTeX

bibliographiessubdividing

I'm compiling a journal in which each paper is a \section*, using \include to put the whole thing together. Reference-wise each paper has the following format:

``Lorem''.\footnote{Bostock \cite{bostock2} p.~87.}
``Ipsum''.\footnote{Ibid.~p.~133.}

\begin{thebibliography}{99}

\bibitem{bostock2} Bostock, D. (2009) \emph{Philosophy of Mathematics}. Oxford: Wiley-Blackwell.

\end{thebibliography}

This works reasonably, but I've realised it's buggy if two papers use the same label (which, since papers are typeset separately, is very possible). So if Paper 1 only cites bostock2 but Paper 2 cites bostock1 and bostock2 in that order, the footnotes that ought to read [1] in Paper 1 will read [2].

I appreciate that this is a very messy way to be doing things anyway, but is there a minimally-disruptive way (viz. one that doesn't involve making non-specialists spend even more time rearranging someone else's bibliography than they do already) to fix this?


MWE:

\documentclass{article}
\begin{document}

\section*{Paper 1}

Ipsum \cite{ipsum}, % I want this to produce the text '[1]', since it is number 1 in this paper's bibliography.
Dolor \cite{dolor}

\begin{thebibliography}{9}
\bibitem{ipsum} Ipsum
\bibitem{dolor} Dolor
\end{thebibliography}

\section*{Paper 2}

Lorem \cite{lorem}, Ipsum \cite{ipsum}

\begin{thebibliography}{9}
\bibitem{lorem} Lorem
\bibitem{ipsum} Ipsum
\end{thebibliography}

\end{document}

Best Answer

You can apply ChrisH's prefix solution as a software fix by modifying the macros to add the prefix automatically. To do this, add in the preamble:

% Save old cite/bibitem command(s)
\let\oldcite\cite
\let\oldtextcite\textcite % Add others as needed
\let\oldbibitem\bibitem

% Add new counter to increment at each paper
\newcounter{papernum}
\def\nextpaper{\stepcounter{papernum}}

% Define new cite/bibitem command(s) with prefix applied
\def\mynewcite#1{\oldcite{\thepapernum#1}}%
\def\mynewtextcite#1{\oldtextcite{\thepapernum#1}}%
\def\mynewbibitem#1{\oldbibitem{\thepapernum#1}}%

% Reroute original commands to new commands
\let\cite\mynewcite%
\let\textcite\mynewtextcite%
\let\bibitem\mynewbibitem%

And then the only other change needed is to add \nextpaper at the beginning of each paper. As noted in the code below, you could apply this to all \section* commands, but you would need to take care that the counter is not incremented in places where it shouldn't be (like right before the references are typeset, in this case).

As desired, the output becomes:

bibliography

Full Code

\documentclass{article}
\begin{document}

% Save old cite/bibitem command(s)
\let\oldcite\cite
\let\oldtextcite\textcite % Add others as needed
\let\oldbibitem\bibitem

% Add new counter to increment at each paper
\newcounter{papernum}
\def\nextpaper{\stepcounter{papernum}}

% Define new cite/bibitem command(s) with prefix applied
\def\mynewcite#1{\oldcite{\thepapernum#1}}%
\def\mynewtextcite#1{\oldtextcite{\thepapernum#1}}%
\def\mynewbibitem#1{\oldbibitem{\thepapernum#1}}%

% Reroute original commands to new commands
\let\cite\mynewcite%
\let\textcite\mynewtextcite%
\let\bibitem\mynewbibitem%

\section*{Paper 1}\nextpaper %This could be wrapped into whatever unit you use to start a new paper; just make sure another sectioning command (in this case, References is also a \section*) doesn't increment the counter in places you don't want it to.
Ipsum \cite{ipsum}, % I want this to produce the text '[1]', since it is number 1 in this paper's bibliography.
Dolor \cite{dolor}

\begin{thebibliography}{9}
\bibitem{ipsum} Ipsum
\bibitem{dolor} Dolor
\end{thebibliography}

\section*{Paper 2}\nextpaper
Lorem \cite{lorem}, Ipsum \cite{ipsum}

\begin{thebibliography}{9}
\bibitem{lorem} Lorem
\bibitem{ipsum} Ipsum
\end{thebibliography}

\end{document}

Alternative

Just another thought...

ChrisH also commented, "I assume joining PDFs isn't an option, as articles may share a page?" This is actually a strategy employed by some journals, where papers are designed with wider margins and no header/pagenumber. These "camera-ready" papers can be added to the journal doc with pdfpages and have the header/pagenumber generated within the bigger package and overlaid on the papers (via a mechanism similar to the answer here).

For example, the IEEEtran.cls class is designed with this approach in mind. Excerpts from the documentation note:

  • The margins are increased as the height of the text is reduced to about 9.25in. In particular, the bottom margin will become larger than that of the top as IEEE wants extra clearance at the bottom. The text height will not be exactly 9.25in, but will vary slightly with the normal font size to ensure an integer number of lines in a column.

  • Headings and page numbers are not displayed in the headers or footers. This, coupled with symmetric horizontal margins, will mean that there will not be a noticeable difference between one and two sided options.

and

Publication IDs are not to be placed by the author on camera ready conference papers so \pubid{} is disabled in conference mode. Instead the bottom margin is automatically increased by IEEEtran when in conference mode to give IEEE room for such marks at the time of publication. In draft mode, the publisher ID mark will not be printed at the bottom of the titlepage, but room will be cleared for it.