5

how can I do to get the following numeration, e.g.: Theorem 1 , Corollary 1.1 I mean the number of the corollary connected with the number of the previous theorem?

2
  • Consider to add a Minimal Working Example!
    – skpblack
    Commented Jul 21, 2017 at 2:22
  • 1
    Could you perhaps consider accepting this nice answer? You can accept an answer by clicking on the check mark left of it.
    – user121799
    Commented Sep 25, 2018 at 4:44

1 Answer 1

16

With amsthm package

If Corollaries are listed after of Theorem (with other intermediate theorem) a solution, with the amsthm package can be

\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}{Corollary}[theorem] % Use theorem counter as `parent`
\begin{document}
\noindent Now
\begin{theorem}
    First theorem
\end{theorem}
\begin{corollary}
    This is a corollary
\end{corollary}
\begin{corollary}
    This is a other corollary
\end{corollary}
\begin{theorem}
    Second theorem
\end{theorem}
\begin{corollary}
    This is a corollary
\end{corollary}
\end{document}

enter image description here

An approach with tcolorbox package.

If you like theorems in colored boxes, you can try with the package tcolorbox.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tcolorbox}
\tcbuselibrary{breakable,theorems,skins}
%-----------------------------------------------
% Theorem environments definitions
\newcounter{theo} % Extern counter for theorems
\newtcbtheorem%[]% init options
{theorem}% name environment
{Theorem}% Title
{enhanced,before title={\stepcounter{theo}},colback=blue!10,colframe=blue!35!black,fonttitle=\bfseries,%
attach boxed title to top left={xshift=5mm,yshift*=-\tcboxedtitleheight/2},%
boxed title style={colback=blue!35!black}}% options
{th}% label prefix

\newtcbtheorem[number within=theo]% init options
{corollary}% name environment
{Corollary}% Title
{enhanced,colback=green!10,colframe=green,fonttitle=\bfseries,colbacktitle=green!10,coltitle=black,%
attach boxed title to top left={xshift=5mm,yshift*=-\tcboxedtitleheight/2},%
boxed title style={boxrule=0.6pt}}% options
{co}% label prefix
%------------------------------------------------
\begin{document}
\section{Any theorems}
\noindent Now
\begin{theorem}{}{first}
    First theorem
\end{theorem}
\begin{corollary}{}{}
    This is a corollary
\end{corollary}
\begin{corollary}{}{}
    This is a other corollary to the Theorem \ref{th:first} ...
\end{corollary}
\begin{theorem}{Pythagorean theorem}{t2}
    For a \textit{right} triangle with \textbf{legs} $a$ and $b$ and \textbf{hypotenuse} $c$,
    \[a^2+b^2=c^2.\]
\end{theorem}
\begin{corollary}{}{c1}
    This is a corollary
\end{corollary}
A reference to Corollary \ref{co:c1} of the Theorem \ref{th:t2}.
\end{document}

enter image description here

3
  • Here is the importance of publishing a Minimal Working Example, that contents the packages need for the main commands.
    – skpblack
    Commented Jul 21, 2017 at 2:16
  • @GonzaloGalvánFirpo By your comment I imagine that you like colored boxes, then i did an edit using tcolorbox package.
    – skpblack
    Commented Jul 21, 2017 at 6:39
  • Is Corollary always a child to Theorem? Do academics ever let it stand on its own, or make it a child of something else like Proposition, for example?
    – develarist
    Commented Jan 6, 2021 at 6:53

You must log in to answer this question.

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