Hej, I'm beginner with latex and I have a problem with chapters, sections and subsections numbers. They do not appear neither in my document nor in ToC. However, everything works fine for numbers of subsubsections...

3rd attempt:

\documentclass[paper=a4, fontsize=11pt,twoside]{scrartcl}   








\flushleft\textbf{\Huge Chapter 2}
  • 2
    Please do not show us screenshots of a code snippet. Always show us a minimal but working example (MWE). Making such a MWE will help you to find the critical code and sometimes even to find a solution. Showing us such a MWE will help us to reproduce the problem, test our suggestions and find a solution. BTW: Remove option pdftex from loading packages. They don't need it. May 29, 2017 at 11:41
  • 2
    Which titlesec version do you use? If it is 2.10.1 from 2016/03/15 then you have to update this package (see tex.stackexchange.com/a/300259/43317). But note that it is not recommended to use the packages titlesec and tocloft together with a KOMA-Script class. There should be a way to get the desired result with KOMA-Script commands and settings. Do not change \oddsidemargin and \evensidemargin manuelly. There is geometry loaded in your snippet, so you can use its options to change the page margins.
    – esdd
    May 29, 2017 at 12:05
  • 1
    Please copy/paste the code so we can copy/paste and test your example. Just looking at a screenshot isn't helpful and nobody is going to type the text on a keyboard.
    – Johannes_B
    May 30, 2017 at 10:50
  • 2
    Sorry, but there are really strange things in your preamble. Remove all the redefinitions of \chapter, \section, \subsection etc. from your code! They remove the numbers from your document and they are all wrong and result in a misusage of the \chapter command. There should be no formatting commands inside the argument of a sectioning commands.
    – esdd
    May 30, 2017 at 11:00
  • 1
    If you want to use \chapter then use scrreprt or scrbook instead scrartcl. Article classes do not know chapters.
    – esdd
    May 30, 2017 at 11:08

1 Answer 1


If you need chapters then use a report or book class like scrreprt or scrbook. Do not load scrartcl and define a \chapter command. And do not redefine \section and \subsection in that complettly wrong way. Your definitions remove the numbers for sections und subsections - amongst other strange things.

Maybe the following example could be a starting point. But I do not know which packages do you really need and how the sectioning titles should be formatted. Note that it is not recommended (and normally not necessary) to use titlesec, tocloft and fancyhdr together with a KOMA-Script class.



%\usepackage{geometry}% needed?
%\usepackage{subfiles}% needed?
%\usepackage{xstring}% needed?
%\usepackage{adjustbox}% needed?

\usepackage{blindtext} %only for dummy text in the example




\chapter{Chapter 2}


enter image description here

  • Thank you SOOO much! It seems like it works for everything but chapters... I still cannot number them and if I remove \def\chapter my whole document crashes...
    – Joanna
    May 30, 2017 at 16:05
  • Did you replace scrartcl by scrreprt? Class scrartcl does not know chapters.
    – esdd
    May 30, 2017 at 16:16
  • yes, I did it the same as in the code you posted
    – Joanna
    May 30, 2017 at 16:21
  • If my example itself works for you, then ask a new question with a new short MWE which reproduces the issue and link to this question here.
    – esdd
    May 30, 2017 at 16:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .