Italics in LaTeX

Write \textit{text} to set text in italics, or \emph{text} to emphasize it — \emph prints italics in normal text and switches back to upright inside italic text. In math mode single letters are already italic; use \mathrm{} or \text{} for letters and words that should stay upright.

Italic commands

  • \textit{italic text}
    italic text

    Italic text; also works inside a formula.

  • \emph{text}
    Text mode, no math preview

    Emphasis: italic in upright text, upright inside italic text.

  • {\itshape text}
    Text mode, no math preview

    Italic until the closing brace; for longer passages.

  • \textsl{text}
    Text mode, no math preview

    Slanted (oblique) rather than true italic.

  • \mathit{diff}
    diff

    Italic word in math with normal letter spacing.

  • \mathrm{d}x
    d x

    Upright letter in math, e.g. the differential d.

  • \text{if } x > 0
    if  x > 0

    Upright words inside a formula (amsmath).

  • \textbf{\textit{text}}
    text

    Bold italic.

Try it live

Change the formula and the preview redraws as you type. Copy the LaTeX, download a PNG or SVG, copy it for Word, or use Edit here on any example below to load it.

Templates

Italics examples

Each result below is drawn from the LaTeX under it. Copy the code, edit it on this page, or open it in the full editor.

  • Italic word in a formula

    x new = x old + Δ x
    LaTeX
    x_{\textit{new}} = x_{\textit{old}} + \Delta x
  • Math letters are already italic

    a 2 + b 2 = c 2
    LaTeX
    a^2 + b^2 = c^2

    No command needed: variables are set in math italic automatically.

  • Upright differential

    ∫ 0 1 x 2 d x = 1 3
    LaTeX
    \int_0^1 x^2 \, \mathrm{d}x = \frac{1}{3}

    Some style guides want d, e and i upright; \mathrm does it.

  • Multi-letter names

    speed vs s p e e d
    LaTeX
    \mathit{speed} \quad \text{vs} \quad speed

    Without \mathit the letters are spaced as a product s·p·e·e·d.

  • Function names stay upright

    sin ⁡ x + log ⁡ y + rank ( A )
    LaTeX
    \sin x + \log y + \operatorname{rank}(A)

    Use \sin, \log or \operatorname{…} rather than typing the letters.

In a LaTeX document

These commands work in the text of a .tex document (Overleaf, TeX Live, MiKTeX), not inside math. The box on the right shows what the compiled PDF looks like.

  • Italic words

    LaTeX
    The species \textit{Homo sapiens} appeared later.
    Compiled result

    The species Homo sapiens appeared later.

  • Emphasis inside italics

    LaTeX
    \textit{This theorem is \emph{not} true for n = 2.}

    Inside italic text \emph flips back to upright so the word still stands out.

    Compiled result

    This theorem is not true for n = 2.

\textit or \emph?

\textit always means "set this in italics" — use it for titles, foreign words and species names. \emph means "stress this": it produces italics in upright text but upright text inside an italic passage, such as a theorem statement. Because it describes the meaning, \emph is the usual choice for emphasis.

For a paragraph or more, use the declaration {\itshape …} rather than a very long argument. The deprecated \it still works in the standard classes but does not combine with bold and skips the italic correction.

Italics in math mode

LaTeX sets every letter in math mode in italics and treats consecutive letters as a product, which is why $speed$ looks spaced out. Use \mathit{speed} for an italic word, \text{speed} or \mathrm{speed} for an upright one.

Standard function names have their own commands (\sin, \exp, \det); for others define \DeclareMathOperator{\rank}{rank} in the preamble or write \operatorname{rank}.

Common mistakes

  • Math mode drops the spaces and uses math letter spacing, so the words run together.

    Instead of
    $italic words$
    Write
    \textit{italic words}
  • \it is deprecated, cancels bold and skips the italic correction before the next upright letter.

    Instead of
    {\it text}
    Write
    \textit{text}
  • ^ only works in math mode; in text it stops with "Missing $ inserted".

    Instead of
    \emph{x^2}
    Write
    $x^2$

In Overleaf, MathJax and Word

  • Overleaf and pdfLaTeX

    \textit, \emph, \itshape and \textsl need no package. If the chosen font lacks an italic shape LaTeX warns "Font shape undefined" and substitutes one.

  • MathJax and KaTeX

    MathJax renders \textit, \mathit and \mathrm inside math but not \emph or \itshape. In Markdown write italic prose with *…* and keep LaTeX for formulas.

  • Microsoft Word

    Italic text in Word is Ctrl+I. In a pasted equation (Copy for Word from the editor above) letters keep math italics; switch a letter to upright in Word's equation tools if needed.

Italics in LaTeX: questions

How do I italicize text in LaTeX?
Write \textit{text}. Use \emph{text} when the italics are for emphasis, so the emphasis still shows inside italic passages.
How do I italicize in math mode?
Single letters are italic already. For a whole word with normal spacing use \mathit{word}; \textit{word} also works inside a formula.
How do I make a letter upright in an equation?
Use \mathrm{d} for a letter or \text{if} for words. For function names use \sin, \log or \operatorname{name}.
How do I get bold italic text?
Nest the commands: \textbf{\textit{text}}.

Have the formula as a picture?

Paste a screenshot or photo of the equation and get its LaTeX, ready to copy or open in the editor.

Convert an image to LaTeX