# New theorem environment with manual theorem number

Quite easy! `;-)`

^{1}

```
\documentclass{article}
\usepackage{amsthm}
\newtheorem{manualtheoreminner}{Theorem}
\newenvironment{manualtheorem}[1]{%
\renewcommand\themanualtheoreminner{#1}%
\manualtheoreminner
}{\endmanualtheoreminner}
\begin{document}
\begin{manualtheorem}{2.3'}[title]\label{foo}
This is a theorem.
\end{manualtheorem}
\begin{manualtheorem}{A}[title]\label{baz}
This is a theorem.
\end{manualtheorem}
Here is \ref{foo} and \ref{baz}.
\end{document}
```

^{1} *Been there, done that.*

First of all, you can't define a theorem-like environment `newtheorem`

as there is alredy the `\newtheorem`

macro that defines those environments simply due to the name clash. Assume we have an environment `theorem`

. Then you can locally change `\thetheorem`

:

```
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begingroup
\renewcommand\thetheorem{2.3'}
\begin{theorem}[title]
This is a theorem.
\end{theorem}
\endgroup
\end{document}
```

When wrapping this into an own environment you don't need to group explicitly as the `\begin`

and `\end`

definitions take care of this:

```
\newenvironment{Apollo13theorem}[1]{%
\renewcommand\thetheorem{#1}
\theorem
}{\endtheorem}
```

The custom environment would then be used as requested by the OP:

```
\begin{Apollo13theorem}{A}[title]
This is a theorem.
\end{Apollo13theorem}
```