peawee dot net

LaTeX Makefile

What this does is build a simple LaTeX + BibTeX document, and outputs a PDF or a PS document. It is available for download here

For those who don’t know makefiles, here’s a basic rundown of usage:

  1. Put latex_makefile in the directory of your document, and rename it to Makefile.
  2. Open up Makefile in a text editor, set TRG to the name of your document (without the .tex), and set HASBIB to yes if you have a BibTeX bibliography, or no if not.
  3. Save and exit your text editor.
  4. Run make in the directory of your document. This will spell-check your document, and then generate a PDF file of whatever your document name is.

This is a rather simple makefile, so it should work almost anywhere, as long as the variables are configured.

There are two other modes of operation, instead of the default:

  • make print also runs the dvi generated by LaTeX through dvips, which by default sends the generated postscript to the default printer (at least on OS X). I do not expect this to be portable; hack in your own printing functions if you want it.
  • make clean cleans the directory of the clutter left behind by running LaTeX, but it doesn’t remove your source TeX or BibTeX files.

I wrote it on Mac OS 10.4.9 for gmake, with latex, dvipdf, and dvips out of fink. I know that latex is available almost anywhere, and dvipdf is available on Fedora Core and OS X. My FC6 installation only shows dvipdf, so printing support will be iffy.

No Responses to “LaTeX Makefile”

Care to comment?