TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In between two sections that really ought to be numbered 23 and 24, I want to add another section, which I would like to call 23.5. The code \setcounter{section}{23.5} \section{...}, however, results in a section labeled 24 with a .5 floating over the top of it. Is there a way around this?

share|improve this question
Counters only accept natural numbers. Also, how would a reader distinguish between the fifth subsection of section 23 and section 23.5? – Caramdir Jan 8 '11 at 2:55
@Caramdir: That isn't quite true. Counters are simply a thin wrapper around a TeX count register. I.e., the counter foo is just a count register \c@foo defined by a \countdef. As such, it can be any integer in the range allowed by count registers. – TH. Jan 8 '11 at 8:22
up vote 5 down vote accepted

A section between 23 and 24 seems to belong to 23 as well. Consider to use a main section 23 and split it into two subsections 23.1 and 23.2.

It would also be possible to write the section 23, then add a subsection 5 (\addtocounter{subsection}{4}\subsection{...}). Its number would be 23.5 then. If you wish, you could let a subsection appear like a section, just clone your titlesec commands.

share|improve this answer

Here's a hacky way:

\section{Title of Half section}
\renewcommand{\thesection}{\arabic{section}} % back to regular numbering

(But as Caramdir points out, this isn't really a great idea.)

share|improve this answer
What about replacing .5 by $\frac{1}{2}$ in your code? – Bruno Le Floch Jan 8 '11 at 5:16
@Bruno: well it would certainly solve Caramdir's problem. But it sure does look weird, especially when you add a subsection :-). – Alan Munn Jan 8 '11 at 5:43

The idea to do what you want is what Alan proposed, but if you want it to work properly with hyperref, you need to be a little more careful to avoid warnings like

pdfTeX warning
(ext4): destination with the same identifier (name{section.23}) has been already
used, duplicate ignored

which make hyperlinks to your half section point to the wrong place. To avoid this, you can define a master counter for sections and increment it just before the half section. Here's a full code showing how it works:


\usepackage{hyperref}% must be before the definition of the mastercounter

% Master counter for sections
\@addtoreset{section}{mastersection}% section depends on mastersection

  % we save the old section number and substract one (\section does +1)
  % we increment the master counter
  % we set the section counter to the saved value

\setcounter{section}{22}% for the numbers to start at 22 in this example



\section{Title of section}

\section{Title of Half section}\label{half.section}

\subsection{Title of subsection}

\subsection{Title of subsection}

\section{Title of section}



Instead of 23.5 or 23½, I've used 23’ which you see from times to times in some math books for theorem variants. If you don't like that, you can of course change it.

share|improve this answer
I must say I think that 23½ looks great. – Hendrik Vogt Jan 8 '11 at 13:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.