2

I am not trying to do this in math mode, and yet a pair of consecutive hyphens

\documentclass{article}
\begin{document}
\sffamily\bfseries\itshape
How are you?\\
{\emph --Bob}
\end{document}

are not converted to an n-dash. Why?

  • 2
    When you say \emph --Bob, the argument for \emph is the first hyphen (\emph takes an argument!). The second hyphen is taken separately and not emphasized. The two hyphens are not digested together by TeX as an en-dash, because your erroneous syntax caused Tex to digest one, then the other, separately. – Steven B. Segletes Mar 8 '18 at 2:49
7

The correct usage of \emph is \emph{Bob}. The command takes an argument!

So with the following MWE

\documentclass{article}
\begin{document}
\sffamily\bfseries\itshape
How are you?\\
{\emph --Bob} --test --\emph{Bob} \emph{--Bob}
\end{document}

you get what you want:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.