220

In the comments section of Does it matter if I use \textit or \it, \bfseries or \bf, etc, I asked for a clarification of these points. The clarification has mostly been made, but it was requested that I turn this into a question to provide for more room for this question to be fielded.

So here it is:

Please explain the difference between \emph and \textit. When should they be used, respectively?

BBischof
  • 4,149
  • 5
  • 28
  • 23

2 Answers2

250

Those are very different commands even if the output happens to look the same.

  • If you want to emphasize a word or some text, use \emph. Don't just make the text italic or bold. If needed, you may change the behaviour of \emph whenever you wish in the preamble and the whole document will be adjusted accordingly.

  • If you want to get italic text, use \textit. \emph might have a different effect, a package like ulem might change it to underlining for instance.

  • \emph may be nested: emphasized text within emphasized text may be upright. In contrary, nesting \textit just keeps the italic shape.

  • Further, I rarely use physical font commands in my body text. I use them to define styles in the preamble and use the styles in the document afterwards, ensuring consistency and allowing changes to be easily made.

Stefan Kottwitz
  • 231,401
  • 13
    I once got caught by 'ulem's redefinition. It took me ages to figure out why lots of things were getting underlined all of a sudden. – Andrew Stacey Aug 18 '10 at 20:40
  • 22
    The solution to the problem Adrew pointed out is to load ulem with \usepackage[normalem]{ulem}. – Peter Grill Aug 11 '11 at 23:05
  • 3
    Are there alternative forms of emphasis, one you can call for putting in italics, and one for boldface? (as opposed to explicitly using \textit{} and \textbf{} all the time) – bobobobo Jul 08 '12 at 17:33
  • stumbled over here because suddenly every \emph element was underlined! – Valentino Ru Jan 13 '13 at 18:28
  • 4
    Is this analogous to the differences between <em> and <i> tags in HTML? For example... – Fuhrmanator Mar 20 '13 at 14:21
  • 3
    @bobobobo Actually using \emph inside of italic text removes the italics on the emphasized text. – Evangelos Bempelis Jul 15 '14 at 17:01
  • 1
    So let's say I want to mention Pride and Prejudice by title, and my style guide says I should italicize it. What do I do in LaTeX? \emph or \textit? – Superbest Sep 15 '14 at 23:06
  • @Superbest As above, "If you want to get italic text, use \textit". If other italic text would contain the title, it won't be emphasized then. But that's the guide's decision, so be it. – Stefan Kottwitz Sep 16 '14 at 09:35
  • 1
    I've seen the use of \textit cause the first line of a block of text to be indented slightly (in comparison to its position before said \textit switch was invoked), whereas the use of \emph did not have this effect. – Digger Jul 31 '17 at 18:39
88

The \emph macro is designed to be semantic markup. So while by convention it makes text italic, this is not always the case. For example, the beamer class makes \emph text red as this works better in presentations than using italic.

On the other hand, \textit makes text italic, with no variation. Thus it is intended for making text italic when that is exactly what you want.

I would usually favour using \textit in a design context, where you are deciding 'these things should be italic'. Normally, that would be in the preamble or a class file, perhaps something like:

\newcommand*\latin[1]{\textit{#1}}

In the document body, I'd favour the semantic approach and use \emph, as this can then be defined in the preamble to do something else entirely.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036