[NTG-context] Typing in natural width box

Henri Menke henrimenke at gmail.com
Tue Nov 8 15:10:24 CET 2016


Dear list,

To answer this question on TeX.SX https://tex.stackexchange.com/questions/338135/ I was trying to put a typing environment into a natural width box.  It first seemed that framedtext is doing what I was after but it turned out that only the frame is adjusted to natural width, the underlying box is still full width.  Therefore I tried framed but there I obtain spurious vertical space out of nowhere.  How can I place typing into a natural sized box?

Cheers, Henri

---

\starttext

\ruledhbox{%
  \startframedtext[width=fit,offset=0pt]
    \starttyping
      print("Hello World!")
    \stoptyping
  \stopframedtext
}

\ruledhbox{%
  \startframed[width=fit,align=right,offset=0pt]
    \starttyping
      print("Hello World!")
    \stoptyping
  \stopframed
}

\stoptext


More information about the ntg-context mailing list