latex.bashrc function for latex2e source compilation 

Here is my .bashrc function for compilation of LATEX2e sources into dvi, ps and pdf output file formats. The function includes bibtex and index processing.

function ltex()
{
    if [ "$1" == "" ]; then
        FILE="paper";
    else
        FILE=`echo $1 | sed -e 's/..*//'`;
    fi
    if [ -f $FILE.tex ]; then
        latex $FILE.tex;
        bibtex $FILE.aux;
        makeindex $FILE;
        latex $FILE.tex;
        bibtex $FILE.aux;
        makeindex $FILE;
        #latex $FILE.tex && dvipdf $FILE.dvi;
        latex $FILE.tex && dvips -Ppdf -G0 $FILE.dvi -o $FILE.ps && ps2pdf14 $FILE.ps;
    fi
}

To use it, first add it to your .bashrc, then start a new shell. To compile LATEX2e paper.tex source run

ltex paper # ©2007 dsplabs.com.au

Did you find the above information useful and interesting? If so, please support this site by using the blog directory links at the bottom of this page. Thanks for your support!

If you have any Linux related problems or questions then please feel free to post them on our Linux Forums: http://linux.dsplabs.com.au/forums.




VPS Hosting Referral Code DZZCC3

Add me to Technorati Favorites Vote for me on Blog Catalog

One Response to “latex.bashrc function for latex2e source compilation”

  1. Anonymous Says:

    try rubber
    http://www.pps.jussieu.fr/~beffara/soft/rubber/

    just run it on source tex file and it will take care of toc/bib reruns, etc.

Leave a Reply