A question mark ? and an exclamation mark ! are honest characters: you just type them and they appear. But the conventions around them differ by language. English gives them the same wider end-of-sentence space as a period; French puts a thin space before them; Spanish opens with an upside-down ¿ or ¡; and Japanese uses full-width ? and !. This page sorts out, language by language, how to type them and what spacing LaTeX handles for you.
Western ? and !
In English and other Western text, you type ? and ! straight from the keyboard. No escaping is needed, and there is no special command. The English convention is to set them tight against the preceding word — no space before — with an ordinary space after.
Internally TeX assigns every character a space factor. The period ., the question mark ?, and the exclamation mark ! all carry a space factor of 3000, which marks the following space as an end-of-sentence space. Under the default (\nonfrenchspacing), that inter-sentence space is set a little wider than an inter-word space and is allowed to stretch and shrink about three times as much. So ending a sentence with ? or ! automatically gets the same slightly wider gap as a period.
One pitfall: TeX assumes that punctuation right after a capital letter does not end a sentence (it is guarding against abbreviations like Ph.D.). In the rare case where you end a sentence right after a capital — Who is FBI? — put \@ before the ? to say “this really is the end.” Conversely, to drop the wider end-of-sentence space entirely and make it equal to an inter-word space, declare \frenchspacing in the preamble. The “Automatically inserted spaces” page goes deeper.
Really? Yes! It works.
% After a capital, mark the true sentence end:
He joined the FBI\@. Then he left.French is different. Its orthography puts a thin space before ! ? : ;, as in Vraiment ?. You do not insert this by hand: loading babel with the [french] option (babel-french) automatically places the correct (non-breaking) space before these marks.
Spanish inverted marks ¿ ¡
Spanish opens a question or exclamation with an inverted mark at the start of the clause: a question is ¿…? and an exclamation is ¡…!, bracketed by an opening and a closing mark. The closing ? and ! are typed normally; the question is how to enter the opening ¿ and ¡.
The traditional method is ligature input. In the standard text font encodings, an exclamation mark followed by a backtick turns into ¡, and a question mark followed by a backtick turns into ¿. That is: the opening exclamation is ! then ` `, and the opening question is ? then ``. The backtick does not appear in the output — you get a single inverted mark.
The other way is the explicit commands. ¡ is \textexclamdown and ¿ is \textquestiondown. Many people prefer these: the intent is obvious at a glance, and they work even where ligatures are disabled. Loading babel with [spanish] additionally sets up Spanish hyphenation and captions and adjusts the handling around ? and ! to suit the language.
% Ligature input (mark + backtick):
?`Como estas?
!`Hola!
% Explicit commands (identical output):
\textquestiondown Como estas?
\textexclamdown Hola!A caveat: under pdfLaTeX these ligatures work as a font-encoding feature, but under the Unicode-native XeLaTeX / LuaLaTeX it is safest not to rely on them — type the inverted ¿ ¡ directly in the source (or use \textquestiondown / \textexclamdown).
Japanese ? and !
In Japanese text you use the full-width ? and !, not the half-width ? !. You write them directly in the source and a Japanese-capable engine (upLaTeX, or LuaLaTeX with luatexja) sets them as-is. No escaping is required.
Japanese typesetting conventionally puts a full-width space (zenkaku aki) after a mid-text ? or !. The W3C “Requirements for Japanese Text Layout (JLREQ)” specifies that a sentence-ending question or exclamation mark is full-width and is followed by a full-width space — except that it is set solid (no gap) when a closing bracket follows. The key point: you generally should not type that full-width space yourself; the engine inserts it automatically as punctuation spacing. Adding a manual full-width space on top would double the gap.
Note too that ending a sentence with ? or ! is not used in Japanese the way the period 。 marks a formal sentence end. They are common in dialogue and lighter registers, while 。 carries the sentence end in formal writing. When a ? or ! falls at the end of a line and its trailing full-width space would be left over, that line-end space is best suppressed (most classes and packages handle this).
Input lookup
Input → output → notes. The backtick in the ligature rows is part of the input that produces the opening mark; it does not appear in the output.
| Input | Output | Notes | |
|---|---|---|---|
? | ? | ? | Western question mark; wider end-of-sentence space (SF 3000) |
! | ! | ! | Western exclamation mark; wider end-of-sentence space (SF 3000) |
?-backtick | ? then ` | ¿ | Ligature; opening question mark (Spanish) |
!-backtick | ! then ` | ¡ | Ligature; opening exclamation mark (Spanish) |
textquestiondown | \textquestiondown | ¿ | Explicit command; works even without ligatures |
textexclamdown | \textexclamdown | ¡ | Explicit command; works even without ligatures |
fullwidth-question | ? (full-width) | ? | Japanese; trailing full-width space is automatic |
fullwidth-exclam | ! (full-width) | ! | Japanese; trailing full-width space is automatic |
Worked examples
Here are real examples across languages. Spanish brackets the clause with opening and closing marks; in French, babel-french inserts the thin space before the mark; in Japanese, you just drop in the full-width marks and the trailing space follows.
% --- Spanish ---
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\begin{document}
?`Como estas? !`Que bien!
\textquestiondown Listo\textexclamdown
\end{document}The line that produces the opening ¿ ¡ via ligatures (? ! followed by a backtick) and the line that uses the explicit commands give exactly the same output. Next, a Japanese example; note that no full-width space is typed right after ? or !.
\documentclass{ltjsarticle}
\begin{document}
本当ですか? はい、できました! 次に進みましょう。
\end{document}Compiling this yields a readable Japanese paragraph with a full-width space after “本当ですか?” and another after “できました!”. You added no spaces by hand, yet the spacing comes out right — that is the convenience of Japanese typesetting.