The best quality LaTeX is made with Rubber

From Ben's Writing

Jump to: navigation, search

Well, that may be overstating the point, but it makes for a good title. I ran in to this tool today, just by chance. Rubber handles everything for building LaTeX documents.

In the past, I have used Makefile or the following bash macros to build my documents:

function makepdf () 
{ 
   NAME=${1%\.*};
   TOOL=${2:-pdflatex};
   if [[ -f ${NAME}.bib ]]; then
       /bin/rm -i -f ${NAME}.bbl;
       ${TOOL} ${NAME};
       bibtex ${NAME};
       ${TOOL} ${NAME};
   fi;
   ${TOOL} ${NAME};
   if [[ "${TOOL}" == "latex" ]]; then
       dvipdf ${NAME};
   fi
}

function openpdf ()
{ 
   NAME=${1%\.*};
   if makepdf ${NAME}; then
       if [[ -f ${NAME}.pdf ]]; then
           open ${NAME}.pdf;
       fi;
   fi 
}

With Rubber, I will just need:

function makepdf () 
{ 
   NAME=${1%\.*};
   rubber --pdf ${NAME}.tex;
}

function openpdf () 
{ 
   NAME=${1%\.*};
   if makepdf ${NAME}; then
       if [[ -f ${NAME}.pdf ]]; then
           open ${NAME}.pdf;
       fi;
   fi
}

Which mean I can still run:

$ openpdf tensor.

To build my document (note the trailing dot is a product of bash-completion, but is handled by makepdf). What's more, I now get better error messages:

$ makepdf tensors.tex
compiling tensors.tex...
There were errors compiling tensors.tex.
tensors.tex:105: Missing $ inserted.

How's that for concise? Much nicer than 3-4 screens of macro, font and style listings.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox