2

I am wondering why AMSart which reputedly supports sectioning and chaptering doesn't compile my chapter headings at all. I have a non-working example here which shows that neither the section nor the chapter command works. Can someone help figure out how to put chapters and sections in there? Thank you so much!

   \documentclass[12pt]{amsart}            %You need this
%\usepackage[foot]{amsaddr}              %Puts authors' affiliations below names
\usepackage{amssymb}                    %More math symbols
\usepackage{mathtools}                      %More math symbols
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{graphicx}                       %Insert pictures
\usepackage{amsmath,amssymb,amsthm}    %Lets you use math
\usepackage{tikz}                           %Graphs
\usepackage{setspace}                       %Allows margin and text spacing options
\usepackage{xcolor}                         %Color
\usepackage{pdfpages}                       %Lets you append pdfs
\usepackage[sort]{natbib}                   %For the bibliography
\bibpunct{(}{)}{;}{a}{,}{,}                 %Punctuation in bibliography
\usepackage{datenumber}                     %More formatting options for date
%\usepackage[implicit=true]{hyperref}
\usepackage{url}                            %Lets you link items
\usepackage{tabularx}                       %Prettier tables, if we're doing them in LaTeX
\usepackage{xcolor}                         %Colors
\usepackage{needspace}                      %Insert pagebreak if not enough space
%
%Old ones
%\documentclass[a4paper,aps,superscriptaddress,nofootinbib]{revtex4}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
%\usepackage{hyperref}
\usepackage{epsfig}
\usepackage{enumerate}
\usepackage{epstopdf}
\usepackage{etoolbox} %To generate the bibliography in aps, we need this.
\usepackage{rotating} %To use with the enviroments begin sideways etc.
\usepackage[T1]{fontenc} %To prevent unexpected results when this text is copied.
\usepackage{pbox}
\usepackage[english]{babel}
\usepackage{tikz} %Das ist kein Zeichenprogramm.
\usepackage{graphics} 
\usepackage[citecolor= black,colorlinks=true,linkcolor = black,urlcolor  = black]{hyperref} 
%\usepackage{hypernat} 
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{enumerate}
\usepackage{setspace} %This allows spacing
\usepackage[a4paper,margin=20mm,footskip=.5cm]{geometry} %The geometry package allows the adjustment of the margin.
\usepackage{titlesec} %This is for the spacing of section titles.
\usetikzlibrary{decorations.pathreplacing}
%End of packages and libraries.
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\special{papersize=\the\paperwidth,\the\paperheight}

