[latexrefman] Suggestion to extend 8.27.1 \verb

Pablo González L pablgonz at educarchile.cl
Sat Dec 19 02:20:20 CET 2020


Only two suggestions for this section that you see have just been
updated :)

1. At the end of the section I would add a link to
(https://www.texfaq.org/FAQ-verbwithin)

2. This is a bit longer and follows the news implemented in LaTeX News,
December 2018 (p41,42) regarding the character of "visible space" in
verbatim.

(copy, paste and adapt the relevant)

As of the LaTeX December 2018 release, the \verb* code uses the command
\verbvisiblespace to produce the visible space character and this
command will get appropriate definitions for use with the different
engines. With pdfTEX it will simply use \asciispace, which is a posh
name for “select character 32 in the current font”, but with Unicode
engines the default definition is:

\DeclareRobustCommand\verbvisiblespace {\leavevmode
 {\usefont{OT1}{cmtt}{m}{n}\asciispace}}

which uses the visible space from the font Computer Modern Typewriter,
regardless of the currently chosen typewriter font. Internally the code
ensures that the character used has exactly the same width as the other
characters in the current (monospaced) font; thus, for example, code
displays line up properly.

It is possible to redefine this command to select your own character,
for example \DeclareRobustCommand\verbvisiblespace {\textvisiblespace}
will select the “official” visible space character of the current
font.

The best
Pablo



More information about the latexrefman mailing list.