2

I am using amsart for writing my seminar talk. I changed the section style form scshape to bfseries by writing

\renewcommand{\@secnumfont}{\bfseries}
\renewcommand\section{\@startsection{section}{2}%
  \z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
  {\normalfont\bfseries}}

However, this does also affect the style of things like References or Index. How can I prevent this? And why does this not affect the style of Contents as one can see here

enter image description here

Everything can be found here https://github.com/TheGeekGreek/harmonic_analysis.git. Thanks in advance.

  • So you want a different formatting for your regular \sections compared to the ToC and the References (and Index...)? – Werner Aug 3 '16 at 23:09
3

You can define a style-switching macro that switches between the original style - \originalsectionstyle and your newly-defined style - \newsectionstyle:

\documentclass{amsart}

\makeatletter
\newcommand{\newsectionstyle}{%
  \renewcommand{\@secnumfont}{\bfseries}
  \renewcommand\section{\@startsection{section}{2}%
    \z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
    {\normalfont\bfseries}}%
}
\let\oldsection\section% Store original \section
\let\old@secnumfont\@secnumfont% Store original \@secnumfont
\newcommand{\originalsectionstyle}{%
  \let\@secnumfont\old@secnumfont
  \let\section\oldsection
}
\makeatother

\usepackage{lipsum}

\begin{document}

\tableofcontents

\newsectionstyle

\section{Linear Operators}\lipsum[1-10]

\section{The Real Method}\lipsum[11-20]

\section{The Complex Method}\lipsum[21-30]

\subsection{Hadamard's Three Lines Lemma}\lipsum[31-40]

\section{Interpolation of Analytic Families of Operators}\lipsum[41-50]

\originalsectionstyle

\begin{thebibliography}{x}
  \bibitem{abc} Abc
\end{thebibliography}

\end{document}

\originalsectionstyle reverts to the original formatting that was stored within the preamble. Here are their respective formatting settings if you wish to update them in a similar manner to what is done inside \newsectionstyle:

\def\@secnumfont{\mdseries}
\def\section{\@startsection{section}{1}%
  \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
  {\normalfont\scshape\centering}}
| improve this answer | |
  • Perfect. Just one last question: How would I change in \originalsectionstyle the \scshape to \bfseries? – TheGeekGreek Aug 3 '16 at 23:33
  • @TheGeekGreek: My approach for \originalsectionstyle was to revert back to the original definitions as set out by amsart.cls. However, you could redefine them in the same way you did in \newsectionstyle. I've updated my answer to include the original source definitions, where you can change \scshape to \bfseries and put is as-is inside \originalsectionstyle. – Werner Aug 3 '16 at 23:38
  • Many thanks. Everything works nice, but somehow the formatting of Contents is left unchanged. Even if I put \originalsectionstyle before \tableofcontents. Any idea? – TheGeekGreek Aug 3 '16 at 23:48
  • @TheGeekGreek: That's because \tableofcontents sets things up in a special way. Do you want \tableofcontents to also work the same under \newsectionstyle? – Werner Aug 4 '16 at 0:06
  • What exactly does ''work the same'' mean? I just want the \scshape replaced by \bfseries, so basically contents should be \originalsectionstyle discussed above. – TheGeekGreek Aug 4 '16 at 0:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.