# Numbering theorem and corollary

how can I do to get the following numeration, eg: Theorem 1 , Corollary 1.1 I mean the number of the corollary conected with the number of the previous theorem?

Thx

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

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


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


• Here is the importance of publishing a Minimal Working Example, that contents the packages need for the main commands. – skpblack Jul 21 '17 at 2:16
• @GonzaloGalvánFirpo By your comment I imagine that you like colored boxes, then i did an edit using tcolorbox package. – skpblack Jul 21 '17 at 6:39