AMSart 中的分段和章节功能完全不起作用(示例)

AMSart 中的分段和章节功能完全不起作用(示例)

我想知道为什么 AMSart 声称支持分段和章节,却根本不编译我的章节标题。我这里有一个不起作用的示例,它表明节和章节命令都不起作用。有人能帮我弄清楚如何将章节和节放在那里吗?非常感谢!

   \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}

答案1

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

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

amsart 没有定义章节(就像article没有一样)。

您会收到一条错误消息,但不幸的是natbib它被定义为默默忽略,这实际上是该软件包中的一个错误。

在此处输入图片描述

 \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}

相关内容