1

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?

athos
  • 807
  • 1
    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 04 '14 at 09:46
  • @egreg exactly! it's working now. -- any idea to turn off the italic font? – athos Jul 04 '14 at 10:17
  • 3
    Uncomment \usepackage{amsthm} and add \theoremstyle{definition} before the first \newtheorem command. But don't do it. – egreg Jul 04 '14 at 10:21
  • @egreg may i ask why? – athos Jul 05 '14 at 04:49
  • It's customary to set theorem statements in italics to make them more visible to the reader. – egreg Jul 05 '14 at 07:14
  • @egreg ah then I have no concern -- I'm writing a study notes for myself , so it's full of theorems , lemmas, and definitions. – athos Jul 05 '14 at 09:38
  • 2
    This question appears to be off-topic because it is about a problem simply due to spurious invisible characters in the input. – egreg Aug 02 '14 at 22:20

0 Answers0