0

I'm learning LaTeX and writing code on overleaf.

This code with a skipped line does not work, it only outputs the second sentence without any formatting ...

\begin{align}
    This is my first sentence.\\
This is my second sentence.    

\end{align}

enter image description here

But this code with a comment placed on the skipped line works and returns the string with math formatting ... why?

\begin{align}
    This is my first sentence. \\
    %
    This is my second sentence.
\end{align}

enter image description here

  • 3
    Empty lines are not allowed inside of the align environment and other math environments. – leandriis Jul 22 '20 at 14:21
  • 1
    Apart from that, I hope "This is my ... sentence" is just a placeholder for a math equation. Please don't use align for text, but just for math. – leandriis Jul 22 '20 at 14:24
  • @leandriis RE comment1: Oh okay. Thanks for that. I couldn't find that statement anywhere. || RE comment 2: it works the same way with math. if i have a skipped line. it only shows the second line – PestoPotato Jul 22 '20 at 14:28
  • 1
    Additionally, leaving a blank line in align gives an error. Don't just ignore compilation errors. We have asked overleaf to make compilation errors much much more obvious for the user other than a red button. – daleif Jul 22 '20 at 15:45

0 Answers0