1

I am working on a legal document with KOMA Script and I need to create a higher order header to chapter that instead of "Chapter" says "Title" but without numbering, because that numbering will go in ordinal and with word and not number, i. e."First Title","Second Title", etc... In addition, some of these "titles" will have a name, which should be an optional argument, for example "Fourth title: of the standing committee".

I know titlesec exists and it's an excellent package for cases like this, but since I'm using KOMA Script, I'm pretty sure there is an alternative way to do it within KOMA Script, but I don't know which one. Any clues?

An MWE attempt, for now, may be the following:

 \documentclass[fontsize=12pt,paper=letter,headings=small,DIV=calc,headsepline=true,titlepage=on,BCOR=5mm,parskip=half*]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
\part[First Title]{First title: the title of this first title}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}

Update

In response to the request to show the structure of the document (Constitution) I am working on, I add an image of one of the most representative pages.

Representative page of the Constitution

The part with which I have a problem is the one I've already mentioned. I do not know if it is a problem unique to my country, legal documents in my language, or a common feature of legal documents in the world, but I have the impression that it is documents with a rather irregular structure that solves certain needs of different (and divergent) forms in the same document.

In this case, I have constitutional articles divided into paragraphs, others into fractions (more often than not) with different enumeration sequences, and other times in addition to fractions, there are another kind of sections over the fractions.


My interest is not to correct or standardize all these inconsistencies, but to put them in writing and to show the changes (which are very many) in a chronological way that have occurred in the drafting of the Constitution during the century that is in force.

  • 2
    A MWE is always great and helpful. As for what you want: Do you need something like a \part that instead of part is labeled with title? How about toc entries, running headers etc.? – TeXnician Dec 28 '17 at 18:46
  • 1
    Take a look in the documentation and there search for the command \DeclareSectionCommand. – Skillmon Dec 28 '17 at 19:14
  • 1
    BTW, chapter is 0, part is -1 (default). – John Kormylo Dec 28 '17 at 20:46
  • 1
    @Aradnix in this case, redefine the \parts to be your titles (\RedeclareSectionCommand to change formatting), use \chapter and \section as they are, redefine \subsection to be your articles and \subsubsection to be your fractions. This setup should do. – Skillmon Dec 30 '17 at 10:29
  • 1
    Please provide more details, edit your question. Maybe upload a copy of a page of the constitution. Is it supposed to be »1 First Title« or »First Title: ...«, do you need sectionnames, e.g. »section 1: sectiontitle«. – Keks Dose Dec 30 '17 at 10:37
3

I would just redefine \part to produce a heading in chapter style without prefix line and change the output of counter part, e.g.

\documentclass[fontsize=12pt,paper=letter,headings=small,DIV=calc,headsepline=true,titlepage=on,BCOR=5mm,parskip=half*]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand*{\OrdWord}[1]{%
  \ifcase#1 0\or First\or Second\or Third\or Forth\else to large\fi
}
\renewcommand*{\thepart}{\OrdWord{\value{part}}}
\renewcommand*{\partformat}{\thepart~Title}
\renewcommand*{\addparttocentry}[2]{%
  \IfArgIsEmpty{#1}{%
    \addtocentrydefault{part}{}{#2}%
  }{%
    \addtocentrydefault{part}{#1~Titel}{}%
  }%
}
\RedeclareSectionCommand[style=chapter]{part}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\part{: the title of this first title}

\lipsum
\part{~}
\lipsum

\end{document}

You have to use \part{~} instead of \part{} for a part without additional title, because \part{} won't produce any entry in the table of contents. Please extend \OrdWord as you need it.

If the chapter counter should be related to the increase of the part counter you can add

\RedeclareSectionCommand[counterwithin=part]{chapter}

As an alternative you can define a new command:

\documentclass[fontsize=12pt,paper=letter,headings=small,DIV=calc,headsepline=true,titlepage=on,BCOR=5mm,parskip=half*]{scrbook}[2017/12/04]
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand*{\OrdWord}[1]{%
  \ifcase#1 0\or First\or Second\or Third\or Forth\else to large\fi
}
\DeclareSectionCommand[style=chapter,level=-1,tocstyle=chapter,tocindent=0pt,tocnumwidth=6em]{Title}
\RedeclareSectionCommand[counterwithin=Title]{chapter}
\renewcommand*{\thechapter}{\arabic{chapter}}
\RedeclareSectionCommand[level=-2,toclevel=-2]{part}
\renewcommand*{\theTitle}{\OrdWord{\value{Title}}}
\renewcommand*{\Titleformat}{\theTitle~Title}
\renewcommand*{\addTitletocentry}[2]{%
  \IfArgIsEmpty{#1}{%
    \addtocentrydefault{Title}{}{#2}%
  }{%
    \addtocentrydefault{Title}{#1~Titel}{}%
  }%
}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\Title{: the title of this first title}

\lipsum
\chapter{First Test Chapter in First Title}
\lipsum
\Title{~}
\lipsum
\chapter{First Test Chapter in Second Title}
\lipsum

\end{document}

Output of the second example (first is similar):

Table of Contents First Title Second Title

Please note, that you need an up-to-date KOMA-Script for the second example. You can do the same with KOMA-Script 3.22 or 3.23 but need to set additional options at the declaration of the \Title command, e.g.:

\DeclareSectionCommand[style=chapter,level=-1,pagestyle=plain,beforeskip=2em,innerskip=0pt,afterskip=1em,font=\huge,prefixfont=\huge,tocstyle=chapter,tocindent=0pt,tocnumwidth=6em]{Title}
  • Thanks for this great answer. I've got KOMA-Script 3.24 installed. I need to improve the appearance of the title so that when it has a name, it appears in the bottom line, otherwise it looks bad. I also have to see how to add that name to the table of contents. – Aradnix Jan 4 '18 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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