## Labelling whatever number you want to a Theorem in LaTeX

Forrest Sheng Bao http://fsbao.net

When you write a note, you wanna enjoy the environment, "Theorem", "Example", "Lemma", "Collary", etc. But you may facing the problem that the number of them are not the same as the ones in original text book, because the counters are changed. So what you do? Actually, you have a way to get what ever you want.

Most textbook, use this LaTeX code to control numeric labels and typesettings of "Theorems":
\newtheorem{theorem}{Theorem}[section]

Then you say, oh, no, I lost the control to the counter.

Some other books use this
\newenvironment{theorem}[1][Theorem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}

Then you say, oh, no, there is no numeric labels.

So what you do?

Just modify the later one.
• Set the number of parameters to 2.
• Typeset the second variable.
• In your content, assign value to the second variable
Like this
\newenvironment{theorem}[2][Theorem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2}]}{\end{trivlist}}

When you write content, use like this way
 \begin{theorem}{3.3}
\end{theorem}

Here, the first variable has been assigned a value "Theorem". If you leave it blank, then you can use it like this
 \begin{theorem}{whatever you wanna see}{3.3}
\end{theorem}

Then, you can see whatever you wanna see like:

Top 10 reasons why you should not study Computer Science
Reason 1
Reason 2