Dr. Philip A. Tresadern

Mail: ISBE, Stopford Building, University of Manchester, Manchester M13 9PT, United Kingdom
Phone: +44 (0) 161 275 5114
E-Mail: philip.tresadern@manchester.ac.uk

Befriend Phil on Facebook Follow Phil on Twitter Phil's LinkedIn profile Phil's YouTube channel Phil's Scopus Profile Phil's Google Scholar Profile

Hints: LaTeX

Bold Greek Symbols

When using the maths package to display vectors and matrices, you often want to use Greek symbols with a bold font. After much experimentation, I finally figured out how:
$\boldsymbol{\mu}$

Empty Framebox

When I want to 'reserve' space in a document for a figure I haven't drawn yet, this macro inserts an empty box of given width and height:
\newcommand{\emptybox}[2]{\framebox[#1][l]{\rule[#2]{0pt}{0pt}}}
\emptybox{0.8\columnwidth}{0.2\textheight}

Vertically Aligning Images

When placing two images side by side that are of equal widths but different heights, the default layout (aligning the bottoms of the images) sometimes looks a little funny and it would be preferable to align the centres of the images. Here's one way to do it:
\begin{tabular}{c c}
\begin{minipage}[c]{width} \includegraphics[width=\columnwidth]{im1} \end{minipage}
\begin{minipage}[c]{width} \includegraphics[width=\columnwidth]{im2} \end{minipage}
\end{tabular}

Adding Space After a Macro or Command

When creating a macro (via \def) or command (via \newcommand) to insert text into the document, the space after the macro is used gets suppressed. For example,
\def\Hello{Hello}
...
\Hello World!
will appear as "HelloWorld" (i.e. with the space missing). Put the space back after the macro by adding either empty braces
\Hello{} World!
or a backslash (that forces a character space)
\Hello\ World!
You could insert a space with the '~' character, though this also tells LaTeX not to break over lines at that point (which will usually not be appropriate).