[Tex/LaTex] hide uncited bibitems in the bibliography

bibliographies

I have a shared bibliography.tex file with a set of bibitems:

\begin{thebibliography}{99}
\bibitem{A} A
\bibitem{B} B
\end{thebibliography}

I have a series of tex files that include this file, each of which produces an output pdf. They are compiled with pdflatex. Their content:

\begin{document}
%...
\cite{A} %A or B is cited here
\end{document}

I'd like to exclude from the bibliography of the output pdf files those bibitems (in the example A or B) that were not cited in the specific source tex file.

Is there an easy way that does not require going through the pain of bash scripting or compiling with bibtex?

Best Answer

I had to chances but to use bibtex plus cite package and adding the references like this:

\nocite{}
\bibliographystyle{plain}
\bibliography{../../common/bibliography}

The nocite command discards all the bibliography not explicitly cited. No need for biblatex package metioned around and no use of theblibliography command which did not discard uncited stuff.

Related Question