Include decimal in latex section number

I am trying to have my latex sections labeled 1.0, 2.0 instead of 1, 2. Is there an easy way to do this or to somehow determine the specific numbers that I want the numbers to be numbered?

EDIT: I have this basic plan:

\documentclass[12pt]{article}

\begin{document}

\section{first}

\subsection{second}

\end{document}

Currently I see:

1 first

1.1 seconds

I would like to:

1.0 first

1.1 seconds

+3
source share
1 answer

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 article type document. those. chapter replaced by section and section replaced by unit.

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

+5
source

Source: https://habr.com/ru/post/1765554/


All Articles