[Tex/LaTex] Redefine \emph to be both bold and italic

emphasismacros

I'm trying to redefine the \emph command to make text bolded in addition to being italic, but when I use

\newcommand{\bfemph}[1]{\textbf{\emph{#1}}}

\renewcommand{\emph}[1]{\bfemph{#1}}

I get an error message. The first command defining \bfemph works on its own, but the latter does not.

I would really appreciate some help with this.

Best Answer

Rather than redefining \emph in terms of a copy of itself, it's better redefining it from scratch, using the standard definition as model; the standard definition is surprisingly simple:

% latex.ltx, line 3744:
\DeclareTextFontCommand{\emph}{\em}

because it's \em that does the hard work. So we can simply do

\documentclass[11pt]{article}

\let\emph\relax % there's no \RedeclareTextFontCommand
\DeclareTextFontCommand{\emph}{\bfseries\em}

\begin{document}

Here is \emph{emphasized text with something \emph{emphasized} inside}

\end{document}

enter image description here

However, double emphasis is really too much: italic is sufficiently prominent. The advantage of redefining \emph in this way is that you can simply comment out those two lines and return to the default.

Why doesn't your idea work? Because with those definitions, when TeX finds

\emph{text}

it changes it into

\bfemph{text}

and this becomes

\textbf{\emph{text}}

that in turn becomes

{<expansion of \textbf>\emph{text}}

Sorry, infinite loop: \emph will restart the machinery.