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

pdftexfrom loading packages. They don't need it. – Schweinebacke May 29 '17 at 11:41titlesecversion do you use? If it is 2.10.1 from 2016/03/15 then you have to update this package (see https://tex.stackexchange.com/a/300259/43317). But note that it is not recommended to use the packagestitlesecandtoclofttogether with a KOMA-Script class. There should be a way to get the desired result with KOMA-Script commands and settings. Do not change\oddsidemarginand\evensidemarginmanuelly. There isgeometryloaded in your snippet, so you can use its options to change the page margins. – esdd May 29 '17 at 12:05\chapter,\section,\subsectionetc. from your code! They remove the numbers from your document and they are all wrong and result in a misusage of the\chaptercommand. There should be no formatting commands inside the argument of a sectioning commands. – esdd May 30 '17 at 11:00\chapterthen usescrreprtorscrbookinsteadscrartcl. Article classes do not know chapters. – esdd May 30 '17 at 11:08