# More examples about box macros in context

I'm using ConTeXt MKIV and I want to use \tbox, \rbox, etc. in my macros. But I do not find many examples. I just need the basics of howto use them.

• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – LaRiFaRi Aug 16 '16 at 9:19
• @LaRiFaRi: \documentclass in context? – Ulrike Fischer Aug 16 '16 at 10:48
• @UlrikeFischer My bad. Standard text... I never used context. @ viper please provide an MWE with everything which might be needed in order to compile your document. – LaRiFaRi Aug 16 '16 at 12:09

The \lbox, \cbox and \rbox are a normal \vbox with the exception that they set a default alignment for their content.

\starttext

\vbox{\input ward }

\blank

\lbox{\input ward }

\blank

\cbox{\input ward }

\blank

\rbox{\input ward }

\stoptext


The \tbox and \bbox put their content in a \hbox and change afterwards the height and depth values of the box. For the \tbox the new value for the box height is the height of a strut and for a \bbox the new value of the depth is the depth of a strut.

\setupexternalfigure[location=default]

\useexternalfigure[cow][cow][frame=on,height=3\lineheight]

\starttext

\ruledhbox\bgroup
\externalfigure[cow]
\tbox{\externalfigure[cow]}
\bbox{\externalfigure[cow]}%
\egroup

\stoptext


• I would like to add that I see these macros as being useful for low-level commands where speed is an issue. For user-level commands it is better to use \framed and change the alignment with the align key and change the vertical location with the location key. – Aditya Aug 16 '16 at 22:30