106

What is the difference between \emph{...} and {\em ...}?

When to use each of them?

N.N.
  • 36,163
jutky
  • 2,017

5 Answers5

117

\emph is like e.g. \textit a command with an argument. \em is the "switch" variant, comparable to \itshape. \em is not an outdated TeX or LaTeX2.09 command but a real LaTeX2e command. Actually \emph is defined through em:

\DeclareTextFontCommand{\emph}{\em}

\em is useful for long texts (\emph e.g. doesn't allow the argument to contain a \par). The commands differ (like the \textit/\itshape) in their handling of the italic correction:

\documentclass{article}
\begin{document}

abc\emph{lll}lll  \textit{lll}llll

abc{\em lll}lll  {\itshape lll}llll

abc{\em lll\/}lll

%\emph{abc\par bc} error

{\em abc\par bc}
\end{document}

output of the above code sample

doncherry
  • 54,637
Ulrike Fischer
  • 327,261
  • 11
    By the way the \/ sequence is not a normal spacing command but the so-called `italics correction', see http://stackoverflow.com/questions/1459454/latex-sequence – peschü Oct 04 '15 at 19:41
  • 2
    I am thoroughly confused as to what is the importance of "e.g." here. – Suppboi Apr 09 '18 at 23:20
10

l2tabu (a guide to obsolete commands and packages, available in English and, more up-to-date, in German) comments on \em as follows:

May be useful when defining macros. In continuous text \emph{...} should be preferred to \em.

(Table 1, p. 8 [en] / 10 [de])

doncherry
  • 54,637
9

\emph is a LaTeX2e command and \em is a LaTeX 2.09 declaration, see e.g. http://www.public.asu.edu/~rjansen/latexdoc/emph.html . Since you're probably using LaTeX2e you should use \emph.

  • \emph is a command and is used like \emph{text}.
  • \em is a declaration and is used like \em text or {\em text}.

Their differences may be demonstrated by the following:

\documentclass{article}

\begin{document}

some \em text% Works as intended

some {\em text}% Works as intended

some \em{text}% Does not work as intended, "text" is not emphasized

some \emph{text}% Works as intended

some \emph text% Does not work as intended, only "t" of "text" is emphasized

\end{document}
N.N.
  • 36,163
  • \em{text} will emphasize "text". But it won't work as intended because it will emphasize everything afterward as well. – Teepeemm Jan 07 '22 at 16:56
2

To get a more indepth description see wikibooks and texfaq. Let me present what is there in a condensed form, because I think the origin of misusing \em and \emph comes from not knowing how they help specifying a font.

Font Specification Now

Specification of a font works by choosing a series, a shape, a family and a size. You can choose from 3 series, 4 shapes and 3 families: One of

  • \bfseries,\mdseries,\lfseries switches to the series,
  • \upshape,\itshape,\slshape,\scshape switches to the shape,
  • \rmfamily,\sffamily,\ttfamily switches to the family.

Enclosing the text in braces makes it to a TeX group, thus restores the previous series/shape/family at closing brace. If you choose a slanted or italic shape you have to apply an italic correction (\/). You can use the non-switch version of these: Take the first two letters and appent "text", this is the name of an ordinary command that works as expected i.e. either acts on a single char or on a text enclosed in braces.

Font Specification Then

Before LaTeX2e there were only switch like statements like \bf,\tt,\em. They modified the text as long as no other was encountered. This is why \em{abc}de gives "abcde": {abc} is just a group, since no different switch is ancountered \em does not stop working at the closing brace. \it I\bf like \it\bf fresh air gives "I like fresh air".

emph & em

Well... sorry for the overhead. \em is different in that it not really is a switch to italics like \it/\itshape. It just switches from upright/small-capitals to italics or from italics/slanted to upright when it is encountered (switches the shape) and leaves the family and series untouched. Thus the definition of \emph should be losely equivalent to \def\emph#1{\/{\em#1}\/}. Which works as expected:
{\upshape a\emph{b\emph{c\emph{d}e}f}g} yields "a b c d e f g" (without the spaces of course). The Implemetation in LaTeX2e is of course different, they use \DeclareTextFontComand{\emph}{\em} which does a similar thing but also checks for mathmode.

The most imporatant thing is the Implementation of \em in LaTeX2e which is indeed such that the behaviour as said above: {\scshape Aha \em Aha \em Aha} yields "AHA Aha Aha" where the AHA is in small capitals (the scshape ist not restored after the 2nd \em).

1

From what I understood, em is the TeX command and emph is its LaTeX equivalent. Therefore, you should use the emph when using LaTeX.

Dror
  • 22,613