Only insert links to pdfs if we are actually generating these.

 This should silence most warnings in the html only small build on Travis. Waiting for Travis to confirm