Tuesday, January 23, 2007

Nomencl

Q. Make my nomenclatures work damnit!

A. ok ok.. so i've been focusing on this for the better part of a week. But i found an easier solution that doesn't require applescript or shell scripts to do it. In the folder ~/library/texshop/engines I copied the tetex engine and renamed it nomenclature.engine with the following text inside it:

#!/bin/sh

bfname=$(dirname "$1")/"`basename "$1" .tex`"
makeindex "$bfname".nlo -s ~/library/texmf/tex/nomencl/nomencl.ist -o "$bfname".nls


The exact directory location of nomencl.ist is required since i manually installed my own updated version of nomencl.ist

Now I typset it Latex-Nomenclature-Latex and everything works beautifully!


Or change the last line to:

makeindex "$bfname".nlo -s nomencl.ist -o "$bfname".nls

if you have an updated copy of nomencl.

Monday, January 22, 2007

Shell Scripts

Q. Shell scripts.. Simultaneously when I was learning Applescripts, i've learned shell scripts. This is what I know so far
A.

  1. ls - directory listing
  2. cd .. - same as windows but with a space before the double dots
  3. man - gives the manual for any command ex: man ls
  4. clear -
  5. top - shows what programs are running
  6. [ ] means anything optional
  7. ./file - this runs the file in the current directory instead of something in the path
  8. chmod +x file - makes the file an executable
  9. vi - is some sort of editor with a complex set of commands

Applescript

Q. Ok soo.. I wanted to change directories using the Do Shell Script command in Applescript. The problem was that the directory had a space in it "Thumbdrive 2". (On a side note, why is there a "Thumbdrive", and a "Thumbdrive 1" in my /volumes folder when I only have one actual Thumbdrive plugged in?)
Anyway.. Here's how to do it

A.
  1. do shell script "cd " & quoted form of "/Volumes/THUMBDRIVE 2" & ";ls"
  2. do shell script "cd \"/Volumes/THUMBDRIVE 2\" ;ls"
The ls was just to use the ; command

Monday, January 8, 2007

Nomencl.sty

Question: How do you implement the nomencl.sty package in Latex using the front end for macs called TexShop?

Answer:
Well its not that easy.
  1. First of all you have include two packages in the preamble "\usepackage{nomencl}" and "\usepackage{makeidx}".
  2. Then you have to include the command "\makenomenclature" in your preamble.
    1. This is only true for the newest version of nomencl.ins If you have an older version it will likely want you to use \makeglossary
  3. Use \printnomenclature where you want it printed in the body (generally under the abstract)
  4. \nomenclature{$N$}{This is is the number N} is an example of a line for each item.
  5. Then Typset the document using LaTex
  6. This will create a file called .nlo
  7. In terminal (unfortunately) type:
    1. makeindex Journal\ Paper\ 2006.nlo -s ~/library/texmf/tex/nomencl/nomencl.ist -o Journal\ Paper\ 2006.nls
    2. Clearly this command was for my "Journal Paper 2006.tex" file
    3. furthermore, you must first navigate to the folder containing the .tex file, or include its path in the command
  8. Then go back and typset your document again using Latex