[NTG-context] Re: line break after hbox or framed
On 4/8/2026 12:01 PM, Max Chernoff via ntg-context wrote:
Hi Emanuel,
On Wed, 2026-04-08 at 18:45 +0900, Emanuel Han wrote:
What is a „horizontal mode“?
\starttext
\ruledvbox \bgroup \showmakeup
test
\egroup
\ruledvbox \bgroup \showmakeup
\dontleavehmode test
\egroup
\ruledvbox \bgroup \showmakeup
\hbox{!}
\egroup
\ruledvbox \bgroup \showmakeup
\dontleavehmode \hbox{!}
\egroup
\stoptext
The third alternative is explicltly there (in the tex engine) in order
to be able to pack boxes without them being seen as paragraphs.
I didn’t find any information about [...] \dontleavehmode in the Wiki.
\dontleavehmode is ConTeXt's equivalent to \leavevmode:
https://tex.stackexchange.com/q/22852/270600
fwiw, at that time we introduced that in order to prevent unwanted
interferences
Hans
-
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
[NTG-context] Re: line break after hbox or framed
Hi Emanuel, On Wed, 2026-04-08 at 18:45 +0900, Emanuel Han wrote: > What is a „horizontal mode“? The best documentation for this is The TeXbook, but these have decent explanations too: https://tex.stackexchange.com/q/13177/270600 https://texdoc.org/serve/texbytopic/0#section.6.1 > I didn’t find any information about [...] \dontleavehmode in the Wiki. \dontleavehmode is ConTeXt's equivalent to \leavevmode: https://tex.stackexchange.com/q/22852/270600 It actually uses \quitvmode internally; the pdfTeX documentation explains the difference: https://texdoc.org/serve/pdftex/0#subsection.4.22.4 The LuaMetaTeX manual also has a rather terse explanation: https://www.pragma-ade.nl/general/manuals/luametatex.pdf#%5B%7B%22num%22%3A260%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22Fit%22%7D%5D Thanks, -- Max ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: line break after hbox or framed
Am 08.04.26 um 11:45 schrieb Emanuel Han: What is a „horizontal mode“? I didn’t find any information about neither „horizontal mode“ nor \dontleavehmode in the Wiki. This is a basic TeX thing: the TeX engine is either in a horizontal or vertical mode (or math mode), there are two of each. Maybe it’s explained in one of the lowlevel manuals, otherwise the TeXbook or “TeX by topic”… Maybe I should translate the section from my book for the wiki. Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___
[NTG-context] Re: line break after hbox or framed
Thank you Wolfgang, your solution works.
What is a „horizontal mode“? I didn’t find any information about
neither „horizontal mode“ nor \dontleavehmode in the Wiki.
Best regards
On 7 Apr 2026, at 12:08, Wolfgang Schuster wrote:
Am 07.04.2026 um 04:15 schrieb Emanuel Han:
I observed that there is a line break after hbox or framed, if these
elements are at the beginning of a paragraph (which is not the case
when they are not at the beginning of the paragraph). How can I
circumvent this, so that there is no line break?
\definehbox[fiveem][5em]
\starttext
\hboxfiveem{A} text \hboxfiveem{A} \hboxfiveem{A}.
\framed{B} text \framed{B} \framed{B}.
\stoptext
You need \dontleavehmode before the first box to switch to horizontal
mode.
\definehbox[fiveem][5em]
\starttext
\dontleavehmode\hboxfiveem{A} text \hboxfiveem{A} \hboxfiveem{A}.
\dontleavehmode\framed{B} text \framed{B} \framed{B}.
%\dontleavehmode\horizontalbox[width=5em]{A} text
\horizontalbox[width=5em]{A} \horizontalbox[width=5em]{A}
\stoptext
Wolfgang
___
If your question is of interest to others as well, please add an entry
to the Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net
(mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
[NTG-context] Re: line break after hbox or framed
Am 07.04.2026 um 04:15 schrieb Emanuel Han:
I observed that there is a line break after hbox or framed, if these
elements are at the beginning of a paragraph (which is not the case when
they are not at the beginning of the paragraph). How can I circumvent
this, so that there is no line break?
\definehbox[fiveem][5em]
\starttext
\hboxfiveem{A} text \hboxfiveem{A} \hboxfiveem{A}.
\framed{B} text \framed{B} \framed{B}.
\stoptext
You need \dontleavehmode before the first box to switch to horizontal mode.
\definehbox[fiveem][5em]
\starttext
\dontleavehmode\hboxfiveem{A} text \hboxfiveem{A} \hboxfiveem{A}.
\dontleavehmode\framed{B} text \framed{B} \framed{B}.
%\dontleavehmode\horizontalbox[width=5em]{A} text
\horizontalbox[width=5em]{A} \horizontalbox[width=5em]{A}
\stoptext
Wolfgang
___
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___
