I was just wandering if there is a package (or an option to a package, like \usepackage[showframe]{geometry}
) that could emphasize/draw borders(/lines/frame) around each (and every) word; and/or each line.
I'd prefer if this could work with lipsum
(noting that something like \uline{\lipsum[1-10]}
[via ulem
package] crashes LaTeX). As the title says, I'd primarily need this for debugging purposes (e.g., say, seeing why and where rows do not align in a two-column document).
EDIT: found something similar in macros – Iterate over space-separated list – TeX – LaTeX – Stack Exchange;
\documentclass{article}
\makeatletter
\def\mboxed#1{%
\@mboxed#1 \@empty
}
\def\@mboxed#1 #2{%
\fbox{#1}\space % fbox here to have a visual test
\ifx #2\@empty\else
\expandafter\@mboxed
\fi
#2%
}
\makeatother
\begin{document}
\def\ptest{Hello there, some words here.}
\mboxed{This should be tested \ptest}
\end{document}
… however, you will notice that only the 'verbatim' words in the \mboxed{}
argument are boxed individually; while the contents of the command \ptest
are boxed as a whole (and I want them too as individual words; think as using \lipsum
instead); furthermore, there is no guarantee that this \mboxed
macro doesn't disturb the typesetting (that would occur, if \mboxed
wasn't present at all).
Best Answer
Here's a slightly modified version taken from Censor text spanning multiple lines using LaTeX:
You'll notice the different typesetting of each paragraph. Using
\fbox
removes hyphenation. Also, using\expandafter\boxloopword
allows for the expansion of a macro within the\boxwords
argument (like your\ptest
example).Perhaps the other solution using the
soul
package (also at the same link) would be helpful.