Text Formattingblank line error, Missing $ inserted.<inserted text>$

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Colin93
Posts: 57
Joined: Mon Apr 04, 2016 2:55 pm

blank line error, Missing $ inserted.<inserted text>$

Post by Colin93 »

Hi everyone !

I have an issue with a blank line again... So I have an empty line between 2 paragraphs on my Latex script and I have this error message :

Code: Select all

! Missing $ inserted.<inserted text>$
Could you help me ?
Last edited by Stefan Kottwitz on Thu Sep 15, 2016 1:34 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

blank line error, Missing $ inserted.<inserted text>$

Post by Johannes_B »

LaTeX cannot have a paragraph break inside math mode. Somewhere in our first paragraph, LaTeX switched to math mode (likely an underscore) and at the very end, the error is reported. Carefully comment out pieces of that paragraph using % to find the cause.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Colin93
Posts: 57
Joined: Mon Apr 04, 2016 2:55 pm

Re: blank_line_issue_again

Post by Colin93 »

I see... I tries putting \ on that blank line and I don't have that error message anymore. Thankyou again !
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: blank_line_issue_again

Post by Stefan Kottwitz »

Hi Colin,

with a \ the line produces a space. I guess it doesn't matter for you. Just to mention it... a % would have commented it out so with a % at the beginning the line would do nothing.

Stefan
LaTeX.org admin
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

blank line error, Missing $ inserted.<inserted text>$

Post by cgnieder »

Here is a Infominimal working example which reproduces your error:

Code: Select all

\documentclass{article}

\begin{document}

\[
  x

  y
\]

\end{document}
Using a \ very likely is the wrong choice here. If you really want that blank line then you should comment said line – see the difference:

Code: Select all

\documentclass{article}

\begin{document}

\[
  x
%
  y
\]

\[
  x
\
  y
\]

\end{document}
Regards
site moderator & package author
Post Reply