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}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage[a4paper]{geometry}
\setlength{\oddsidemargin}{5mm}
\setlength{\evensidemargin}{5mm}
\usepackage[english]{babel}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{newtxtext,newtxmath,amsmath}
\usepackage{graphicx}
\usepackage{subfiles}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{tocloft}
\usepackage{xstring}
\usepackage{adjustbox}
\makeatletter
\def\printtitle
\makeatother
\def\chapter{\flushleft\LARGE\textbf}
\def\section{}
\def\subsection{\flushleft\textbf{}}
\def\justify{}
\def\linestretch{}
\begin{document}
\title{}
\printtitle
\printauthor
\include{chapter2}
\end{document}
\chapter{
\flushleft\textbf{\Huge Chapter 2}
\\[0.5cm]}
\linespread{1}
\normalsize
Best Answer
If you need chapters then use a report or book class like
scrreprt
orscrbook
. Do not loadscrartcl
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
andfancyhdr
together with a KOMA-Script class.