3

In the attached picture you can see that boxed theorem has the same numaration as the theorem which follows it. Also Corollary have a numeration. I am wondering how to give a proper numeration to all theorems? I mean the boxed theorem should be 1 and the next one is 2 and so on. I'd like to have Corollary without any numeration.

Thank you so much!

Please see my code

\documentclass{article}
%\documentclass[16pt]{report}
\usepackage[a4paper,text={16.5cm,25.2cm},centering]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsfonts}
\usepackage{hyperref}
\usepackage{amssymb}

\usepackage{mdframed} \usepackage{lipsum} \usepackage{amsmath} \usepackage{amsthm} \usepackage{nccmath} \usepackage{dsfont} \usepackage{cancel} \usepackage{mathtools} \usepackage{setspace} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \onehalfspacing %\doublespacing \usepackage{mathtools}

\makeatletter \newcommand{\xMapsto}[2][]{\ext@arrow 0599{\Mapstofill@}{#1}{#2}} \def\Mapstofill@{\arrowfill@{\Mapstochar\Relbar}\Relbar\Rightarrow} \makeatother

\newcommand{\RN}[1]{% \textup{\uppercase\expandafter{\romannumeral#1}}% }

\newmdtheoremenv{theo}{Theorem}

\newenvironment{claim}[1]{\par\noindent\underline{Claim:}\space#1}{} \newenvironment{claimproof}[1]{\par\noindent\underline{Proof:}\space#1}{\hfill $\blacksquare$}

\newtheorem*{remark}{Remark} \newtheorem{theorem}{Theorem} \newtheorem{corollary}{Corollary}

\usepackage{graphicx} \newcommand\smallO{ \mathchoice {{\scriptstyle\mathcal{O}}}% \displaystyle {{\scriptstyle\mathcal{O}}}% \textstyle {{\scriptscriptstyle\mathcal{O}}}% \scriptstyle {\scalebox{.7}{$\scriptscriptstyle\mathcal{O}$}}%\scriptscriptstyle }

\usepackage{stackengine} \parskip 1em \newcommand\stackequal[2]{% \mathrel{\stackunder[2pt]{\stackon[4pt]{=}{$\scriptscriptstyle#1$}}{% $\scriptscriptstyle#2$}}}

\title{\textbf{Inverse function theorem}} \author{} \date{}

\begin{document}

\end{document}

enter image description here

RFZ
  • 333
  • Apparently you defined two environments to write theorems, and they use two different counters. But if you want anyone to be able to actually answer your question, you should provide a minimal working example: without seeing your code it is impossible to know how you defined your theorem environments. – Vincent Feb 19 '23 at 19:26
  • @Vincent, I uploaded my code also. Thank you! – RFZ Feb 19 '23 at 19:29

1 Answers1

3

In \newtheorem, you can specify a counter to follow in an optional argument between the two mandatory ones, so you can use that to make your environment theorem follow the counter of theo. Also, the starred version \newtheorem* produces unnumbered environments, so you can use that for corollaries.

\documentclass{article}
\usepackage[a4paper,text={16.5cm,25.2cm},centering]{geometry}
\usepackage{mdframed}
\usepackage{amsthm}

\newmdtheoremenv{theo}{Theorem} \newtheorem{remark}{Remark} \newtheorem{theorem}[theo]{Theorem} \newtheorem{corollary}{Corollary}

\parskip 1em

\begin{document}

\begin{theo} A framed theorem. \end{theo}

\begin{theorem} Another theorem. \end{theorem}

\begin{corollary} A corollary. \end{corollary}

\end{document}

As an unrelated side comment, I think you should consider learning better what is in your preamble if you don't really know what the packages are doing. Then you can clean up your preamble a little. For example:

  • You load both amsfonts and amssymb, but amssymb already loads amsfonts;
  • You load both amsmath and mathtools, but mathtools already loads amsmath, and you even load mathtools twice;
  • You explicitly load inputenc with option utf8 twice, but it is automatically loaded.
Vincent
  • 20,157
  • Thank you! It worked but may I ask you few questions: why \newtheorem{theorem}[theo]{Theorem} has 3 parenthesis but \newmdtheoremenv{theo}{Theorem} only? And what is meaning of each of these parenthesis? – RFZ Feb 19 '23 at 20:36
  • @ZFR The extra one is what I explained at the beginning of my answer: it's the optional argument which specifies a counter to follow. These three arguments of \newtheorem are respectively the name of the environment, a (optional) counter to follow, and the text written at the beginning of the environment. I think it's the same for \newmdtheoremenv, but I'm not sure (I usually work with tcolorbox rather than mdframed). If you want more information, you should read the documentations of amsthm and mdframed on CTAN. – Vincent Feb 19 '23 at 20:45
  • Thank you! I'll accept your answer! – RFZ Feb 19 '23 at 20:50