3

I have an equation and want to have a 'where' block beneath it explaining the variables used. I would like to use something similar to the last example in this answer, but I would like the 'where' block to be aligned (as is, i.e. aligned in itself on the ':') at the left side of the text body -- adapted to the surrounding text.

I would like to do so without leaving the math environment.

Here is my MWE:

\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,\\\notag
  \begin{split}
    \text{where } R &: \text{Racoon,}\\
    E &: \text{Elephant}
  \end{split}\hfill\mbox{}
\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{gather}
  x \gg R + E,\\\notag
  \begin{alignedat}{2}
    &\text{where} &\quad R &: \text{Racoon,}\\
    &     &E &: \text{Elephant}
  \end{alignedat}\hfill\mbox{}
\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
\end{document}

EDIT: Based on the answer from daleif, I extended the MWE.

  • 1
    From your comment to Steven, I'd suggest adding it to the text instead. If would only confuse the reader – daleif Jan 28 '14 at 13:36
  • @daleif Thanks. I am aware of that general advise. – Andreas Jan 28 '14 at 13:53
  • @daleif I agree that adding it to text would seem to be best. However, in this case, with no \parskip and a non-zero \parindent, it doesn't look good that way either. – Steven B. Segletes Jan 28 '14 at 14:05
  • @StevenB.Segletes, parskip? What are you talking about? – daleif Jan 28 '14 at 14:06
  • @daleif By adding the justified "where" clause to the regular text, there is a vertical gap between equation and the where clause, but no vertical gap between the end of the where clause and the next paragraph. Furthermore, the indent associated with the where clause is different than the indent associated with the next paragraph. The net effect is quite discordant to the eye. – Steven B. Segletes Jan 28 '14 at 14:09
3

Here's a possibility, but what you want is not really nice, in my opinion.

\documentclass{article}
\usepackage{amsmath}

\newenvironment{where}[1][where]
 {\vadjust pre{\vskip-\belowdisplayskip}$\!\begin{aligned}\text{#1 }}
 {\end{aligned}$\\*[\belowdisplayskip]}

\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 \gg R + E,
\end{gather}
\begin{where}
R &: \text{Racoon,}\\
E &: \text{Elephant}
\end{where}
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
\end{document}

enter image description here

  • Thanks a lot. I'll accept this -- even if it does leave the math environment (the gather here). – Andreas Jan 28 '14 at 14:23
  • @Andreas Having a different environment is better, because you can use it after gather or align or any other display environment; left aligning from inside one of them is simply not possible. – egreg Jan 28 '14 at 14:25
2

I'd do what you are already doing, but using two alignment points instead

\begin{gather}
  x \gg R + E,\\\notag
  \begin{alignedat}{2}
    &\text{where} &\quad R &: \text{Racoon,}\\
                  &     &E &: \text{Elephant}
  \end{alignedat}
\end{gather}

also note the use of \gg

  • Thanks, but the \hfill does not seem to have any effect for me. I included it in my question. What am I missing? – Andreas Jan 28 '14 at 13:49
  • That \hfill is not even suppose to be there. You will not get it to go to the margin. Leave it as it is – daleif Jan 28 '14 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.