I would like to replace the white space (full space entered by pressing "space" any number of times on the keyboard or by hitting enter) by something else. Let's say, a rule of the same width.
Is there some command I could redefine? The easiest way in order to keep the stretching of the white spaces would be to highlight them.
I already know that I can get something like this with the package lua-visual-debug and debugging is the purpose for that redefinition, but I would like to do that in pdfLaTeX.
If we can find a simple answer to this, we might get some reference for debugging "spurious white-space errors".
Of course, I am giving an MWE for this. The first line should result in the second line after inserting the redefinition (hopefully not with hard-coded width of the rules.)
% arara: pdflatex
\documentclass{article}
\usepackage{xcolor}
\definecolor{spacecolor}{named}{red}
\newcommand*{\test}{%
Test}
\newcommand{\yatest}{
Test
}
\newcommand*{\here}{\textcolor{spacecolor}{\rule{.335em}{1.5ex}}}
\usepackage{lua-visual-debug}
\begin{document}
Test Test Test \test\yatest\test
Test\here{}Test\here{}Test\here{}Test\here{}Test\here{}Test
\end{document}




