103

For instance, how do I add a break after the first line in

\[
    a + b = c // what should I add here?
    a = c - b
\]
111

The \[...\] is used to typeset a single equation, not multiple equations.

You need to use an environment that allows for multiple equations. One way is to use gather, but I normally use align, both from the amsmath package:

enter image description here

Notes:

  • With display math environments if you leave blank lines in between you get additional vertical spacing and the possibility of a page break between a paragraph and following display.
  • If you don't want the equations numbered use the starred versions of the environments: gather* and align*.
  • A really good reference is Herbert Voss's comprehensive review of mathematics in (La)TeX.

Code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather}
    a + b = c \\ 
    a = c - b
\end{gather}
%
With the align environment you can align equations:
%
\begin{align}
    a + b &= c \\        
        a &= c - b
\end{align}
\end{document}
| improve this answer | |
  • 1
    I tried align, it shows everything on the same line. My code: pastebin.com/FwwSmiCp Result: image description – Tomáš Zato - Reinstate Monica Jan 16 '17 at 9:46
  • 3
    @TomášZato: You need a double back slash to indicate a new line, not a single backslash. Next time, for faster response, just post a new question. You won't be the last person to make such a mistake -- even if it gets closed, the comments will still contain a fix, so a question like that might help someone else in the future. I see that there is a typo in my answer, so fixing that now... – Peter Grill Jan 16 '17 at 22:58
  • As of January 9th, your link to Herbert Voss's eview of LaTeX math is dead. – IdleCustard Jan 9 '19 at 16:07
  • with align, I'm getting equation numbers next to each line. I preferred this answer to a similar question: tex.stackexchange.com/a/8942/14277 – craq Jul 29 '19 at 22:55
  • @craq: Glad you were able to locate a solution for your issue. However, this question is about adding a line break between equations, not about splitting a single equation across multiple lines. – Peter Grill Jul 30 '19 at 0:25
3

In case gather is not an option, for example, an imported command where everything is in math mode, consider make them a single-columned matrix without showing the symbol, then you can use \\.
Code:

\[
\begin{array}{c}
a + b = c \\  % just use \\
a = c - b
\end{array}
\]
| improve this answer | |
  • This solution works, but it might be important to keep in mind that in an array environment, the content is (by default) in \textstyle rather than in \displaystyle. Hence, for example, a fraction written with \frac{}{} will be smaller than in an usual display math environment, and the limits of a sum or of an integral will be displayed differently. But one could simply add a \displaystyle command in cells where this behavior should be changed. – Vincent Mar 28 at 21:50

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.