Skip to main content
texfaq
Source Link
David Carlisle
  • 832.2k
  • 74
  • 1.7k
  • 2.6k

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQTeX FAQ has much more information about "patching" commands. Edit2: egreg's answer below describes some of the gotchas of \let)

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQ has much more information about "patching" commands. Edit2: egreg's answer below describes some of the gotchas of \let)

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQ has much more information about "patching" commands. Edit2: egreg's answer below describes some of the gotchas of \let)

added 68 characters in body
Source Link
huon
  • 2.2k
  • 1
  • 14
  • 14

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQ has much more information about "patching" commands. Edit2: egreg's answer below describes some of the gotchas of \let)

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQ has much more information about "patching" commands.)

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQ has much more information about "patching" commands. Edit2: egreg's answer below describes some of the gotchas of \let)

Source Link
huon
  • 2.2k
  • 1
  • 14
  • 14

You can use \let to save a command under another name, and then use that new name in the \renewcommand.

\documentclass{article}

\let\oldemph\emph
\renewcommand{\emph}[1]{\textbf{\oldemph{#1}}}

\begin{document}
\oldemph{Old emph}
\emph{New emph}
\end{document}

(Edit: the TeX FAQ has much more information about "patching" commands.)