Is there a way (terminal command?) to take a TeX file, possibly with externally linked macros, bibstyle files, bibTeX source, etc., and automatically produce a single, self-contained TeX file? For example, I could generate the bbl file, copy and paste the entries there and add to the source, but it gets tedious. Anyone solve this problem?

  • 2
    just stick bib files bst files and anything else you need at the start of the tex document, in filecontents environemnts. – David Carlisle Jul 2 '17 at 22:09
  • @HenriMenke Not really a duplicate. This question rather needs that plus one or more of the linked bibliography strategies to create a document-specific .bib etc. – cfr Jul 3 '17 at 1:14
  • @DavidCarlisle Can you elaborate on your suggestion? So if I have a file with macros stored in some central directory (so as to avoid duplication in the working directory, and also clutter in the document), and I want to include that in a document I'm currently working on, how would I use filecontents? I looked at the documentation for the package but couldn't figure out how it would work for this purpose. Thanks! – Skeptic Jul 3 '17 at 14:12
  • you don't need a package, I'll post an example – David Carlisle Jul 3 '17 at 14:47

This document bundles up a local latex package and a local bibtex database as a single file, usimg filecontents, producing

enter image description here

    author={M. Eee and Y. Ouoo},



\zzzz, \cite{zz99}



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.