LaTeX Resources

This repository contains some latex resources that I find useful. This is a development repository: users should download the shell repository as described below:

To fully use this project:

  1. Clone the shell repository, pull the changes, and update (you only need to clone once: later just do the pull and update). The following clones this to a directory called mmfbb.latex (MMF BitBucket):

    hg clone https://mforbes@bitbucket.org/mforbes/latex-shell mmfbb.latex
    cd mmfbb.latex
    hg pull -u                   # Pulls and updates files.
  2. Generate the required packages and classes in the latex project:

    make package
  3. Make the contents visible to TeX and friends. The suggested way of doing this is to symlink or copy the following:

    ln -s "$(pwd)/build/latex" -> "${TEXMFLOCAL}/tex/latex/mmf"
    ln -s "$(pwd)/build/bibtex/bst" -> "${TEXMFLOCAL}/bibtex/bst/mmf"
    ln -s "$(pwd)/build/bibtex/database" -> "${TEXMFLOCAL}/bibtex/bib/mmf"

    This is done by:

    make install

For a user-specific installation, ${TEXMFHOME} can be used instead of ${TEXMFLOCAL}. To do this, change TEXMFLOCAL before executing make, i.e.:

export TEXMFLOCAL="$(kpsewhich -expand-var '$TEXMFHOME')"
make install

Now you should be able to use any of the styles in your latex files (such as \usepackage{mmfmath}) and my master bibtex database with \bibliography{master}.


I use the mmf.cls document class for most of my documentation. It contains a bunch of useful features. In particular, keep the file latex/localconfig.sty handy. (I make a symlink to my home directory.) If this exists, then it will be input at the \begin{document} command allowing you to provide some machine-dependent customizations. I use this to issue the \ubcsetup{screen=1.25} command which optimizes the output for a two-page spread on my 17" MacBook Pro screen. The number should be the aspect ratio of the desired page (height/width) and will ensure that a single page fills half the screen with minimal margins.


I use BibDesk on a Mac and the master.bib file is the interface to all of the papers. This database also uses the apsrev4-1.bst macros for journal fields (i.e. prl instead of hardcoding {Phys. Rev. Lett.} so you will need to include this style (or at least include the macros).

If you wish to use BibDesk to link my master.bib database to the set of files, then you should setup the following preferences in BibDesk:

  1. In General, set Open file... to bibtex/database/master.bib (if you want this to be your default database).

  2. In TeX Preview, set BibTeX style to be apsrev4-1 and change the TeX template to something like the following, which will use the aps style (the important change are the offsets):

    \textwidth = 6.5in
    %\voffset = -105pt
    %\hoffset = -120pt
    \voffset = -50pt
    \hoffset = -50pt
    % The following command is provided for LaTeX2RTF compatibility with amslatex.
  3. In the Fields preference pane, I recommend adding Eprint, and Archiveprefix as default Textual fields, and add Doi as a default Remote URL field. I use these to generate the autofile paper names. Also, in the Global BibTeX Macros field, add the file /usr/local/texlive/2011/texmf-dist/bibtex/bst/revtex/apsrev4-1.bst or the equivalent on your system. This will allow BibDesk to know which macros are defined.

  4. On the Cite Key pane I am using the Preset Format "First Author | : | Year | Sufficient Unique Letters" which looks like %a1:%Y%u0. I may change this.

  5. In AutoFile I File papers in a fixed location pointing to bibtex/database, and File papers automatically. (I could not get the relative filing to work across computers.) I also use a custom Preset Format set to BibDesk/%a1/%Y%s{Doi}[_]%f{Doi}%s{Eprint}[_]%f{Eprint}%u0%e. This should be unique and determinable from the papers, but gives some problems the keys are not defined... I might change this later.