[tex-live] verbatim

Harald Hanche-Olsen hanche at math.ntnu.no
Sun Dec 23 21:48:13 CET 2007

+ yuri.nefedov at gmail.com:

> \usepackage[english,russian]{babel}             % (***)
> \usepackage{verbatim}                           % (***)
> \renewcommand*{\verbatim at font}{\ttfamily\small} % (***)

If you look carefully at the documentation for verbatim.pdf, you will
see that not only does \verbatim at font set the font, it also disables
that font's hyphen character, and it turns off ligatures.

> \begin{verbatim}
>          while (--nlines >= 0)
> \end{verbatim}
> \end{document}
>   -------------------------------------
>   The graphical output is
>          while (-nlines >= 0)
>   (one minus!)

Which is the result of the -- ligature in the latt font that is
triggered by the russian language.

The simplest solution in your case is to just do

\addto\verbatim at font{\small}

rather than redefining all of \verbatim at font yourself.  But if you do,
copy the entire code from verbatim.sty and change the pertinent bit.

- Harald

More information about the tex-live mailing list