I'm writing a document that has a number of equations, and in many cases I need to explain what each side of the equation represents. Is there any way to create brackets below each side of an equation and then to write a brief description below the brackets?
Alternatively, I could use lines connecting each side of the equation with a text box containing the explanation.
Any thoughts/ideas on how I can accomplish this? Thanks in advance.
Graphics, Figures & Tables ⇒ Explanations of terms in equations
NEW: TikZ book now 40% off at Amazon.com for a short time.
Explanations of terms in equations
How about using \underbrace?
If these explanations might get very long, you could use a parbox, I suppose. Here's a method using a defined command for the task:
Tweak as you see fit.
There's an underbracket package if you really want brackets rather than braces. Doesn't appeal as much to me, personally.
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\underbrace{A + B + C + D}_{\text{Some terms}} = \underbrace{D + C + B + A}_{\text{The same, reversed.}}
\]
\end{document}
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\usepackage{calc}
\newcommand{\explain}[2]{\underbrace{#1}_{\parbox{\widthof{#1}}{\footnotesize\raggedright #2}}}
\begin{document}
\[
\explain{A + B + C + D}{Here $A$ is the first letter, and $B$ is the next, and $C$ next, and so on} = \explain{D + C + B + A}{Some other really wordy explanation that goes on for far too long.}
\]
\end{document}
There's an underbracket package if you really want brackets rather than braces. Doesn't appeal as much to me, personally.
Re: Explanations of terms in equations
Thanks so much for your help, and sorry for posting to multiple sub-forums. The second method you suggest, using \parbox, works except when the first argument has "mathematical" terms, such as \delta. I'm trying to sort this out right now. Any ideas why this might be happening and how I could fix it?
Let me know when you have a chance, thanks!
Let me know when you have a chance, thanks!
Explanations of terms in equations
The problem is with my use of \widthof.
Try this instead:
Try this instead:
Code: Select all
\newcommand{\explain}[2]{\underbrace{#1}_{\parbox{\widthof{\ensuremath{#1}}}{\footnotesize\raggedright #2}}}