1

I just encountered this problem Missing number, treated as zero. [ \begin{Cauchy} ] and this Illegal unit of measure (pt inserted). [ \begin{Cauchy} ] I know that somebody has already met this problem and it has been answered before, but mine hasn't been solved yet, can somebody help me? The code is shown below.

\documentclass{article}
    \usepackage{pifont}
    \usepackage{enumerate}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amsthm}
\begin{document}
    \newtheoremstyle{nonum}{}{}{\itshape}{}{\bfseries}{.}
        {}{#1 (\mdseries #3)}
    \theoremstyle{nonum}
    \newtheorem{Cauchy}{Cauchy's Theorem}
    \begin{Cauchy}[Third Version]
        If $G$ is a simply connected open subset of $\mathbb{C}$, then for every closed rectifiable curve $\gamma$ in $G$, we have
        \begin{equation*}
            \int_\gamma f=0.
        \end{equation*}
    \end{Cauchy}
\end{document}

I would appreciate it so much if this problem can be solved.

Alan Munn
  • 218,180
  • Welcome to TeX.se. Please don't post code fragments. Instead, put the fragment into a compilable (even with error) document that shows the problem. – Alan Munn Apr 29 '20 at 01:22
  • oops!!! thanks very much!!! just learning... –  Apr 29 '20 at 01:24
  • To quote a previous answer (https://tex.stackexchange.com/a/539371), "The last-but-one argument to \newtheoremstyle must be a length." – barbara beeton Apr 29 '20 at 01:31
  • wow!!! this perfectly worked!!! thank u barbara!!! –  Apr 29 '20 at 01:35
  • 1
    @barbarabeeton I'm posting an answer rather than closing this as a duplicate, since this question is much clearer than the one you link to. (And in fact the argument can contain a space or a length; it just can't be empty.) – Alan Munn Apr 29 '20 at 01:41
  • thanks bro@alan –  Apr 29 '20 at 01:56

1 Answers1

3

The eighth argument of the \newtheorem command must contain either a space, or a length. It cannot simply be {}:

\documentclass{article}
\usepackage{pifont}
\usepackage{enumerate}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\newtheoremstyle{nonum}
{}{}
{\itshape}{}
{\bfseries}{.}
{ } % This must contain either a space or a length
{#1 (\mdseries #3)}
\theoremstyle{nonum}

\begin{document} \newtheorem{Cauchy}{Cauchy's Theorem} \begin{Cauchy}[Third Version] If $G$ is a simply connected open subset of $\mathbb{C}$, then for every closed rectifiable curve $\gamma$ in $G$, we have \begin{equation} \int_\gamma f=0. \end{equation} \end{Cauchy} \end{document}

Alan Munn
  • 218,180