Hej,
Recently I had a problem with numbering chapters, sections and subsections (can be found here). Now it seems like everything works but there is still a problem with chapters. They do not appear in ToC and I cannot numbered them. Also, when I tried to remove \def\chapter my whole document crashes…
Help
\documentclass[paper=a4,fontsize=11pt,twoside=semi,usegeometry]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{microtype}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{newtxtext,newtxmath}
\usepackage{graphicx}
\setlength{\oddsidemargin}{5mm}
\setlength{\evensidemargin}{5mm}
\usepackage{blindtext}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{tocloft}
\usepackage{ragged2e}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\addtokomafont{disposition}{\rmfamily}
\RedeclareSectionCommand[
beforeskip=-1sp,
afterskip=.5cm,
font=\Huge
]{chapter}
\newcommand{\HRule}[1]{\rule{\linewidth}{#1}}
\makeatletter
\def\printtitle{}
\makeatother
\makeatletter
\def\printauthor{}
\makeatother
\def\afterpage{\null\newpage}
**\def\chapter**
\def\linestretch
\begin{document}
\printtitle
\printauthor
\include{Chapter}
\end{document}
Best Answer
I have commented the wrong and unneeded lines in your MWE. Please try if the following example works for you:
Regarding your
\afterpage
command: please show where you are using this command. I am sure there are other possibilities like\clearpage
,\cleardoublepage
,\cleardoubleoddpage
, ...