2

Why is there a space after the <= sign here: P(Z{\leq}z) What am I doing wrong?

2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Oct 2, 2022 at 10:34
  • 1
    Looks correct to me. We're going to need more information about your document. Oct 2, 2022 at 10:45

1 Answer 1

5

If you have

\documentclass{article}

\begin{document}

P(Z{\leq}z)

\end{document}

You get an error

! Missing $ inserted.
<inserted text> 
                $
l.5 P(Z{\leq
            }z)
? 
! Extra }, or forgotten $.
l.5 P(Z{\leq}
             z)
? 

enter image description here

Never ignore errors, TeX will recover enough to check more of the document, but not make sensible output.

\documentclass{article}

\begin{document}

$P(Z{\leq}z)$

\end{document}

is error free and makes

7
  • 1
    Maybe it's time to make -halt-on-error the default with no way to disable it, given that most editors and things like Overleaf display the PDF even though there were errors. Oct 2, 2022 at 12:12
  • 1
    @HenriMenke since last week overleaf has an option to stop on first error and show the log, so gradually things get better. latex's default of course has always been to halt. Oct 2, 2022 at 12:20
  • 1
    Also, \leq probably shouldn’t be braced if we want the correct spacing.
    – Gaussler
    Oct 2, 2022 at 12:34
  • @Gaussler possibly, but then the question title would have been "missing space before" not "unwanted space after" Oct 2, 2022 at 14:05
  • @Gaussler -- I don't understand what the expression means, but it seems that the parentheses indicate that what's inside is a condition, and not an ordinary relation where the spacing would be wider. I would consider this equivalent to the appearance of this expression in a sub/superscript, where the spacing is compressed. Oct 2, 2022 at 14:36

You must log in to answer this question.

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