44

I wonder is there any way to change the format of section numbering from 1.1 to 1.1. ? I know this is trivial, but I really need to add one more dot after the section number. Does anybody know how to do that?

Thanks a lot

2
  • 2
    The KOMA-Script classes have an option for this, if you’re using on of them consider the manual …
    – Tobi
    Jul 29, 2011 at 19:22
  • 2
    Please see the right side, you can find more. It is one of them: How to change section numbering Jul 29, 2011 at 19:27

5 Answers 5

44

You can do this simply with the titlesec package:

\usepackage{titlesec}
\titlelabel{\thetitle.\quad}
0
38

It depends on what you wish precisely. If you want that in all places the section number appears as "1.1.", also in cross references, the question is settled quite easily:

\renewcommand{\thechapter}{\arabic{chapter}.}
\renewcommand{\thesection}{\thechapter\arabic{section}.}

(in this case you would also change chapter numbers, for uniformity).

If you want only the number in the section title to be followed by a period, then you can follow Alan's good suggestion or delve into the internals (see the FAQ entry for more information):

\makeatletter
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}
\makeatother

This will change the format of all the sectional units also below \section. You might prefer the titlesec way to get more control on the appearance of the section headings.

2
  • 1
    This is more compatible with microtype than titlesc. Which is to say, I've got a fix for this version, but not if titlesec is used.
    – cfr
    Nov 19, 2015 at 23:47
  • Perhaps a show of a redefinition to \numberline - for adding dots to the ToC - might help here as well.
    – Werner
    Oct 11, 2016 at 15:21
17

If you use Komascript you may use the option numbers=endperiod.

Example:

\documentclass[11pt,english,numbers=endperiod]{scrartcl}
\usepackage{babel}
\usepackage{blindtext}

\begin{document}
\tableofcontents
\blinddocument
\end{document}
2
  • Thanks for adding an example corresponding to my above comment!
    – Tobi
    Jul 29, 2011 at 21:59
  • After posting my answer I detected your comment - I needed some time to verify my knowledge ;)
    – knut
    Jul 30, 2011 at 18:24
13

You can use the secdot package:

\documentclass{report}
\usepackage{secdot}
\begin{document}
\chapter{Chapter}
\section{Section}
\end{document}
9

Here's a solution that uses the low-level LaTeX macro called \@seccntformat. The main difference to egreg's answer is that it allows individual control over the formatting of the numbers associated with section, subsection, subsubsection, paragraph, and subparagraph headers. In the following example, section- and subsection-level numbers get a dot appended, whereas subsubsection-level numbers and beyond do not.

enter image description here

\documentclass{article}

% Method proposed in "The LaTeX Companion", 2nd ed.:
\makeatletter
\def\@seccntformat#1{\@ifundefined{#1@cntformat}%
   {\csname the#1\endcsname\space}%    default
   {\csname #1@cntformat\endcsname}}%  enable individual control
\newcommand\section@cntformat{\thesection.\space}       % section-level
\newcommand\subsection@cntformat{\thesubsection.\space} % subsection-level
\makeatother

\usepackage[colorlinks]{hyperref} % just for this example
\usepackage{cleveref}             % just for this example

\begin{document}
\section{First section} \label{sec:uno}
\subsection{First subsection} \label{sec:uno_uno}

Cross-references to \cref{sec:uno,sec:uno_uno} now look good.
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .