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?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityUsing 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:
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:
\newtheorem{lemma}{Lemma}\newtheorem{sublemma}{Lemma}[lemma]
a better option?
Jul 31, 2013 at 3:41
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.
Jul 31, 2013 at 3:52
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}
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}
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}