7

I just learned about \detokenize, so this question is likely a naive one.

Nonetheless, based on what I thought that I understood about \detokenize, I would have expected \detokenize{_} to render as _.

However, when I compile the following MWE, \detokenize{_} renders as something that seems to be U+05C4 U+02D9 (see @Qrrbrbirlbel's comment).

\documentclass{article}

\begin{document}

A\detokenize{_}B

\end{document}

enter image description here

However, when I add \usepackage[T1]{fontenc} to the preamble, everything works as expected.

\documentclass{article}

\usepackage[T1]{fontenc}

\begin{document}

A\detokenize{_}B

\end{document}

enter image description here

What's going on here? My .tex file is UTF-8 encoded, and I'm compiling on a Mac (OS X 10.9.1) with TeXShop (v. 3.26) if any of that is relevant here.

Adam Liter
  • 12,567

1 Answers1

5

As Qrrbrbirlbel points out in the comments, there is no _ in OT1 encoding, which is the default font encoding for LaTeX.

Yet, in T1 encoding, _ is at 5F:

enter image description here

Which is where ˙ is at in OT1 encoding:

enter image description here

Thus, without specifying the output font encoding to be T1 by declaring \usepackage[T1]{fontenc} in the preamble, the output will be ˙ instead of _.

apriori
  • 953
Adam Liter
  • 12,567