\chardef and underscore

Your \chardef defines \_ to be the character in position "5F (ASCII for the underscore character), and that position just happens to contain the mysterious dot. At least it does in cmr10, and apparently it does in the font you're using as well (run (pdf)tex testfont to make font tables for any font you're curious about). The standard definition of \_ in plain TeX just typesets a rule of some suitable width, as there isn't any underscore glyph in the cmr font. I assume something similar is true in LaTeX, though I haven't bother to dig my way past the \textunderscore magic.

I am not too sure about what you can do, though. The whole LaTeX font selection business is a weak point of my TeX foo.


In a fix-width font every symbol should have the same width. So a long underscore is a bit unusual. In any case: in OT1-encoding (which you are obviously using) \_ calls internally \textunderscore, which in turn is define as a rule of width 0.3em and some space. You can redefine \_ to get a longer rule and use \textunderscore at other places:

\documentclass{book}
\DeclareTextCommand{\_}{OT1}{%
  \leavevmode \kern.06em\vbox{\hrule width.6em}}

\begin{document}
a\textunderscore b  {\ttfamily a\_b}
\end{document}

example

Tags:

Fonts

Symbols