Document Classes ⇒ Chapter Numbering in customized Document Classs
Chapter Numbering in customized Document Classs
I usually try to solve my coding problems by googling and reading... but I am super desperate right now. I am writing my master thesis using a template provided by my university.
The template uses a custom document class that claims to be based on scrreprt.
My problem is that while thie TOC has all the numbering for chapters, sections subsectios and so on these numbers are omitted in the actual document!
TOC:
1. Chapter Title
1.1 Section Title
1.1.1 Subsection Title
Document:
Chapter 1
Chapter Title
"...foo"
Section Title
"...bar"
What I would like to have is that the numbers... at least those of sections and below show up in the document:
Chapter 1
Chapter Title
"...foo"
1.1 Section Title
"...bar"
As far as I understand it this is the default behaviour of the scrrprt class so apparently the person who created the custom class has changed it.
I have spend the last two days on google trying to find how to fix this but have been unsuccessful!
I have attached the class and the tech root file....
Can somebody help me?
- Attachments
-
- thesis.tex
- (2.68 KiB) Downloaded 395 times
-
- kn-thesis.cls.tex
- (182 Bytes) Downloaded 375 times
-
- kn-thesis.cls
- (27.3 KiB) Downloaded 417 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Posts: 707
- Joined: Tue Mar 25, 2008 5:02 pm
Chapter Numbering in customized Document Classs

\@chapter
and \@makechapterhead
(and/or \chapter
or even \@schapter
and \@makeschapterhead
) and copy the definition(s) into your .tex file. You will likely need to surround them with \makeatletter
...\makeatother
.Chapter Numbering in customized Document Classs
but how do I find that class?
I have been looking at the documentation thingy... and done a google search but I cannot find anything useful...
What exactly am I looking for? The only thing name scrreprt links to a page telling me to have a look at the KOMA-Script documentation...
That's not what I want... or is it?
And wouldn't a class that loads another class need to actively change the behaviour of that loaded class?
I am very confused... and starting to think I have no idea how the whole thing is actually supposed to work

- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Chapter Numbering in customized Document Classs
The class does not define \@makechapterhead. It has a much more complex implementation of sectioning comands.
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Chapter Numbering in customized Document Classs
\section
, \section*
, \addsec,
or any other command? \textbf
and \addcontentsline
or \addtocontents
?When I do it with that class and your document, with the code that you posted above, it works fine. I simply inserted:
Code: Select all
\chapter{Einleitung}\section{Erster Abschnitt}\subsection{Erster Unter-Abschnitt}
Numbering is fine. You may do something different that we don't know yet.
Stefan
Chapter Numbering in customized Document Classs
That is exactly what I did. And your result is exactly what I would like to get...Stefan Kottwitz wrote: When I do it with that class and your document, with the code that you posted above, it works fine. I simply inserted:Code: Select all
Code, edit and compile here:\chapter{Einleitung}\section{Erster Abschnitt}\subsection{Erster Unter-Abschnitt}
So when it worked for you I got suspicious.
I am usually using my laptop running Linux (Kubuntu 16.04). The LaTeX-editor I am using is Kile version 2.1 and pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian).
I tried it on another PC running windows 8.1
Using TeXMaker 5.0.2 and pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017/W32TeX)
The Laptop produces the wrong output... but the PC gives me exactly what I want...
So in general I can now relax and continue with my thesis... just need to remember to use the other computer to get the actual PDF that I am going to print...
But does anyone have an idea how I could fix this? (To get my Laptop to produce the correct output?)
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Chapter Numbering in customized Document Classs
Stefan