8

I want to write a LaTeX code to show,

Lemma 1 : x+y=z
Lemma 1.1:  z-r+t=3
Lemma 1.2:   q=r

How do I do that?

4

Using amsthm package

Update: per Gonzalo Medina's suggestion, using the following definition which make the sublemma counter subsidiary to the lemma counter:

\newtheorem{lemma}{Lemma}
\newtheorem{sublemma}{Lemma}[lemma]

such that the following code:

\begin{lemma}
x+y=z
\end{lemma}
\begin{sublemma}
z-r+t=3
\end{sublemma}
\begin{sublemma}
q=r
\end{sublemma}

\begin{lemma}
x+y=z
\end{lemma}
\begin{sublemma}
z-r+t=3
\end{sublemma}
\begin{sublemma}
q=r
\end{sublemma}

will give you:

enter image description here

EDIT: If you want to number your theorem with correspondence to the section it belongs to, use these definition instead:

\newtheorem{lemma}{Lemma}
\newtheorem{sublemma}{Lemma}[section]

Then check out the example:

\section{Math}
\begin{document}
\begin{lemma}
x+y=z
\end{lemma}
\begin{sublemma}
z-r+t=3
\end{sublemma}
\begin{sublemma}
q=r
\end{sublemma}

\section{More Math}
\begin{lemma}
x+y=z
\end{lemma}
\begin{sublemma}
z-r+t=3
\end{sublemma}
\begin{sublemma}
q=r
\end{sublemma}

which gives you:

enter image description here

  • Isn't it \newtheorem{lemma}{Lemma}\newtheorem{sublemma}{Lemma}[lemma] a better option? – Gonzalo Medina Jul 31 '13 at 3:41
  • @GonzaloMedina: Not if the author is not dividing his article into different sections. But you are right, I should've mentioned it. – Francis Jul 31 '13 at 3:45
  • What do sections have to do with my suggestion? I suggested making the sublemma counter subsidiary to the lemma counter (independently of sectional unit counter which can be taken into account when defining lemma, if necessary), which seems to be what the OP wants. – Gonzalo Medina Jul 31 '13 at 3:52
  • @GonzaloMedina: I misunderstood it, it is a better method :) – Francis Jul 31 '13 at 3:55
  • What if we wanted to not number the lemma, if we are only using one? – Ahaan S. Rungta Nov 15 '13 at 15:35
7

Once yoy have defined your structure for lemmas using, for example

\newtheorem{lemm}{Lemma}

you can define a new structure slemm and make the counter for this new structure subsidiary to the lemm counter using the second optional argument for \newtheorem:

\newtheorem{slemm}{Lemma}[lemm]

A complete example:

\documentclass{article}
\usepackage{amsthm}

\newtheorem{lemm}{Lemma}
\newtheorem{slemm}{Lemma}[lemm]

\begin{document}

\begin{lemm}
test
\end{lemm}
\begin{slemm}
test
\end{slemm}
\begin{slemm}
test
\end{slemm}
\begin{lemm}
test
\end{lemm}
\begin{slemm}
test
\end{slemm}
\begin{slemm}
test
\end{slemm}

\end{document}

enter image description here

For clarity sake, I would give another name to the subsidiary structure:

\documentclass{article}
\usepackage{amsthm}

\newtheorem{lemm}{Lemma}
\newtheorem{slemm}{Sublemma}[lemm]

\begin{document}

\begin{lemm}
test
\end{lemm}
\begin{slemm}
test
\end{slemm}
\begin{slemm}
test
\end{slemm}
\begin{lemm}
test
\end{lemm}
\begin{slemm}
test
\end{slemm}
\begin{slemm}
test
\end{slemm}

\end{document}

enter image description here

2

Is this what you are looking for?

\documentclass{article}
\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\begin{document}
\section{One}
\begin{lem}
  one
\end{lem}
\begin{lem}
  one.two
\end{lem}
\section{Two}
\begin{lem}
  two
\end{lem}
\end{document}

enter image description here

  • I don't want to see the section number. I want to see without section number, just a increment – Norman Jul 31 '13 at 3:46
  • @Francis I don't want to see the section number, when I do like urs It will appear like this Lemma 7. x+y=z and Lemma 1.2 r=q, 1.2 is the section number. I don't want to show that. It should be Lemma 7.1 not with the section number – Norman Jul 31 '13 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.