0

I am writing using KOMA script. I have several chapters and want to divide them into different sections.

In my TOC, however, the numbering of the sections does not include the number of the respective chapter as a prefix but starts with the section number. Subsections contain the section number as the prefix but also not the chapter number. This also applies to all the headings.

Can anyone help me out?

My preemble is as follows:

\documentclass[11pt,a4paper,oneside, titlepage=firstiscover, enabledeprecatedfontcommands]{scrreprt}

\renewcommand{\thesection}{\arabic{section}}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}

\usepackage{abstract}

\usepackage{setspace}

\usepackage[nottoc, notlot, notlof, numbib]{tocbibind}

\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\usepackage{framed}
\usepackage{xcolor}
\usepackage{transparent}
\usepackage{mdwlist}
\usepackage{paralist}
\usepackage{url}
           
%Graphs
\usepackage{graphicx}
\graphicspath{{Figures/}} 
\usepackage{adjustbox}
         
\usepackage{listings}
\usepackage{mdframed}

\usepackage{amsmath, amssymb, amstext, amsthm, amsfonts, mathrsfs} %maths
\usepackage[version=4]{mhchem} %chemistry
\usepackage{expl3}
\usepackage{calc}
\usepackage{xfrac}

\usepackage{grffile} 
\usepackage{array}

%tables
\usepackage{multirow, multicol, bigstrut}
\usepackage{floatrow}
\floatsetup[table]{capposition=top}
\usepackage{booktabs}

%acronyms
\usepackage[printonlyused]{acronym}

\usepackage{upgreek}
\usepackage{textcomp} 

\usepackage[labelfont=bf, format=plain]{caption}
\usepackage[labelfont=bf, format=plain]{subcaption} 
\renewcaptionname{british}{\figurename}{Fig.}
\renewcaptionname{british}{\tablename}{Tab.}

\usepackage{siunitx} 
\sisetup{detect-weight=true, detect-family=true}

\usepackage[super, comma, numbers, sort&compress]{natbib} 
\usepackage{bibentry} 

\usepackage{blindtext}

\setlength{\belowcaptionskip}{\abovecaptionskip}

\setcounter{topnumber}{4}
\renewcommand{\topfraction}{.8}
\setcounter{bottomnumber}{4}
\renewcommand{\bottomfraction}{.7}
\setcounter{totalnumber}{10}
\renewcommand{\textfraction}{.1}
\renewcommand\floatpagefraction{.7}
\setlength{\textfloatsep}{1.0cm}
\setlength{\intextsep}{1.0cm}
\setlength\emergencystretch{20pt}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1.6ex plus 2pt minus 1pt}

%Header
\usepackage[bindingoffset=1cm,margin=1.8cm,
            includehead,includefoot]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % 
\chead{}
\rhead{Santa Claus}
\renewcommand{\headrulewidth}{0.2pt}
\fancyfoot[C]{\thepage} 
% Date
\usepackage[nodayofweek,level]{datetime}
\newcommand{\mydate}{\formatdate{29}{6}{2001}}

%referencing
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}

I use pdflatex as compiler and 'input' every chapter as a separate TeX file after my title page!

Thanks in advance! /jan

3
  • 2
    Welcome to TeX.SX! You should provide a properly written MWE. Your codes are missing the document environment. Jun 22 at 15:04
  • 1
    Let me ask you a question, what do you think the second line in your example does? Hint: removes the chapter number from the section number.
    – daleif
    Jun 22 at 15:30
  • the section was defined only to display the section number! It missed a command. Jun 22 at 15:34
0

OK just as daleif hinted in the comment, you do not need \renewcommand{\thesection}{\arabic{section}} on the 2nd line. This causes the section to display only the section number and not the chapter number. If however for some reason you needed to define the section that way, include thechapter to the definition. This displays the chapter number under which the particular section is. That is, \renewcommand{\thesection}{\thechapter.\arabic{section}}.

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.