2

I,m quite new at LaTeX and I've been having problems with the split equation environment with error messages on every line in my environment. I'm trying to isolate the problem and I've reduced to simply testing out the split environment by copying a template, and I still get the same errors. Here's an example:

\documentclass[12pt]{article}

\usepackage{amsmath}

\begin{document}

    \begin{equation*}

        \begin{split}

        a & = 1 \\
          & = 2

        \end{split}

    \end{equation*}

\end{document}

In this very simple case, it doesn't even align, and I get 13 error messages. All error messages are of the type runaway argument, missing $, missing {, misplaced alignment tab &, display math should end with $$, etc. What's going on? I'm literally following a template. Is there any particular formatting I'm supposed to do for this environment?

  • 3
    Welcome! You cannot have empty lines in an equation environment. –  Apr 05 '19 at 03:14
  • Wait, the spaces? From pressing enter? It's just that? – Paul Cusson Apr 05 '19 at 03:16
  • Well then, that solved everything, thanks! Is this something true in other environments as well? What about spaces from just the space bar/tab, any worries with that? – Paul Cusson Apr 05 '19 at 03:17
  • 2
    An empty line is a start of a new paragraph, which is not allowed in math environments. In other environments they may or may not be harmless, in some they are harmless. –  Apr 05 '19 at 03:18
  • 1
    If you want to leave some empty lines into a math environment, place % as the first char in these lines. They are not empty anymore, but you keep the visual blank space. – Ignasi Apr 05 '19 at 07:25
  • \begin{tabular}{cc}
        a & = 1 \\
          & = 2
    

    \end{tabular} . Replace all statements between begin{document} and end{document} with above statements. You do not need begin{equation} as you are not writing serious equations. All maths statements can be put between two $$ signs.

    – Vaman Kulkarni Jun 01 '20 at 13:03

0 Answers0