# How to provide a definition for symbols in a LaTeX math equation?

Say I have an equation:

x = R + E


What's the best way to provide a definition for R and E? Is there a way to include a line under the equation saying what the variables mean (i.e. a "where" clause)? Example:

x = R + E
where R is Racoon, E is Elephant

-

## migrated from stackoverflow.comNov 29 '11 at 11:46

This question came from our site for professional and enthusiast programmers.

Since mathematics (in general) should form part of the textual flow, one can follow an equation with symbol explanations. This would even include proper punctuation in the equation itself:

\documentclass{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac velit dolor.
Nulla nunc dolor, commodo sed consectetur ac, dapibus malesuada odio.
Mauris porta libero eget nisi placerat quis bibendum tellus fermentum. It is therefore
possible to define the relationship
$x = R + E,$
where~$R$ is a racoon and~$E$ is an elephant. Sed suscipit tristique laoreet.
Nulla mi orci, rutrum sed dapibus sed, elementum nec lacus.
Phasellus id tellus mi, at rutrum justo. Nullam eget turpis justo, ullamcorper
pretium mauris.
\end{document}


This, in my opinion, is the best way to declare variables or symbols used in an equation. However, if need be, it is possible "to include a line under the equation saying what the variables mean." I'm not sure whether this is the "best way" though:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac velit dolor.
Nulla nunc dolor, commodo sed consectetur ac, dapibus malesuada odio.
Mauris porta libero eget nisi placerat quis bibendum tellus fermentum. It is therefore
possible to define the relationship
\begin{gather*}
x = R + E, \\
\text{where~$R$ is Racoon,~$E$ is Elephant}
\end{gather*}
Sed suscipit tristique laoreet.
Nulla mi orci, rutrum sed dapibus sed, elementum nec lacus.
Phasellus id tellus mi, at rutrum justo. Nullam eget turpis justo, ullamcorper
pretium mauris.  It is therefore
possible to define the relationship
\begin{align*}
x &= R + E, \\
\text{where}~R &= \text{Racoon,} \\
E &= \text{Elephant}
\end{align*}
\end{document}


amsmath provides the mathematical alignment environments (align* and gather).

-
Thanks, exactly what I was looking for. Kudos to you for providing multiple examples. –  user963396 Nov 29 '11 at 8:21

Although I think Werner's answer is the best guideline in general terms, sometimes I need to define variables of an equation in cases that are not publishing papers (i.e. making a presentation with slides or writing a course handbook). In those cases I tend to use the description environment, customizing its label so that it acts as inline math.

In the article class you could redefine the description label using:

\renewcommand*\descriptionlabel[1]{\hspace\leftmargin$#1$}


and then use the description environment to define the variables, such as in the following example:

\documentclass{article}
\renewcommand*\descriptionlabel[1]{\hspace\leftmargin$#1$}
\begin{document}
It is very unusual to characterize some unknown variable $x$ in terms of animal species,
such as the following:
$x = R + E$
where:
\begin{description}
\item[R] is Racoon
\item[E] is Elephant
\end{description}
\end{document}


which yields the following output:

I don't know if its the 'correct' way, but it's very easy to implement, suits my needs and doesn't use the usual itemize environment, which I prefer to leave out for regular text.

-

I´m new in latex but i think you can do it simpler using itemize:

$x = R + E$
where:
\begin{itemize}
\item[R=] is Racoon
\item[E=] is Elephant
\end{itemize}


I doesn´t know if itemize is suposed to be used like this, but it works very well for this purpose, particulary if you have a long list of variables

-