2

Typing the formula

C.I._{95%}

doesn't display the % symbol in the document. It looks just how

C.I._95

would be displayed.

Background: When creating a OpenOffice formula as math object % is often used for special symbols, e.g. %alpha displays the proper Greek symbol. Maybe it's assuming I'm trying to get it to be something else?

Research:

C.I._{95%perthousand}

displays properly (the one that looks like 0/oo).

How do I get the % symbol to show up?

2
  • Do you just want \%? Oct 6, 2013 at 19:07
  • 1
    Welcome to TeX.SX! In TeX the percent sign % begins a comment extending over the whole line. To escape it use \% instead.
    – moewe
    Oct 6, 2013 at 19:08

1 Answer 1

7

Remarks

By default the %-symbol is the symbol used to make a comment. To display the symbol you have to "escape" it by prefixing it with \, i.e. \%. The same applies for other symbols, e.g. \$, \{ or \}.

The implementation to get the permille symbol was taken from @egreg's answer in Per mille symbol in classicthesis style.

Implementation

\documentclass{article}
\pagestyle{empty}
\usepackage{textcomp}
\usepackage{amsmath}
\DeclareRobustCommand{\perthousand}{%
    \ifmmode
        \text{\textperthousand}%
    \else
        \textperthousand
    \fi}
\begin{document}
$C.I._{95\%}$
$C.I._{95\perthousand}$
\end{document}

Output

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .