6

I found the following example of how one should be able to avoid numbering in theorems. However for me this is not working. Here is some code ( I wanted to test if the non numbering works for Propostion):

\documentclass{amsart}
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage[pdftex,citecolor=green,linkcolor=red]{hyperref}
\usepackage{listings}
\usepackage{nameref}


\usepackage{amssymb}
\usepackage{amsmath,amssymb,amsfonts,mathrsfs,datetime}
\usepackage{listings}

\theoremstyle{definition}
\newtheorem{thm}{Theorem}[section]
\newtheorem*{prop*}[thm]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[thm]{Definition}
\newtheorem{example}[thm]{Example}

\theoremstyle{remark}

\newtheorem{remark}[thm]{Remark}

\numberwithin{equation}{section}

\newcommand{\R}{\mathbf{R}}  % The real numbers.

\usepackage{Sweave}
\begin{document}

\definecolor{mygreen}{HTML}{4C886B}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}

\title{Big doc}

\begin{abstract}
test1
\end{abstract}

 \maketitle
\section{Introduction}
Test2
\end{document}

I get the following error message:

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...   

So what is going wrong in my example?

5
  • 3
    \newtheorem*{prop*}{Proposition}, not \newtheorem*{prop*}[thm]{Proposition}.
    – GuM
    Jun 13, 2015 at 18:44
  • 2
    Welcome to TeX.SX! \newtheorem* does not take an optional argument. Jun 13, 2015 at 18:45
  • not relevant to the question, but, you don't have to load amsmath or amsfonts; they're already loaded by amsart. and amssymb should really be loaded only once. Jun 13, 2015 at 18:47
  • @GustavoMezzetti -- post answer, please. that's the right answer. Jun 13, 2015 at 18:49
  • @AndrewSwann -- the starred form of \newtheorem is defined by amsthm, which is built into amsart. Jun 13, 2015 at 18:50

1 Answer 1

11

It is well known that the *-form of the \newtheorem command does not take any optional argument. The following code illustrates the correct usage:

\documentclass{amsart}
% Removed all irrelevant/superfluous/twice-loaded packages.

\theoremstyle{definition}
\newtheorem{thm}{Theorem}[section]
\newtheorem*{prop*}{Proposition}

\begin{document}

\title{Big doc}
\author{Some One}

\begin{abstract}
    Some text.
\end{abstract}

 \maketitle
\section{Introduction}
Text above.
\begin{prop*}
    This is the claim.
\end{prop*}
Text in the middle.
\begin{thm}
    A numbered theorem.
\end{thm}
Text below.
\end{document}

The error occurs because TeX tries to typeset the optional argument as if it were text belonging to the document; but such text is not allowed before \begin{document}.

You must log in to answer this question.

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