6

I want to use a "|" in my \emph{}, like \emph{"Yes"|"No"}, but it changes the | to a --.

How do I stop this from happening?

karlkoeller
  • 124,410
sparticvs
  • 163

1 Answers1

5

With \usepackage[T1]{fontenc} you don't have the problem with the bizarre output. However the result is not beautiful. I'll show it together with a \textor command that seems better.

\documentclass{article}
\usepackage[T1]{fontenc}
\DeclareRobustCommand\textor{%
  \ifdim\fontdimen1\font>0pt % test if the current font is slanted
    \/$\,|$% it is
  \else
    $\,|\,$% it isn't
  \fi}
\begin{document}
\emph{``Yes''|``No''}

\emph{``Yes''\textor``No''}

``Yes''\textor``No''
\end{document}

enter image description here

egreg
  • 1,121,712
  • I left out the fontenc package as even without using the first method, all the quotes look weird. Thanks for this solution works great! – sparticvs Jun 19 '13 at 17:13