% Define section numbers with dots % % Author: Robin Fairbairns % first version, June 2000 % % version 1.0, July 2000, with a contribution from % Steve Grathwohl of Duke University % % Version 1.1 May 2026 some support for section templates % LaTeX Team. % Version 1.2 May 2026 Correct malformed date. % LaTeX Team. % % This program may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.1 % of this license or (at your option) any later version. % The latest version of this license is in % http://www.latex-project.org/lppl.txt % and version 1.1 or later is part of all distributions of LaTeX % version 1999/06/01 or later. % % This program consists of the file secdot.sty % documentation (such as it is) may be found after \endinput herein \NeedsTeXFormat{LaTeX2e}% \ProvidesPackage{secdot}[2026-05-16 v1.2 section numbers with dots] % command to declare a particular section level to have a dot after % its number \newcommand\sectiondot[1]{% \expandafter\def\csname @seccntfmt@#1\endcsname##1{% \csname the##1\endcsname.\quad } } % do this by default for \section numbering \sectiondot{section} % generalised version: define that #2 comes after section level #1 \newcommand\sectionpunct[2]{% \expandafter\def\csname @seccntfmt@#1\endcsname##1{% \csname the##1\endcsname#2% }% } % the guts of the package: insert the dots where needed ... \renewcommand\@seccntformat[1]{\@ifundefined{@seccntfmt@#1}% {\csname the#1\endcsname\quad}% original default style {\csname @seccntfmt@#1\endcsname{#1}}% } % Minimal support for section heading instances if \DocumentMetadat % is used \ifdefined\IfInstanceExistsT \IfInstanceExistsT{headformat}{section}{% \EditInstance{heading}{section}{number-format=\@seccntformat{section}} \EditInstance{heading}{subsection}{number-format=\@seccntformat{subsection}} \EditInstance{heading}{subsubsection}{number-format=\@seccntformat{subsubsection}} \EditInstance{heading}{paragraph}{number-format=\@seccntformat{paragraph}} \EditInstance{heading}{subparagraph}{number-format=\@seccntformat{subparagraph}} \EditInstance{headformat}{paragraph}{number-title-sep=0pt} \EditInstance{headformat}{subparagraph}{number-title-sep=0pt} \EditInstance{headformat}{section}{number-title-sep=0pt} \EditInstance{headformat}{subsection}{number-title-sep=0pt} \EditInstance{headformat}{subsubsection}{number-title-sep=0pt} } \fi \endinput secdot.sty: section numbers with dots ===================================== The package as loaded causes section numbers to be output with a dot after them. The command \sectiondot{} will make `level' sections also be output with a dot after them -- an example of use would be: \sectiondot{subsection} The command \sectionpunct{}{} gives finer control. examples of use would be \sectionpunct{section}{. } % \sectiondot places a \quad after the % dot, which may look excessive \sectionpunct{section}{\quad} % restores default latex behaviour Other eccentricities of numbering could be coded by those with stronger stomachs, by defining the appropriate \csname @seccntfmt@\endcsname which macro will take one argument, when invoked: the `level' name If \DocumentDocumentMetadata is used, section headings are implemented via LaTeX templates which offer much more flexible customisation, and this package is not recommended for new documents. However, a basic set of \EditInstance declarations are included in this package so that the basic functionality still works in combination with \DocumentDocumentMetadata.