# Custom theorem numbering … and extend to lemma etc [closed]

In Custom theorem numbering @egreg provided a way to custome theorem numbering:

\documentclass{article}
%\usepackage{amsthm} %% uncomment to see the difference
\newtheorem{innercustomthm}{Theorem}
\newenvironment{customthm}[1]
{\renewcommand\theinnercustomthm{#1}\innercustomthm}
{\endinnercustomthm}

\begin{document}

\begin{customthm}{8}[Somebody]\label{eight}
Every theorem must be numbered by hand.
\end{customthm}

Here is a reference to theorem~\ref{eight}.
\end{document}


Now I tend to extend such approach to Lemma, Definition, Corollary etc. However I got an error extending to Lemma.

I put in

\newtheorem{innercustomlemma}{Lemma}
\newenvironment{customlemma}[1]
{\renewcommand\theinnercustomlemma{#1}\innercust‌​omlemma}
{\endinnercustomlemma}


at the beginning then

\begin{customlemma}{abc}[abcd]\label{abcde}
abcdef
\end{customthm}


at the body. The error says:

! Undefined control sequence. \customlemma ...heinnercustomlemma {#1}\innercust
omlemma
l.126 \begin{customlemma}{abc}
[abcd]\label{abcde} ?


I wonder what shall I do?

Also, the font inside theorem is italic by default, I wonder if this could be tuned off?

## closed as off-topic by egreg, Joseph Wright♦Aug 2 '14 at 22:21

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• You have two spurious characters in \innercustomlemma; you can see in the question that \innercust is rendered in brown color, while omlemma is black. Retype it. – egreg Jul 4 '14 at 9:46
• @egreg exactly! it's working now. -- any idea to turn off the italic font? – athos Jul 4 '14 at 10:17
• Uncomment \usepackage{amsthm} and add \theoremstyle{definition} before the first \newtheorem command. But don't do it. – egreg Jul 4 '14 at 10:21
• @egreg may i ask why? – athos Jul 5 '14 at 4:49
• This question appears to be off-topic because it is about a problem simply due to spurious invisible characters in the input. – egreg Aug 2 '14 at 22:20