# Upquote: Error in symbols-a4.pdf?

• To replace ‘ and ’ with the more computer-like (and more visibly distinct)  and ' within a verbatim environment, use the upquote package. Outside of verbatim, you can use \char18 and \char13 to get the modified quote characters. (The former is actually a grave accent.)

However, pdflatex/xelatex on

\documentclass{article}
\begin{document}
\Huge \char13
\end{document}


produces

What's happening?

-
Looking at the symbols-a4 source, I found it used \texttt{\char13}, which works. But e.g. \textbf{\texttt{\char13}} produces nothing. –  Mohan Nov 20 '12 at 11:29

\usepackage[T1]{fontenc}


or some other encoding where the character is in slot 13.

But better is never to do this, using \char in that way undercuts the entire LaTeX font encoding mechanism as you have seen. All user level LaTeX commands are designed to be aware of the current font encoding and use an appropriate definition, but if you use the TeX primitive \char you just get whatever is in that position on the current font which is of course highly dependent on the font encoding.

As you noted in the comments the OT1 encoding used for the classic TeX fonts is not really a uniform encoding at all, different fonts (even the same style font at different sizes) are encoded differently. The tt font uses a font encoding that is slightly closer to ASCII than cmr so the verbatim listings work in plain TeX.

-
Thank you for the explanation. What is the 'right' way to get a (pref. bold) ' outside a verb? –  Mohan Nov 20 '12 at 11:32
\textquotesingle in the standard textcomp package should give you a straight quote. –  David Carlisle Nov 20 '12 at 11:40
Unfortunately not -- my collaborator inserted fontspec for some Unicode-ish reason, and it's messing up \textquotesingle`. Edit: importing fontenc/textcomp after fontspec fixes it. Thanks! –  Mohan Nov 20 '12 at 11:44
If you are using xetex and unicode fonts I assume you could just enter U+2032 (′) directly as that's the unicode slot for a straight quote (PRIME) –  David Carlisle Nov 20 '12 at 11:58