Software:LaTeX Makefile
From SEWiki
This is a makefile I've developed over the last couple of years for building LaTeX documents.
Contents |
Features
- DVI, PDF or PS output
- Automatic dependency generation
- Separation of intermediate and output files from source files, with the ability to store intermediate files elsewhere (such as /tmp)
- Automatic compilation of new source files. (You don't have to edit the makefile for each new source file.)
- Support for building multiple documents
- Can automatically build a .tar.gz distribution file
- Support for fuzz and ztc type checkers for Z
- Support for "flattening" a set of .tex files into a single large .tex file
- Support for HTML output using tex4ht
- Word count
Requirements
- latex (for DVI output), dvips (for PS output), pdflatex (for PDF output)
- Perl
- GNU make, find and grep
Directory Layout
source: Your .tex and .bib files
styles: Any style files
figures: PS and PDF versions of your figures
util: Utility programs used by the makefile
These directories are automatically created:
build: Holds all intermediate files
output: Final files
Any .tex files in the source directory will be analyzed for dependencies. Those files that have a \documentclass line are considered to be "main" files, and will be processed to create the output files.
The distribution contains several example files for IEEE and ACM paper formats, as well as sample files for Master's project, dissertation, and proposal formats. These files demonstrate useful LaTeX tasks such as subfigures and code formatting.
Make Targets
make check: Checks colors, messages, programs
make pdf: Make PDF output
make ps: Make PS output
make dvi: Make DVI output
make html: Make HTML output (this hasn't been tested recently)
make flat: Create a single .tex file from each main .tex file and any dependent .tex files
make clean: Clean out any intermediate build files
make ztc: Type check the document with ztc
make fuzz: Type check the document with fuzz
make dist: Make a .tar.gz file of all the files
make wc: Count the words, not including latex commands
make: Same as make pdf
You can also make specific files. For example make output/mydocument.pdf will make just one document.
How to Use
Just install the supporting files, unpack that paper template, then run make check to make sure everything works okay on your system. Then run make to build the sample files. If that all works okay, then remove, edit, or replace the appropriate files in the source directory. See the README for more information.
If you are on the CS department machines, you can use the shared files that coppit has already installed. Just set these environment variables in your login script (e.g. .bashrc):
export TEXINPUTS=$TEXINPUTS:/home/f85/coppit/share/texmf-coppit/tex
export BIBINPUTS=$BIBINPUTS:/home/f85/coppit/share/texmf-coppit/bibtex/bib
export BSTINPUTS=$BSTINPUTS:/home/f85/coppit/share/texmf-coppit/bibtex/bst
Download
The supporting files and paper template can be found on my code page.
Contact
Send email to David Coppit if you have bug reports or comments.
