Creating separate pdf file containing the bibliography
Here is some acrobatics that uses two .tex
files. First use atbegshi
and discard the bibliography and then add it in the second file. The following is named, say test.tex
\begin{filecontents}{testttt.bib}
@ARTICLE{author,
title={A sample article},
author={Random Author},
journal={Random journal},
volume = {10},
year = {2000},
}
\end{filecontents}
\documentclass{article}
\usepackage{natbib}
\usepackage{atbegshi}
\begin{document}
As shown by \citet{author}, using references can be interesting
\newpage
\AtBeginShipout{%
\AtBeginShipoutDiscard
}
\bibliographystyle{apalike}
\bibliography{testttt}
\end{document}
This will not produce the bibliography.
Now create a new file called reference.tex
with the following
\documentclass{article}
\usepackage{natbib}
\begin{document}
\bibliographystyle{apalike}
\input{test.bbl} %% watch out for the same name
\end{document}
This will give you
If you want a single .tex
file, we can complicate things further ;-) Following is the test.tex
file that will give you two pdf files -- test.pdf
having proposal and reference.pdf
having references.
\documentclass{article}
\usepackage{natbib}
\usepackage{atbegshi}
\usepackage{filecontents}
\begin{filecontents*}{reference.tex}
\documentclass{article}
\usepackage{natbib}
\begin{document}
\bibliographystyle{apalike}
\input{test.bbl} %% watch out for the same name
\end{document}
\end{filecontents*}
\begin{filecontents*}{testttt.bib}
@ARTICLE{author,
title={A sample article},
author={Random Author},
journal={Random journal},
volume = {10},
year = {2000},
}
\end{filecontents*}
\immediate\write18{pdflatex reference}
\begin{document}
As shown by \citet{author}, using references can be interesting
\newpage
\AtBeginShipout{%
\AtBeginShipoutDiscard
}
\bibliographystyle{apalike}
\bibliography{testttt}
\end{document}
However, if the page numbers need to be continuous, it is better to use pdfpages
as suggested by cfr.
Perhaps the simplest way is to compile the PDF normally and then use 2 wrappers with pdfpages
to produce the 2 PDFs. The following assumes that your main article is main.tex
and so produces main.pdf
when compiled:
\begin{filecontents}{\jobname.bib}
@ARTICLE{author,
title={A sample article},
author={Random Author},
journal={Random journal},
volume = {10},
year = {2000},
}
\end{filecontents}
\begin{filecontents}{body.tex}
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=1]{main}
\end{document}
\end{filecontents}
\begin{filecontents}{biblio.tex}
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=2]{main}
\end{document}
\end{filecontents}
\documentclass{article}
\usepackage{natbib}
\begin{document}
As shown by \citet{author}, using references can be interesting
\newpage
\pagenumbering{arabic}% comment out for continuous numbering
\bibliographystyle{apalike}
\bibliography{\jobname}
\end{document}
Here is the body:
and references: