I am using RevTeX4-2
. I have a math expression in the name of a section. I would like it to be in the same font weight as the surrounding text: bold in the body of the text, and regular in the table of contents. The usual way to do this, \section[toc version]{doc version}
, doesn't work, as shown by the following MWE
\documentclass[aps,reprint,superscriptaddress]{revtex4-2}
\usepackage{bm}
\begin{document}
\title{This is the title}
\author{Bob Author}
\affiliation{L.A. Tex University}
\date{\today}
\begin{abstract}
Revtex doesn't seem to allow the section titles to have a different name in the table of contents.
\end{abstract}
\maketitle
\tableofcontents
\section[Case $\alpha>1$]{Case $\alpha>1$}
Note that $\alpha>1$ is not boldfaced in the section title.
\section[Case $\beta>1$]{Case \bm{$\beta>1$}}
In contrast, $\beta>1$ is indeed boldfaced in the section title.
Unfortunately, it is also boldfaced in the Table of Contents.
\vfill
\end{document}
Output:
Switching to memoir
class (though report
would also work), the usual way does work:
\documentclass{memoir}
% The `report` class would also work.
\usepackage{bm}
\begin{document}
\tableofcontents
\section[Case $\alpha>1$]{Case $\alpha>1$}
This uses the `memoir` class, but `report` would also work.
As before, $\alpha>1$ is not boldfaced in the section title.
\section[Case $\beta>1$]{Case \bm{$\beta>1$}}
Again, $\beta>1$ is indeed boldfaced in the section title.
However, this time around, it is \emph{not} boldfaced in
the Table of Contents.
\end{document}
Is there a way to make RevTex4-2 use the 'toc version' of the section name (which has non-bold math) in the Table of Contents?
Best Answer
As you discovered,
revtex4-2
does not use the optional\section
argument to write the ToC.This can be fixed by changing a single line in the
\@sect@ltx
macro. I don't know how to patch this long command, but by redefining it in the document, the bold face is removed from the ToC.Try this code. It needs to be compiled twice.