Special LaTeX characters
Juni 15th, 2008 by Stefan Kottwitz
Besides the common upper- and lowercase letters, digits and punctuation characters, that can simply by typed with the editor, some characters are reserved for LaTeX commands. They cannot be used directly in the source. Usually they can be printed if preceded by a backslash:
\documentclass{article} \usepackage{array} \usepackage{booktabs} \begin{document} \begin{tabular}{ll} \toprule \multicolumn{2}{c}{\textbf{Special \LaTeX\ characters}}\\ \midrule Number sign: & \# \\ Dollar sign: & \$ \\ Percent sign: & \% \\ Underscore: & \_ \\ Ampersand: & \& \\ Braces: & \{ \} \\ Circumflex: & \^{} \\ \bottomrule \end{tabular} \end{document}
Output:

Some characters might not appear as expected. Try:
\documentclass{article} \begin{document} Pipe sign: | Less than: < Greater than: > \end{document}
Output:

Just adding one line to the preamble specifying T1 fontencoding helps:
\documentclass{article} \usepackage[T1]{fontenc} \begin{document} Pipe sign: | Less than: < Greater than: > \end{document}
Output:

This entry was posted on Sonntag, Juni 15th, 2008 at 09:10 and is filed under Fonts and Symbols. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.





Januar 18th, 2012 at 14:21
Ah, yes, but what if you are already using UTF-8 encoding?
Januar 18th, 2012 at 14:36
Hi Ruquay,
UTF-8 encoding means input (character) encoding, not font encoding. Also if you add
the output of the pipe sign | and of the < and > symbols would still be wrong, without T1 font encoding.
Stefan
April 19th, 2012 at 20:49
Stafan,
so what is your suggestion? If I \usepackage[utf8]{inputenc} to be able process utf-8 encoded sources, what should I do to be able to write and | easily in utf-8 encoded sources?
Thank you,
Ash
April 19th, 2012 at 20:54
I mean \usepackage[T1]{fontenc} and
\usepackage[utf8]{inputenc}
does not work together.
April 19th, 2012 at 20:58
They work together. Perhaps show what doesn’t work for you. | works \usepackage[T1]{fontenc}, and still does if you use \usepackage[utf8]{inputenc} in addition.
November 27th, 2012 at 00:49
Perhaps the tilde (~) and backslash (\) should be listed as special LaTeX characters?