Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to use the titlesec package, but somehow section names in the \tableofcontents become overlapped with the TOC numbers and subsection names become improperly indented. Here's an example, where I use the standard classes seen here (3.2, p.27) as an example.

\documentclass{amsart}
\usepackage{titlesec}

\titleformat{\section}{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}

\begin{document}

\tableofcontents
\section{Section Title}
\subsection{Subsection Title}

\end{document} 

Result

share|improve this question
    
Sorry, but titlesec is not compatible with the AMS classes. Just use the article class. –  egreg Sep 10 '12 at 20:58
add comment

1 Answer 1

up vote 1 down vote accepted

As egreg mentions in his comment (and as you've already experienced), titlesec and amsart are not compatible; you have two options:

  1. Switch to the standard article class.

  2. Change \section, \subsection and \@secnumfont as implemented in amsart.cls to get the desired layout.

Here's an example of the redefinitions for the second option:

\documentclass{amsart}

\makeatletter
\def\@secnumfont{\bfseries}
\def\section{\@startsection{section}{1}%
  \z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
  {\normalfont\Large\bfseries}}
\def\subsection{\@startsection{subsection}{2}%
  \z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
  {\normalfont\large\bfseries}}
\makeatother

\begin{document}

\tableofcontents
\section{Section Title}
\subsection{Subsection Title}

\end{document}

enter image description here

Probably you will also want to redefine \specialsection, whose definition is

\def\specialsection{\@startsection{section}{1}%
  \z@{\linespacing\@plus\linespacing}{.5\linespacing}%
  {\normalfont\centering}}
share|improve this answer
    
I added an extra question, but nevermind. I might as well work with the article class and alter its default fonts/headings to emulate amsart's, which is probably easier than dealing with very nitpicky things regarding headers, TOCs, and section headings in amsart. Thanks a bunch! –  Riem Sep 11 '12 at 11:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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