2

I want to align some equations. One equation has some text that I want pushed back to the margin. I tried

    \begin{align*}
    \text{Text:  } \hspace{\stretch{1}} \text{more text} x^2 &=y\\
    m^2 &= 2\\
    \end{align*}

which gives

                      Text: more textx2 = y 
                                     m2 = 2

but what I want is this:

Text:                       more textx2 = y 
                            m2 = 2

The hspace stretch combination works great on lines that aren't within an align block. I don't want to add a specific size (like hspace{10em}) since I may have to edit the line a bit later, and I do need to keep the pushed text ("Text") on the same line. Any ideas?

  • you're welcome :) can you turn your code snippet into a complete MWE- there are a few commands you've used that aren't obvious where they came from – cmhughes Apr 11 '12 at 10:40
  • I hope that helps. This edit has the same problem. – Lex Apr 11 '12 at 10:49
2

We will understand your needs better through a MWE. With amsart your needs will be met like this:

\documentclass{amsart}
%\usepackage{amsmath} % amsart doesn't need this.
\usepackage[showframe]{geometry} % Added to show frames, you may remove this in your file.
% ----------------------------------------------------------------
\begin{document}
% ----------------------------------------------------------------
\begin{flalign*}
\text{Text:} && \text{more text  } x^2 &=y &&  \\
&& m^2 &= 2 &&
\end{flalign*}
% ----------------------------------------------------------------
\end{document}

enter image description here

  • I am using the amsart documentclass. Trying this solution gives me an error saying that falign* is undefined. If I include the [fleqn] option, it gives me errors until I toggle off all the ams packages. Is there a way to define falign*? – Lex Apr 11 '12 at 14:06
  • @Lex: This should still work with an flalign* environment (tested on ScribTeX) if you use \documentclass{amsart} (without [fleqn]) without loading the amsmath package. – Werner Apr 11 '12 at 22:56

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.