LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Numbering sections in Latex (https://www.linuxquestions.org/questions/programming-9/numbering-sections-in-latex-751145/)

jumanjininja 08-29-2009 03:57 PM

Numbering sections in Latex
 
Hi all..

I'm new to LATEX. I want to enter some theorems and corollaries in latex. I learned that it is possible to number them using this statement:

\newtheorem{theorem}{Theorem}[counter]

My question is that if I want to start the numbering the theorems from say 0.35 how will I set the counter to that value. I'm able to set and increment the counter values only by integers and not by float values.

Your help is highly appreciated. Thanks!!

jlinkels 08-30-2009 08:15 PM

You should not try to use a fractional, but keep the theorem counter as integer, and precede this counter with another value., like:

Code:

\newcounter{bar}
\newtheorem{law}{Law}[bar]
\begin{law}
It always seems to go wrong
\end{law}
\addtocounter{bar}{2}
\begin{law}
This one is right
\end{law}

Which produces:

Law 0.1 It always seems to go wrong
Law 2.2 This one is right


Alternatively, you can include the chapter or section number as part of you theorem counter:
Code:

\newtheorem{law}{Law}[chapter]
starts with Law 1.1.

See this page: http://www.personal.ceu.hu/tex/counters.htm on counters.

jlinkels

jumanjininja 09-01-2009 07:14 PM

Thanks for the reply. That was useful!

jlinkels 09-01-2009 07:42 PM

You are welcome and if you press the 'thumbs up' icon in the lower right hand corner of your post, my 'thanked' count increases by one. Thanks!

jlinkels


All times are GMT -5. The time now is 04:05 AM.