0

In a book that I'm translating, there is a special kind of title that has the font size in between of that of \section and \subsection. This kind of title is never numbered, and is used for dividing a long section into different parts and providing description to each one.

At first I defined the unnumbered \section* to look like this. However, later I noticed that there is a interlude chapter in which everything is unnumbered and thus I have to reserve this \section* for unnumbered normal sections.

Currently I don't have any better idea than defining a new command, possibly with the name \sectionsub, that looks like the following:

\RequirePackage { relsize }
\NewDocumentCommand \sectionsub { m }
  {
    \medskip
    \group_begin:
    \noindent
    \relscale { 1.08 }
    \scshape
    #1
    \group_end:
    \par \smallskip
  }

However, this looks quite inelegant and unreliable to me. For example, I cannot set the spacing around it with \titlespacing from titlesec, which seems to me is better than using \medskip and \smallskip. Also, the use of \par here makes its behavior depend on the \parskip.

Do you have experience on dealing with this kind of title? And if I have to define new command for it, how can I reliably define it in the fashion of the usual \section, and maybe can hopefully compatible with tools like titlesec?

I'm using book as the base class.

Jinwen
  • 8,518
  • What about defining subsection to be level 3, then define the "intermediate" one to be unnumbered level 2? – user202729 Jul 04 '22 at 11:48
  • @user202729 It's just too weird to have \section to be numbered as 1.1 while \subsubsection as 1.1.1, and I shall have to enable \subsubsubsection for 1.1.1.1. Also, there would have to be too many modifications to the current document class, the style defined with \titleformat, the table of contents, and even the numbering of theorems... It would be much easier to simply define this as an extra sectional command. – Jinwen Jul 04 '22 at 12:05

1 Answers1

1

With \titleclass (package titlesec) is it possible to insert the new level \sectionsub between \chapter an \section.

\titleclass{⟨name⟩}{⟨class⟩}[⟨super-level-cmd⟩]

The "class" straight is intended for titles in the middle of text.

Here the title format for \sectionsub was defined without a number.

a

\documentclass[11pt,a4paper]{book}

\usepackage{kantlipsum}% dummy text

\usepackage{titlesec}

\titleclass{\sectionsub}{straight}[\chapter] % added <<<<<<<<<< \newcounter{sectionsub}% not used, just in case it is needed

\titleformat{\sectionsub}{\normalfont\normalsize\bfseries}{}{0em}{} \titlespacing*{\sectionsub}{0pt}{2.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\setcounter{secnumdepth}{3} % test numbered subsections

\begin{document}

\chapter{ONE}

  1. \kant[1]

\sectionsub{Sec--Sub One} 2. \kant[2]

\section{Sec TWO}

  1. \kant[3]

\sectionsub{Sec--Sub Two}

  1. \kant[4]

\subsection {Sub Sec One}

  1. \kant[5]

\end{document}

Simon Dispa
  • 39,141
  • Thank you! Actually I've tried this approach a few hours before, but are facing some difficulties. Would you mind take a look at https://tex.stackexchange.com/q/649841? – Jinwen Jul 04 '22 at 19:38