# Why the question mark followed by a left quote produce another symbol?

See the following example:

\documentclass{article}

\begin{document}
Hello?world!''
\end{document}

The ? will be replaced by a bottom-up question mark, If add a space between them will avoid this but I want to know the reason.

The cmr10 font (and others) contain a ligature for this. If you run tftopl cmr10.tfm, you will see this in the output:

(CHARACTER O 77
(CHARWD R 0.472224)
(CHARHT R 0.694445)
(COMMENT
(LIG O 140 O 76)
)
)

Octal 77 is the question mark, octal 140 is the backtick, and octal 76 is the upside down question mark in the font (which code, incidentally, coincides with the code for > in ASCII – and so typing the latter also produces ¿).

To avoid the ligature, if you don't want a space, type \relax or {} between the two characters.

The pair of characters ? produces ¿, and the pair of characters ! produces ¡. Since the input is parsed left to right, the ? is found first, yielding the ¿. For a full list of the Latin1 code table in LaTeX see Table 329 of the LaTeX Symbols Guide.

• It has nothing to do with the input encoding and everything to do with the kerning table of the font. – Harald Hanche-Olsen May 6 '11 at 6:32