tags:

views:

49

answers:

1

I'm trying to get my latex sections to be labeled 1.0, 2.0 instead of 1, 2. Is there an easy way to do this or some way to define the specific numbers I want sections to be numbered?

EDIT: I have this basic outline:

\documentclass[12pt]{article}

\begin{document}

\section{first}

\subsection{second}

\end{document}

I currently see:

1 first

1.1 second

I would like:

1.0 first

1.1 second

+1  A: 

This should do the trick for you. Add the following lines to the preamble:

\renewcommand*\thesection{\arabic{section}.0}
\renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}

EDIT: Changed from document type book to document type article. i.e. chapter replaced with section and section replaced with subsection.

EDIT: Thanks for pointing out the \arabic command! I edited my answer accordingly.

froeschli
I added some sample code to my question. When I try this directly I get "! LaTeX Error: \thechapter undefined."If I change article to book I get "! TeX capacity exceeded, sorry [input stack size=5000].\thechapter ->\thechapter .0l.7 \section{first}"
cohensh
See the EDIT above.
froeschli
If I do that I still get what looks like infinite recursion. If I change it to this it works:\renewcommand*\thesection{\arabic{section}.0}\renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}I had to change subsection too because without the change it gave me 1.0.1 instead of 1.1. I assume I'd have to change subsubsection too. If you want to change your answer I'll accept it. Thanks.
cohensh
Thanks for pointing out that error of mine. I am pretty sure, you would have to redefine subsubsection as well, for it to adopt to this new numbering scheme.
froeschli