I want to add a prefix to subsections, that went well. After looking in this thread:
Add chapter/appendix prefix in table of contents of scrbook with correct appendix running head
it was almost ok. I adapted the code and the result is fine, but compiling gives me an error. This is my MWE:
\documentclass{exam}
\renewcommand{\thesubsection}{Huistaak~\arabic{subsection}:}
\renewcommand{\contentsname}{Overzicht huistaken}
\usepackage{tocstyle}
\renewcommand*{\addsubsectiontocentry}[2]{%
\addtocentrydefault{subsection}{\subsectapp\nobreakspace #1}{#2}%
}
\begin{document}
\tableofcontents
\section{The weather is beautifull}
\subsection{I'm happy}
\subsection{You are happy}
\subsection{We are all happy}
\end{document}
The error I get is: \addsubsectiontocentry undefined
So I think I didn't do it correctly. (In fact I don't really understand the line:
\renewcommand*{\addsubsectiontocentry}[2]{%
\addtocentrydefault{subsection}{\subsectapp\nobreakspace #1}{#2}%
}

scrbookas the documentclass, where that command is being used. – Runar Sep 11 '16 at 12:01\renewcommand*{\addsubsectiontocentry}[2]{%…, and it will not throw you an error. Please revise your question if this is not the desired output. – Runar Sep 11 '16 at 12:04