## Saturday, March 15, 2008

### note2latex

Back when I was at Cascadia, I had decided to take my notes in LaTeX. However, I soon realized that pure LaTeX wouldn't do, as it was a bit too generic for my purposes. In order to reduce the load, I wrote a couple of scripts (unnecessary to use two, but I felt like it) and a style file.

#### note2latex

#!/bin/bashTEXPP=/usr/local/bin/texpp.plLATEX=/usr/bin/latexJOBNAME="$1.out"OUT="$JOBNAME.tex"$TEXPP "$1" "$OUT"$LATEX "$OUT"if [[ "grep -i '\\\label' "$OUT" 2> /dev/null" != "" || "grep -i '\\\ref' "$OUT" 2> /dev/null" != "" ]]; then$LATEX "$OUT"firm -f "$OUT"mv -f "$JOBNAME.dvi" "basename "$1" .tex.dvi"mv -f "$JOBNAME.aux" "basename "$1" .tex.aux"mv -f "$JOBNAME.log" "basename "$1" .tex.log"