I am writing my notes of class in latex, and I would like to get the following result:
1. Algorithm (this is a section)
1.1 Newton's Method (this is a subsection of Method)
...
1.1 Example (this is a subsection of Example)
...
1.2 Example (another subsection of Example)
1.2 Lagrange Method (this is a subsection of Method)
Basically it is to have different counters depending whether you are making a reference to a Method or an Example. So maybe the numbers are repeated but they are referring to different contents.
Thank you.
Page Layout ⇒ Problems with the numbering of subsections
NEW: TikZ book now 40% off at Amazon.com for a short time.
Problems with the numbering of subsections
I finally found what I wanted, it is:
\newcounter{section_examples} % add a new counter
\newcounter{subsection_examples}[section_examples]
\stepcounter{section_examples} % increase the counter
\stepcounter{subsection_examples}
\subsection*{Example \arabic{section_examples}.\arabic{subsection_examples}}
The example 1.1
...
\stepcounter{subsection_examples}
\subsection*{Example \arabic{section_examples}.\arabic{subsection_examples}}
The example 1.2
If you do it in this way, you will always be able to handle your own counter.
I think it is pretty and elegant.
If someone find another way to do it, just post it, ^-^.
See you
\newcounter{section_examples} % add a new counter
\newcounter{subsection_examples}[section_examples]
\stepcounter{section_examples} % increase the counter
\stepcounter{subsection_examples}
\subsection*{Example \arabic{section_examples}.\arabic{subsection_examples}}
The example 1.1
...
\stepcounter{subsection_examples}
\subsection*{Example \arabic{section_examples}.\arabic{subsection_examples}}
The example 1.2
If you do it in this way, you will always be able to handle your own counter.
I think it is pretty and elegant.
If someone find another way to do it, just post it, ^-^.
See you