5

I found this nice page with notes on LaTeX: https://unix4lyfe.org/tex-notes/#entry26

It gives this sample code:

\def\vhb#1{\vbox{\hbox{#1}}}

A vbox:
\vbox{\vhb{eight}\vhb{gnat}}
and a vtop:
\vtop{\vhb{eight}\vhb{gnat}}
on one line.

And also provides the output of this code "with visible boxes and baselines": enter image description here

How can I achieve the exact output? I found no way to make baselines and boxes visible.

EDIT: I am using pdflatex which I'd like to keep.

1 Answer 1

4

ConTeXt has the built-in command \showboxes which does what you want.

\showboxes
\starttext

\def\vhb#1{\vbox{\hbox{#1}}}

A vbox:
\vbox{\vhb{eight}\vhb{gnat}}
and a vtop:
\vtop{\vhb{eight}\vhb{gnat}}
on one line.

\stoptext

enter image description here

A similar thing is available with LuaLaTeX in the lua-visual-debug package.

\documentclass{article}

\usepackage{lua-visual-debug}

\begin{document}

\def\vhb#1{\vbox{\hbox{#1}}}

A vbox:
\vbox{\vhb{eight}\vhb{gnat}}
and a vtop:
\vtop{\vhb{eight}\vhb{gnat}}
on one line.

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .