1

Consider the following MWE:

\documentclass{minimal}

\usepackage{amsmath}
\usepackage{graphics}

\newcommand*{\scaleandcenter}[2]{{\vcenter{\hbox{\scalebox{#1}{$#2$}}}}}
\newcommand*{\scalebig}[1]{\scaleandcenter{1.5}{#1}}

\newcommand*{\imp}{\mathop{\Rightarrow}}
\newcommand*{\Imp}{\mathbin{\scalebig{\imp}}}
\newcommand*{\blankrel}[1]{\mathrel{\phantom{#1}}}
\newcommand*{\Blank}{\blankrel{\Imp}}
\newcommand*{\Eq}{\mathrel{\scalebig{=}}}
\newcommand*{\apf}{\mathrel{\triangleleft}}
\newcommand*{\sgn}{\texttt{sgn}}

\begin{document}
    We can expect $n!$ injective functions from $[n]$ to $[n]$. Therefore, we will have 6 terms in the summation above, corresponding to each of the 6 permutations in $S_n$:
    \begin{align*}
        &\Blank \pi_1 = e, \sgn(\pi_2) = 1\\
        &\Imp \sgn(\pi_1) \prod_{j=1}^3 v_{\pi_1 \apf j, j} \\
        &\Eq \prod_{j=1}^3 v_{\pi_1 \apf j, j} \\
        &\Eq v_{1,1}v_{2,2}v_{3,3}
    \end{align*}

    \begin{align*}
        &\Blank \pi_2 = \left(\begin{matrix}1 & 2\end{matrix}\right), \sgn(\pi_2) = -1\\
        &\Imp \sgn(\pi_2) \prod_{j=1}^3 v_{\pi_2 \apf j, j} \\
        &\Eq -\prod_{j=1}^3 v_{\pi_2 \apf j, j} \\
        &\Eq -v_{2,1}v_{1,2}v_{3,3}
    \end{align*}
\end{document}

It produces the following output:

enter image description here

However, notice that the first block doesn't line up with the second (\pi_1 doesn't line up with \pi_2); why is this? If you add more align blocks after the second one, they'll line up, it's just the first that is slightly "indented"?

bzm3r
  • 3,196
  • is there some obstacle to have both in one align environment? otherwise, you can't align equations. but from your example i can conclude, that you actually like to have all equation (in document) left aligned. is this a case? – Zarko Feb 07 '18 at 07:53
  • @Zarko Yes I cannot put them all in one align block, because I have 6 such blocks, and they get cut off at the bottom of the page, rather than page breaking appropriately? – bzm3r Feb 07 '18 at 07:54
  • 3
    Add \allowdisplaybreaks to the preamble, and aligns can be broken across pages. – Torbjørn T. Feb 07 '18 at 07:57
  • and use \intertext{...} if you like to insert some text between your equation blocks. – Zarko Feb 07 '18 at 08:02
  • 1
    I don't really see why you would expect the horizontal position on the page to be the same in both blocks though, in general it doesn't make sense to do it like that. On the other hand, see https://tex.stackexchange.com/questions/107033 https://tex.stackexchange.com/questions/122069 https://tex.stackexchange.com/questions/343911 – Torbjørn T. Feb 07 '18 at 08:02

0 Answers0