I'm in the process of transcribing an old French engineering text (circa 1890) that uses a somewhat non-standard section numbering. As I am attempting to make a more-or-less verbatim copy, it is important to me that I keep the structure of the new document the same as the original.
The general section numbering uses a numeric sequence (1, 2, 3, etc.). However, there are some sections that were inserted last-minute prior to printing, so the typesetter at the time (I assume) used the Latin suffixes "bis" and "ter" for inserting the new sections (1 bis, 1 ter, etc.) in lieu of renumbering the entire text. Please note that the suffixes are also in italics.
I've found Questions where the user asked about adding alpha characters to the end of numeric section numbers, but this isn't quite applicable.
Since the section numbering is pretty much set, I could manually adjust the few sections where this is needed. However, I would like to learn the TeX workaround for future reference and to get to know the program better.
Please see the MWE below for an example of my code that uses manual section numbering. This gives the desired result but does not have the automatic section numbering which is a major feature of TeX. I'd like to duplicate this result using some sort of automatic sectioning scheme.
\documentclass{book}
\usepackage{titlesec}
\titleformat{\section}[block]{\normalfont\large\normalfont\filcenter}{\thesection. ---}{0.5em}{}
\renewcommand\thesection{\arabic{section}}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\section{First Section Header}
\lipsum[1]
\section{Second Section Header}
\lipsum[2]
\section*{2 \textit{bis}. --- Third Section Header}\addcontentsline{toc}{section}{2 \textit{bis} Third Section Header}
\lipsum[3]
\section{Fourth Section Header}
\lipsum[4]
\end{document}
Rendering below.
Best Answer
Original solution Here is a solution using
enumitem
andenumerate
environments.Not sure wether it's really what you asked for, since you mentioned a numbering of sections.
However, with this solution, all your regularly numbered items must be in a (first level)
enumerate
environment, and when you need bis, ter, etc, then you can use a nestedenumerate
environment. Keep in mind that the first\item
of this environment will be numbered bis, the second will be numbered ter, etcWhich produces this kind of results :
Maybe, another option to avoid conflicts with other nested
enumerate
environments would be to create abis
environment this way :This produces the exact same result than the previous code.
Note that if you have 10 or more items in the
bis
environment, then the numbering will fail (essentially because I have no idea of what follows decies). But I hope your original text does not need to go that far ;-) (however, it seems that certain french laws use decies, and maybe the few next ones...)Edit : solution working with
\section
Here is a solution using
\section
and\section*
. Caution : by redefining these two commands, you will not be able to use them for anything else in the rest of your document (I think you were aware of this, but just in case, now it's clear).The idea here is to use
\section{}
to begin a regularly numbered section, and\section*{}
for a bis numbered section.If the formatting is not exactly the one you wanted, you can change the parameters of
\titleformat
and\titlespacing
(for example, changing\normalfont
to\bfseries
will produce bolded numbers).Update : with the table of contents Here is a last update with the
\section*
appearing in the table of contents (and this time usingbook
document class as you wanted and with the title formatting you were using in your MWE).The space between the numbers and the section titles in ToC is now automatically computed so that it is enough to display the longest "bis number" (i.e. the space will be smaller if you just have to print bis or ter than if you need to print quiquies). You can enlarge or reduce this space by changing the value currently set to
1.5em
.