21

Is there a way to insert a blank line between two equations in align environment?

From what I understand a blank line is interpreted as \par and \par is not allowed in align. Can I disable this "feature" in align environment?

Reason:

I like my code to be in 80 column format. So when I hit M-q (fill-paragraph) without blank lines, the code looks like this:

\begin{align}
  \min \sum_{k \in K} \sum_{(i,j) \in A} c_{ij} x_{ij}^k + \sum_{(i,j)
    \in A} f_{ij} y_{ij} \\ \sum_{j \in V_i^+} x_{ij}^k - \sum_{j \in
    V_i^-} x_{ji}^k = \begin{cases} d^k & \text{si } i = O(k) \\ -d^k
    & \text{si } i = D(k) \\ 0 & \text{sinon} \end{cases} & \quad
  \quad \forall i \in V, \; \forall k \in K \\ \sum_{k \in K} x_{ij}^k
  \le u_{ij} y_{ij} & \quad \quad \forall (i,j) \in A
\end{align}

instead of this:

\begin{align}
  \min \sum_{k \in K} \sum_{(i,j) \in A} c_{ij} x_{ij}^k + \sum_{(i,j)
    \in A} f_{ij} y_{ij} \\

  \sum_{j \in V_i^+} x_{ij}^k - \sum_{j \in V_i^-} x_{ji}^k
  = \begin{cases} d^k & \text{si } i = O(k) \\ -d^k & \text{si } i =
    D(k) \\ 0 & \text{sinon} \end{cases} & \quad \quad \forall i \in
  V, \; \forall k \in K \\

  \sum_{k \in K} x_{ij}^k \le u_{ij} y_{ij} & \quad \quad \forall
  (i,j) \in A
\end{align}

which is easier (for me) to read and edit.

0
25

put a % in those lines and everything will be fine for amsmath and for you

7
  • 3
    Or put the "\\" that you already have on the lines that you want to be empty. – Bruno Le Floch Feb 5 '11 at 20:50
  • 1
    which then also will be numbered ... – user2478 Feb 5 '11 at 20:56
  • 1
    @Herbert: Maybe you misunderstood Bruno? He means moving the existing "\\", not adding new ones. – Hendrik Vogt Feb 6 '11 at 7:41
  • @Bruno: Does this solve the "M-q-problem"? – Hendrik Vogt Feb 6 '11 at 7:43
  • 1
    @Hendrik: It depends on the editor. If it is emacs, then my solution does not work (I forgot to test), whereas Herbert's works. – Bruno Le Floch Feb 6 '11 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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