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?

2
  • 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
    Commented Apr 11, 2012 at 10:40
  • I hope that helps. This edit has the same problem.
    – Lex
    Commented Apr 11, 2012 at 10:49

1 Answer 1

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

2
  • 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
    Commented Apr 11, 2012 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
    Commented Apr 11, 2012 at 22:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .