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:
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:
Ah, yes, but what if you are already using UTF-8 encoding?
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
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
I mean usepackage[T1]{fontenc} and
usepackage[utf8]{inputenc}
does not work together.
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.
Perhaps the tilde (~) and backslash () should be listed as special LaTeX characters?
I just add \usepackage[utf8]{inputenc} and then I write | in the text and it worked
However, none of the TIPA inputs work in a bibtex file. You can alternatively just use $\mid$ for the pipe anywhere (math mode).