LaTeX Hints and Notes
=====================
This is not intended as a general LaTeX page, but more like a tips and
tricks corner where I share some of my favorite LaTeX packages. (If
you use LaTeX, you will probably have come to the same conclusion as
me, that the best source for LaTeX tips, tricks, and problem solutions
is to ask other LaTeX users around you.)
There are also several interesting subpages concerning TikZ_, a
graphics/drawing package which I discovered in 2007 and which is
certainly one of the best LaTeX packages I know (not surprisingly, it
is by the same author as Beamer_, which is the best solution I know
for creating *presentations* using LaTeX).
.. _TikZ: http://sourceforge.net/projects/pgf/
.. _Beamer: http://latex-beamer.sourceforge.net/
Cross-References
----------------
For cross-references, I have been using prettyref_ a lot. For example,
I have this in my preamble:
.. code-block:: latex
\usepackage{prettyref}
\newrefformat{fig}{Fig.~\ref{#1}}
\newrefformat{par}{section~\ref{#1}}
\newrefformat{sec}{section~\ref{#1}}
\newrefformat{sub}{section~\ref{#1}}
\newrefformat{table}{table~\ref{#1}}
\newrefformat{alg}{algorithm~\ref{#1}}
\newrefformat{Def}{definition~\ref{#1}}
\newrefformat{Thm}{theorem~\ref{#1}}
\newrefformat{step}{step~\ref{#1}}
\newrefformat{eq}{equation~\eqref{#1}}
\def\Eqref Eq:#1:{\eqref{eq:#1}}
\newrefformat{Eq}{Equation~\Eqref#1:}
Then, I use labels like ``\label{fig:house-example}`` for my figures,
``\label{sub:preliminaries}`` for sub(sub)sections and so on. A
special trick has been used for equations: When I want to start a
sentence with "Equation (4) defines ..." I have the problem that
prettyref would normally not capitalize the word "equation"
automatically. I solved this by introducing a reference format "Eq:"
which I can use for referencing an equation at the beginning of a
sentence. This which nevertheless references the corresponding
equation whose label starts with "eq:" (the de-capitalization is done
through the helper definition "\Eqref").
I have been told that cleveref_ does this automatically, with a syntax
similar to prettyref_, and I have been pointed to the newer refstyle_
package. (As a side note, there's also fancyref_, but that's
considered outdated.)
I have been using prettyref_ successfully with LyX_ for a very long
time, so I did not yet try out these alternatives (which seem to be
supported by latest LyX versions, too).
.. _prettyref: http://www.ctan.org/tex-archive/macros/latex/contrib/prettyref/
.. _fancyref: http://www.ctan.org/tex-archive/macros/latex/contrib/fancyref/
.. _refstyle: http://www.ctan.org/tex-archive/macros/latex/contrib/refstyle/
.. _cleveref: http://www.ctan.org/tex-archive/macros/latex/contrib/cleveref/
.. _LyX: http://www.lyx.org/