# [NTG-context] What's the difference between \dontleavehmode and \leavevmode?

Hans Hagen pragma at wxs.nl
Thu Aug 18 18:39:57 CEST 2016

```On 8/18/2016 5:23 PM, Henri Menke wrote:
> Dear list,
>
> could someone please explain what is the difference between \dontleavehmode and \leavevmode?
>
> Internally, I also stumbled upon \quitvmode.  Is this a synonym for \leavevmode?  It seems to be primitive.

\leavevmode is kind of useless as it can interfere in spacing so we
always used \dontleavehmode in context (a macro) that later was added as
primitive \quitvmode to luatex

You sometimes need \dontleavehmode to make sure you enter hmode (esp
when you start a paragraph with a group or boxed stuff)

(the only two places in context where \leavevmode is used is in rather
plain macros that get overloaded later)

Hans

-----------------------------------------------------------------