This blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://scrolls.mafgani.net/ and update your bookmarks.

Friday, August 10, 2007

User installation of additional TeX/LaTeX classes and styles

When you are the sysadmin, you can simply drop the new class/style files under the system TeX path (e.g. /usr/share/texmf/tex/) and run 'texhash' to have them automatically picked up. But what do you do when you are just a regular user?

TeX/LaTeX looks at the TEXINPUTS environment variable to look for additional locations to search for included/referenced files. Therefore, new classes/styles can be easily added as follows:

  1. Create a directory for the files:
    $ mkdir -p $HOME/tex/latex

  2. Place the new class files into that folder (each class can be in its own directory and contain subdirectories):
    $ cp -a fancy-class $HOME/tex/latex/

  3. Export the TEXINPUTS variable and also add it to your $HOME/.bash_profile:
    $ export TEXINPUTS=.:$HOME/tex/latex//:$TEXINPUTS

The '.' ensures that the working directory is included in the search path. The double-'//' tells bash to also include files in subdirectories of '$HOME/tex' recursively.

New BibTeX files can also be added locally in a similar fashion. The variables to set are then BSTINPUTS and BIBINPUTS.

The environment variable to set for MakeIndex styles is: INDEXSTYLE.

Source: AstroNat - Installation at The Smithsonian/NASA Astrophysics Data System

UPDATE [16 July 2009] The Kpathsea manual provides a wealth of information about usable environment variables.

Network Security

Friday, August 03, 2007

Joining PDF Documents

A quick search on the web reveals that the simplest (and most available) command to do so is:


$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf


Source: Putting together PDF files by Scott Nesbitt on NewsForge