# Using amsart, make running heads title of the current section?

Using the amsart document class, how can I replace all the running heads with the title of the current section? Is there a way to do this natively in the class, or am I looking at needing fancyhdr, or something? What even is the command which fills in the name of the current section, and is it available in amsart?

Thanks so much.

-
\pagestyle{headings} same as article class is I think what you are looking for. – David Carlisle May 24 '13 at 22:27
Welcome to TeX.SX! You may have a look on our starter guide. – mafp May 24 '13 at 22:34

The amsart class is a rather closed one. It disables commands such as \sectionmark and similar ones and also redefines the sectioning commands for not updating the marks necessary for the job.

It's possible to do it, but remember that something might go wrong, as it's complicated to keep up with all the adjustments the class does.

\documentclass{amsart}

\usepackage{regexpatch}

\usepackage{kantlipsum} % just for the example

%%% let's patch the amsart macros
\makeatletter
\renewcommand{\sectionmark}[2]{%
\ifnum#1<\@m
\markboth{\thesection. #2}{\thesection. #2}%
\else
\markboth{#2}{#2}%
\fi}
\xpatchcmd*{\@sect}
{\@tocwrite}
{\csname #1mark\endcsname{#2}{#7}\@tocwrite}
{}{}
\makeatother

\begin{document}
\author{Me}
\title{Whatever}
\maketitle

\section{First}
\kant

\section{Second}
\kant

%%% let's provide a mock bibliography
\begin{thebibliography}{99}

\count255=0
\loop\ifnum\count255<60