Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Thankyou for making that easier to look at, cmhughes. –  Lex Apr 11 '12 at 10:39
    
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
add comment

1 Answer

up vote 2 down vote accepted

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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