3

My question is, how can I get the two different align* environments to agree on the equal signs being centred for all six equations on the page (even though there is a line of text breaking them into groups of three and three):

see picture below =]

pluton
  • 16,421
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jan 14 '15 at 13:38
  • 2
    amsmath provides intertext for stuff like that. If the line is part of an itemize environment it gets more complicated. – Johannes_B Jan 14 '15 at 13:48
  • @ChristianHupfer Im so sorry! Will do that if I post another question! Never used this site before. It was part of the itemize environment, so it seems the second solution below is applicable. – George Tedder Jan 15 '15 at 18:56

1 Answers1

4

Do you mean like this?

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator{\var}{Var}

\begin{document}
\begin{align*}
    E(M) &= A\\
    E(A) &= 180-B-C\\
    E(N) &= A/2 - B/2 - C/2 + 90
    \intertext{(b) The variances are given by:}
    \var(M) &= 1\\
    \var(A) &= 1/2\\
    \var(N) &= 3/4
\end{align*}
\end{document}

enter image description here


Update:

If the other commentators are right and you are inside an itemize environment, a very easy solution would be to define your own indent. Not super fancy, but clear and easy.

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator{\var}{Var}
\newcommand*{\myIndent}{\hspace{4cm}} % or whatever space you may find on http://tex.stackexchange.com/a/74354

\begin{document}
\begin{itemize}
    \item[(a)] Whatever you have written in item (a):
    \begin{flalign*}
    \myIndent\mathllap{E(M)} &= A&\\
    E(A) &= 180-B-C\\
    E(N) &= A/2 - B/2 - C/2 + 90
    \end{flalign*}
    \item[(b)] The variances are given by:
    \begin{flalign*}
    \myIndent\mathllap{\var(M)} &= 1&\\
    \var(A) &= 1/2\\
    \var(N) &= 3/4
    \end{flalign*}
\end{itemize}
\end{document}

Update 2:

daleif brought me to the idea to use \item directly in \intertext (or \shortintertext, if you prefer the vertical spacing). You will need at least one \item outside the align in order to get that working.

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\DeclareMathOperator{\var}{Var}
\usepackage{enumitem}
\usepackage{blindtext}

\begin{document}
\begin{enumerate}[label=(\alph*)]
    \item \blindtext
    \begin{align*}
        E(M) &= A\\
        E(A) &= 180-B-C\\
        E(N) &= A/2 - B/2 - C/2 + 90
        \intertext{\item The variances are given by:}
        \var(M) &= 1\\
        \var(A) &= 1/2\\
        \var(N) &= 3/4
    \end{align*}
\end{enumerate}
\end{document}

enter image description here

LaRiFaRi
  • 43,807