Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including a decimal in a Latex section number

Tags:

latex

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

like image 841
cohensh Avatar asked Sep 20 '10 02:09

cohensh


1 Answers

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.

like image 136
froeschli Avatar answered Sep 18 '22 07:09

froeschli