# Use case for pdfTeX's \quitvmode

While reading one of Lev's answers, I encountered a pdfTeX primitive \quitvmode that I have never noticed before.

The pdfTeX manual states that this causes TeX to leave (internal) vertical mode and enter horizontal mode—the mode in which TeX is building paragraphs. This is the purpose of the plain TeX and LaTeX macro \leavevmode. The manual states that this does so without any bad interaction with \everypar.

The only examples I can think of where this would be useful are horribly contrived. For example,

\everypar{\foo}
\def\foo#1{{\tt\string#1}}
\leavevmode foo

\quitvmode bar
\bye


produces

which is more or less what I'd expect, but this use of \everypar is really silly.

What is an actual use where using \quitvmode instead of \leavevmode matters?

-

## 1 Answer

Discussion here. Take-home message seems to be "it's not really necessary with etex, but etex wasn't universally available when this was introduced in July 2004". Seems spurious to me, since if extensions to tex were needed, why should a pdftex extension preferable to an etex one? Anyway, the conclusion was that the primitive was already in use, so it shouldn't be removed lest something breaks.

-
Interesting discussion. I see why \ifvmode\indent\fi needs to be \protected. So I see why it's unnecessary with e-TeX extensions, but what I don't understand is why either a primitive or a \protected macro is needed at all. \leavevmode doesn't have expansion problems. The pdfTeX manual explicitly mentions \everypar, but I'm not really seeing the connection (beyond trivial examples like mine). –  TH. Mar 18 '11 at 3:26
@TH. My take is that it 'seemed like a good idea at the time', but like a few other primitives turns out to be not really that much use. –  Joseph Wright Mar 18 '11 at 6:44
Perhaps the e-TeX extensions weren't yet included in pdfTeX at that time? –  SamB Mar 6 '12 at 0:06