# How Tos

Here's a list of techniques with Mac hardware/software, and using LaTeX and HTML/CSS that I've found useful over the years:

### Install Postscript pfb fonts on Mac OS X

Problem: Postscript fonts can't be managed with FontBook.

Solution: Postscript pfb format fonts can be converted to otf using a couple of free tools. First, download and install Fontforge. Then download the conversion script pfb2otf. Launch the script and select the pfb files which need converting. otf format files will be created in the same directory, which can then be managed with FontBook or another font management application.

### Male and female symbols, the Euro and problems with "implies"

Problem: packages with extra symbols need to be loaded to typeset the male and female symbols (eg. for biology papers) and the Euro. Some packages cause problems with using the \Rightarrow symbol.

Solution: Male and female symbols are in the wasysym package and are accessed with \male and \female. The marvosym package contains the Euro in various fonts as well as industrial symbols, but including the whole package causes \Rightarrow to be displayed as a colon.

\DeclareFontFamily{OT1}{mvs}{}
\DeclareFontShape{OT1}{mvs}{m}{n}{<-> fmvr8x}{}
\def\mvs{\usefont{OT1}{mvs}{m}{n}}
\def\mvchr{\mvs\char}
\def\EUR{{\mvchr164}}

and access the Euro symbol with \EUR. Other symbol codes are listed on Marvosym.com and a document with a comprehensive listing of symbols available in LaTeX is on CTAN.

### Write bold-face vectors and partial derivatives conveniently

Problem: the LaTeX command $\vec{x}$ typesets "arrow style" vectors and typesetting partial derivatives is cumbersome.

Solution: insert the following lines in the header:

\renewcommand{\v}[1]{\mathbf{#1}}
\newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}

Then write bold-face vectors with $\v{x}$ and partial derivatives with $\pd{x}{t}$.

### Use umlauts in BibTeX entries

Problem: umlauts use the double quote, which also ends a BibTeX field entry.

Solution: enclose the character in curly braces, e.g.

title="G{\"o}del's Incompleteness Theorem"

### Include large chunks of tabbed code

Problem: cutting and pasting tabbed code into a verbatim environment often looks nasty.

Solution: insert \usepackage{moreverb} in the header and then include your code file with:

\verbatiminput{myfile.ext}

for non-tabbed code or:

\verbatimtabinput[n]{myfile.ext}

for tabbed code, where n is the number of spaces indented with each tab.

### Nicely formatted fractions in the line of text

Problem: using \frac{a}{b} in a paragraph shrinks the type size and looks awkward.

Solution: I use two different solutions. For fractions with a single digit as numerator and denominator I create a new type of fraction \slantfrac:

\def\slantfrac#1#2{ \hspace{3pt}\!^{#1}\!\!\hspace{1pt}/ \hspace{2pt}\!\!_{#2}\!\hspace{3pt} }

This formats the numbers nicely on the line of the text with a slanted line between numerator and denominator. eg. write ½ with:

$\slantfrac{1}{2}$

The other option is to include the amsmath package in the header and then to use \dfrac{a}{b} instead of \frac. This is also called in the math environment, it formats the full-sized fraction and increases the spacing between the lines. This also works in an eqnarray environment.

### Cite websites in BibTeX/typeset URLs

Problem: there's no defined field for websites in BibTeX

Solution: use the @misc{...} field entry. If you know the author then include the author field. If not, you must include a key field for BibTeX to alphabetise by. Include the url package in the header and insert using:

howpublished="\url{http://www.ucl.ac.uk/~ucbpeal}"

Oh, and don't use Wikipedia for all your references!

### Change or suppress the name of the abstract or references

Problem: I don't want "Abstract" written above my summary.

Solution: rename the abstract to "Summary" with:

\renewcommand{\abstractname}{Summary}

or the references to "Bibliography" with:

\renewcommand{\refname}{Bibliography}

I like the abstract ruled above and below with a line and with no title. I remove the title with:

\renewcommand{\abstractname}{vspace{-\lineheight}}

and rule above and below with:

\noindent \rule{\linewidth}{1pt}
\begin{abstract}
\noindent Abstract text here ...
\end{abstract}
\noindent \rule{\linewidth}{1pt}