0

How to get texmaker to stop inserting $

So as far as I know spaces in your text (both vertical and horizontal space are ignored in the compiler however, texmaker keeps insisting that

$ x+y=2 \\\

2x+y=3 $

have extra $ inserted, but

$ x+y=2 \\\

2x+y=3 $

is fine anyways can I get texmaker to ignore the horizontal spaces and just compile the former as the latter?
Also can someone explain how to stop this editor from editing my entries? (deleting newlines adding spaces turning \\ to )

2
  • Does my edit reflect your intention? If not, please re-edit. (Indenting with four spaces adds code markup, so for example spaces and line breaks are preserved.) That said, why don't you use a multi-line math environment like gather? (needs \usepackage{amsmath}) Sep 14, 2015 at 16:38
  • As I said, indenting with four spaces adds code markup, so newlines are preserved, and backslashes. For inline code, use backticks, i.e. `. The easiest way of doing this is selecting the code and clicking Ctrl + K, or the button marked {} on the toolbar above the text box. Sep 14, 2015 at 16:42

1 Answer 1

8

You can stop TeXmaker from giving you these messages if you use the correct mark-up. :)

You're not allowed to use a blank line inside in-line math mode. That's why

$ abc 
  def $

is fine (even with \\), as it's similar to

$ abc def $

However, using

$ abc

  def $

inserts a paragraph break which doesn't fit within the scope of in-line math. You'll get the same problem when you use something like

\textbf{abc

def}

If you want to have a line-break between in-line math components, use

$abc$

$def$

or a different mark-up altogether. Perhaps you want to align equations? Well then, use the support from amsmath:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
  x + y &= 2 \\
 2x + y &= 3
\end{align*}

\end{document}
1
  • I would add a note that texmaker couldn't care less about this and that LaTeX is the one complaining.
    – Johannes_B
    Sep 14, 2015 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .