Doc: Use of protect #5

Open
opened 2023-09-12 10:41:30 +00:00 by Ambroise · 0 comments
Owner

When using a special TeX command in titles or captions, these will be used by hyperref, and they must then be prevented to expand wrongly if they are not robust commands by using protect in front of them.
For example, given \newcommand{\GJ}{\mathcal{J}} if we want to set into a title \section{The $\GJ$ relation}, we need to write instead \section{The $\protect\GJ$ relation}.

When using a special TeX command in titles or captions, these will be used by hyperref, and they must then be prevented to expand wrongly if they are not robust commands by using `protect` in front of them. For example, given `\newcommand{\GJ}{\mathcal{J}}` if we want to set into a title `\section{The $\GJ$ relation}`, we need to write instead `\section{The $\protect\GJ$ relation}`.
Ambroise added the
enhancement
doc
examples
labels 2023-09-12 10:41:30 +00:00
Ambroise changed title from Use of protect to Doc: Use of protect 2023-09-12 10:42:25 +00:00
Sign in to join this conversation.
No description provided.