%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\@ifundefined{textcolor}{}
{%
 \definecolor{BLACK}{gray}{0}
 \definecolor{WHITE}{gray}{1}
 \definecolor{RED}{rgb}{1,0,0}
 \definecolor{GREEN}{rgb}{0,1,0}
 \definecolor{BLUE}{rgb}{0,0,1}
 \definecolor{CYAN}{cmyk}{1,0,0,0}
 \definecolor{MAGENTA}{cmyk}{0,1,0,0}
 \definecolor{YELLOW}{cmyk}{0,0,1,0}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

% latex advancedlab ; dvips -Ppdf -t letter -G0 advancedlab

%%%New commands
\newcommand{\?}{'\-\nobreak\hspace{0pt}} %This introduces a nifty apostrophe
\newcommand\mycite[1]{% with Numbers 
\citeauthor{#1}~(\citeyear{#1})\@
}
\DeclareMathOperator{\vect}{vec}
\DeclareMathOperator{\vectbr}{vecb_{r}}
\DeclareMathOperator{\col}{col}
\DeclareMathOperator{\var}{var}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\rank}{rank}
\newcommand{\distas}[1]{\mathbin{\overset{#1}{\kern\z@\sim}}}%
\newsavebox{\mybox}\newsavebox{\mysim}
\newcommand{\distras}[1]{%
  \savebox{\mybox}{\hbox{\kern3pt$\scriptstyle#1$\kern3pt}}%
  \savebox{\mysim}{\hbox{$\sim$}}%
  \mathbin{\overset{#1}{\kern\z@\resizebox{\wd\mybox}{\ht\mysim}{$\sim$}}}%
}
%\renewcommand{\baselinestretch}{1.5}

%Commands for layout
\linespread{1.3} %This is about one and half-spaced
\setlength{\parskip}{4mm plus 2mm minus 3mm} %Here we have spaces between paragraphs.
%\titlespacing*{<command>}{<left>}{<before-sep>}{<after-sep>}
\titlespacing*{\section}{0pt}{2mm plus 1mm minus 1mm}{2ex}
\titlespacing*{\subsection}{0pt}{2mm plus 1mm minus 1mm}{2ex}
%%% End of layout commands.
\makeatother




\newtheorem{prop}{Proposition}
\newtheorem{define}{Definition}
\newtheorem{asm}{Assumption}
\newtheorem{lma}{Lemma}
\newtheorem{thm}{Theorem}
\newtheorem{qn}{Question}
\newtheorem{rmk}{Remark}
\newtheorem{clm}{Claim}
\newtheorem{obs}{Observation}



\begin{document}
\vspace{0.6cm}

\title{Title}
\author{Me}
%\affiliation{My Uni}
%
\date{\today}
%
\begin{abstract}
\vspace{2mm}
My abstract
\end{abstract}
\maketitle

\chapter{My strange Chapter Title}
Sample text
%\section{My Failing Section Title}
Hello


\pagebreak
\bibliographystyle{ecta}
\makeatletter
\renewcommand\@biblabel[1]{\hspace*{\labelwidth}}
\apptocmd{\NAT@thebibliography}{\setlength\itemindent{-14pt}}{}{}
\makeatother

\bibliography{/Users/Jerome/Dropbox/Bibliography/bibo}

\end{document}
3
  • don't load epsfig and don't do \special{papersize=\the\paperwidth,\the\paperheight} if you are using geometry, or pdflatex Feb 23, 2015 at 15:22
  • 1
    in the ams document classes, \chapter is defined only for books -- in amsbook. it is not a logical subdivision for articles (journal or proceedings). \part is provided; also \specialsection. you might try one of those. Feb 23, 2015 at 15:30
  • 1
    I'm not sure one should use titlesec with amsart.
    – egreg
    Feb 23, 2015 at 15:33

1 Answer 1

3
> \chapter=undefined.
l.16 \show\chapter

? 
(/usr/local/texlive/2014/texmf-dist/tex/latex/natbib/natbib.sty)
> \chapter=\relax.
l.18 \show\chapter

amsart does not define chapter (just as article does not).

You would have got an error message but unfortunately natbib defines it to silently be ignored, which is a bug in that package, really.

enter image description here

 \documentclass[12pt]{amsart}            %You need this

%\usepackage[foot]{amsaddr}              %Puts authors' affiliations below names
\usepackage{amssymb}                    %More math symbols
\usepackage{mathtools}                      %More math symbols
% no \usepackage{amsmath}
\usepackage{amsthm}
\usepackage{graphicx}                       %Insert pictures
% no \usepackage{amsmath,amssymb,amsthm}    %Lets you use math
\usepackage{tikz}                           %Graphs
\usepackage{setspace}                       %Allows margin and text spacing options
\usepackage{xcolor}   
\show\chapter                      %Color
\usepackage{pdfpages}                       %Lets you append pdfs
\usepackage[sort]{natbib}                   %For the bibliography
\bibpunct{(}{)}{;}{a}{,}{,}                 %Punctuation in bibliography
\usepackage{datenumber}                     %More formatting options for date
%\usepackage[implicit=true]{hyperref}
\usepackage{url}                            %Lets you link items
\usepackage{tabularx}                       %Prettier tables, if we're doing them in LaTeX
\usepackage{xcolor}                         %Colors
\usepackage{needspace}                      %Insert pagebreak if not enough space
%
%Old ones
%\documentclass[a4paper,aps,superscriptaddress,nofootinbib]{revtex4}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
%\usepackage{hyperref}
% No!! \usepackage{epsfig}
\usepackage{enumerate}
\usepackage{epstopdf}
\usepackage{etoolbox} %To generate the bibliography in aps, we need this.
\usepackage{rotating} %To use with the enviroments begin sideways etc.
\usepackage[T1]{fontenc} %To prevent unexpected results when this text is copied.
\usepackage{pbox}
\usepackage[english]{babel}
\usepackage{tikz} %Das ist kein Zeichenprogramm.
%no \usepackage{graphics} 

\usepackage[citecolor= black,colorlinks=true,linkcolor = black,urlcolor  = black]{hyperref} 
%\usepackage{hypernat} 
\usepackage{pdflscape}
% no \usepackage{graphicx}
% no \usepackage{enumerate}
% no \usepackage{setspace} %This allows spacing
\usepackage[a4paper,margin=20mm,footskip=.5cm]{geometry} %The geometry package allows the adjustment of the margin.
%\usepackage{titlesec} %This is for the spacing of section titles.
\usetikzlibrary{decorations.pathreplacing}
%End of packages and libraries.
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
% no\special{papersize=\the\paperwidth,\the\paperheight}

%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\@ifundefined{textcolor}{}
{%
 \definecolor{BLACK}{gray}{0}
 \definecolor{WHITE}{gray}{1}
 \definecolor{RED}{rgb}{1,0,0}
 \definecolor{GREEN}{rgb}{0,1,0}
 \definecolor{BLUE}{rgb}{0,0,1}
 \definecolor{CYAN}{cmyk}{1,0,0,0}
 \definecolor{MAGENTA}{cmyk}{0,1,0,0}
 \definecolor{YELLOW}{cmyk}{0,0,1,0}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.

% latex advancedlab ; dvips -Ppdf -t letter -G0 advancedlab

%%%New commands
\newcommand{\?}{'\-\nobreak\hspace{0pt}} %This introduces a nifty apostrophe
\newcommand\mycite[1]{% with Numbers 
\citeauthor{#1}~(\citeyear{#1})\@
}
\DeclareMathOperator{\vect}{vec}
\DeclareMathOperator{\vectbr}{vecb_{r}}
\DeclareMathOperator{\col}{col}
\DeclareMathOperator{\var}{var}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\rank}{rank}
\newcommand{\distas}[1]{\mathbin{\overset{#1}{\kern\z@\sim}}}%
\newsavebox{\mybox}\newsavebox{\mysim}
\newcommand{\distras}[1]{%
  \savebox{\mybox}{\hbox{\kern3pt$\scriptstyle#1$\kern3pt}}%
  \savebox{\mysim}{\hbox{$\sim$}}%
  \mathbin{\overset{#1}{\kern\z@\resizebox{\wd\mybox}{\ht\mysim}{$\sim$}}}%
}
%\renewcommand{\baselinestretch}{1.5}

%Commands for layout
\linespread{1.3} %This is about one and half-spaced
\setlength{\parskip}{4mm plus 2mm minus 3mm} %Here we have spaces between paragraphs.
%\titlespacing*{<command>}{<left>}{<before-sep>}{<after-sep>}
\titlespacing*{\section}{0pt}{2mm plus 1mm minus 1mm}{2ex}
\titlespacing*{\subsection}{0pt}{2mm plus 1mm minus 1mm}{2ex}
%%% End of layout commands.
\makeatother




\newtheorem{prop}{Proposition}
\newtheorem{define}{Definition}
\newtheorem{asm}{Assumption}
\newtheorem{lma}{Lemma}
\newtheorem{thm}{Theorem}
\newtheorem{qn}{Question}
\newtheorem{rmk}{Remark}
\newtheorem{clm}{Claim}
\newtheorem{obs}{Observation}



\begin{document}
\vspace{0.6cm}

\title{Title}
\author{Me}
%\affiliation{My Uni}
%
\date{\today}
%
\begin{abstract}
\vspace{2mm}
My abstract
\end{abstract}
\maketitle


\section{My strange Chapter Title}
Sample text
%\section{My Failing Section Title}
Hello


\pagebreak
\bibliographystyle{ecta}
\makeatletter
\renewcommand\@biblabel[1]{\hspace*{\labelwidth}}
\apptocmd{\NAT@thebibliography}{\setlength\itemindent{-14pt}}{}{}
\makeatother

\bibliography{/Users/Jerome/Dropbox/Bibliography/bibo}

\end{document}
6
  • Ha Thanks @David Carlisle but does it allow sectioning then? It did not really assign a number, either.
    – Hirek
    Feb 23, 2015 at 15:24
  • Oh Ok, but the section command does not work either, that is odd then no?
    – Hirek
    Feb 23, 2015 at 15:26
  • \section works, If I change \chapter to \section in your example Feb 23, 2015 at 15:28
  • 1
    @Hirek Oh I get ! Undefined control sequence. <argument> ...on\endcsname \protect \@secnumpunct If I put titlesec back, I removed that initially. Perhaps that package does not work with amsart out of teh box. Feb 23, 2015 at 15:31
  • @Hirek I added a working version of your document Feb 23, 2015 at 15:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .