Special LaTeX characters

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:

LaTeX symbols

Some characters might not appear as expected. Try:

\documentclass{article}
\begin{document}
Pipe sign: |
 
Less than: <
 
Greater than: >
\end{document}

Output:

OT1 encoding

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:

T1 encoding

15. June 2008 by stefan
Categories: Uncategorized | 8 comments

Comments (8)

Leave a Reply