Wednesday, March 25, 2009

Some LaTeX tips

1. How to typeset Exercise questions and answers in LaTeX?

Use the exercise package. It is available in texlive package in Ubuntu. The following customizations were done by me for typesetting it like a faq. The following would remove unnecessary frills from the typeset document.
\renewcommand{\ExerciseListName}{Que}

\renewcommand{\ExerciseListHeader}{\ExerciseHeaderDifficulty%
\textbf{\ExerciseListName\ExerciseHeaderNB%
\quad\ExerciseHeaderTitle}%
\ExerciseHeaderOrigin\ignorespaces}

\renewcommand{\AnswerListHeader}{\textbf{Answer\quad}}



2. How to include multiple authors in bibtex author field?

Use "and" between author names. For example,

@Book{stein2005,
author = {Elias M. Stein and Rami Shakarchi},
title = {Real Analysis},
publisher = {Princeton University Press},
year = {2005}
}


3. Using svn, svn-multi and eclipse

The documentation given in
 http://www.tug.org/pracjourn/2007-3/scharrer/scharrer.pdf

is excellent but one should be careful of the following:
  1. When you use the 'svn propset' command as mentioned, if you cut and paste from the pdf file be careful. The commas may not translate properly into the text terminal and I had to waste a lot of time in identifying this.
  2. The fink package that comes with ubuntu 8.04 is outdated. You may have to get the latest ones from say CTAN.
  3. If you do commit within eclipse, it does not work (unfortunate :( ). I had to commit from command line.
  4. Be careful to use \svnfilerev,\svnfileday,\svnfilemonth,\svnfileyear,\svnhour,\svnfileminute etc if you want the svn revision data belonging to each file to appear. If you omit the file keyword in the above commands you will only get the latest revision number and date, considering all your files together. If you want the details regarding the revision of each file to be kept (say as footer or so) use the commands with 'file' present in them.


    4. Referencing
I have been using fancyref. But I think cleveref is a much better package. The package and documentation are available from CTAN

No comments: