3

I would like the following, which I have been unable to resolve: the section title should be of the form

Section Sectionnumber. Sectiontitle

(E. g. Section 1. On a theorem of Euler.)

I have tried some primitive \renewcommand, but it failed in the sense that I only want Section to appear in the section headings, but not in the numbering of theorems etc.

\documentclass[12pt]{amsproc}
\begin{document}
\section{Preliminaries.}
\end{document}

2 Answers 2

4

You could update the way the section counter is formatted/printed. This is done by the macro \@seccntformat:

enter image description here

\documentclass[12pt]{amsproc}% http://ctan.org/pkg/amsproc
\makeatletter
\def\@seccntformat#1{%
  Section~\protect\textup{\protect\@secnumfont
    \csname the#1\endcsname
    \protect\@secnumpunct
  }%
}
\makeatother
\begin{document}
\tableofcontents
\section{Preliminaries}\label{sec:prelim}
See Section~\ref{sec:prelim}.
\end{document}

The definition of \@seccntformat was taken verbatim from amsclass.dtx with the addition of Section~.

Note that the above change will influence all sections. So, even \subsection will be prefixed with Section. However, the argument of \@seccntformat is exactly the <type> of sectional unit. So, we could define a bunch of \<type>@name (say) macros containing the sectional unit type to obtain unit-specific prefixes:

\makeatletter
\newcommand{\section@name}{Section}
\newcommand{\subsection@name}{Subsection}
\newcommand{\subsubsection@name}{Subsubsection}
\def\@seccntformat#1{%
  \csname #1@name\endcsname~\protect\textup{\protect\@secnumfont
    \csname the#1\endcsname
    \protect\@secnumpunct
  }%
}
\makeatother
0
3

Using the titlesec package should do it. Just try this code:

\documentclass[12pt]{amsproc}% http://ctan.org/pkg/amsproc  

\usepackage[utf8]{inputenc}   
\usepackage[T1]{fontenc}  
\usepackage{lmodern} 
\usepackage{titlesec}
\usepackage[dotinlabels]{titletoc}

\titleformat{\section}[block]{\bfseries\large\filcenter}{Section \thesection.}{0.4em}{}
\titlespacing*{\section}{0pt}{2\baselineskip}{2\baselineskip}
\titlecontents{section}[4em]{}{\contentslabel{1.5em}}{}{}%

\begin{document}
\tableofcontents

\section{Preliminaries}\label{sec:prelim}
\section{Another section}
See Section~\ref{sec:prelim}.
\end{document}

You must log in to answer this question.