We use LaTeX to generate PDF documents dynamically from the web. Sometimes reports have bibliography citations, and sometimes they don't.
At the end of our LaTeX document, we have a bibliography block, where all citations are automatically listed (we use BibTeX). But what we want to avoid is to show the bibliography heading when it is empty (with no bibliography entries).
Our actual solution is to add the bibliography block also dynamically, after searching for citations in the final document text, and ensuring that we have, at least, one citation.
Is there another way to do that with LaTeX? I'm thinking about some bibliography block setting or something like this ...