0

I have several separate align environments that all belong to a bigger optimization problem. The equations are aligned to the left and the iterators to the right which works fine with & operators in the align environment. However, when using two or more align environments, I noticed that they do not really right align but only separate the left and right parts with a seemingly arbitrary horizontal space between them.

I am aware of how the align environment uses alternating left and right aligned columns, I just don't understand why the alignment is not to the far right/left of the line. An MWE is below:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath}
    \usepackage{geometry}
    \geometry{
      left=3cm,
      right=3cm,
      top=2cm,
      bottom=4cm
    }
\begin{document}

\section{Introduction}

Some introduction that is meant to show where the left and right margins of the document are. All equations are part of a bigger optimization problem.

\begin{align}
    & \eta_{m, ht}^b \cdot x_{m}^b(t) + MaxP_m^b \cdot y_m^b(t) \leq MaxP_m^b & \forall m \in M_{CO}^b, t \in T, b \in B \\
    & -\eta_{m, ht}^b \cdot x_{m}^b(t) - MinP_m^b \cdot y_m^b(t) \leq - MinP_m^b & \forall m \in M_{CO}^b, t \in T, b \in B
\end{align}

Some text in the middle that describes the equations below.

\begin{align}
    & x_{fm, m}^b(t) \leq M_m^b & \forall m \in M_{BA}^b \cup M_{TS}^b, b \in B \\
    & x_{to, m}^b(t) \leq M_m^b & \forall m \in M_{CO}^b
\end{align}

\end{document}

How do I force the align environment to really align right and left and not just slightly right and left? Neither the equations nor the indices are at the furthest end where they could be.

One can see the different right alignment of the two align environments

  • If I understand the question you want to use flalign instead of align. – campa Dec 23 '20 at 09:49
  • note that align is mostly designed for setting equations and here you have two columns of equations so a&=b & c&=d but you are leaving the a and d columns empty, so it almost gives the appearance of left aligned equations in the b column, with no alignment on the <= operator and right alignment from the c column towards the middle of the second column of equations, which have no right hand side (d column) – David Carlisle Dec 23 '20 at 10:26
  • Yes, flalign did the trick! Thanks a lot @campa ! – user14386815 Dec 23 '20 at 12:57
  • Alrnatively, one might include all four lines in the same align, using intertext for the intervening text. – barbara beeton Nov 24 '23 at 21:16

0 Answers0