I have two questions. First I would like to add subsection to the tableofcontent of my document to structure a little bit the toc without repeating the subsection in the docoment. And I already found out that this code:


  \subsectionmark{#1}% Add subsection mark (header)
  \addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection}#1}% Add subsection to ToC
  % Add more content here, if needed.

\section{Header A}

\section{Header B}


works for me but now I would like to suppress the numbering of the subsections and I didn't find a solution for this problem that's why I am hopping someone here can give me a hint how I can do this.

My second question can I use something like conditional meshed for the text so that every entry that start after a section a meshed up 2 cm and every entry that starts after a subsection 4 cm so that I get a structure like

Header AAA
  Subsection aaa
    Site 1
    Site 2
    Site 3

Header BBB
  Site 4
  Site 5
  Site 6

I hope my explation is good enough to understand what I am looking for and of course I would very thankful for every hint. best regards Dan

  • Welcome to TeX.SX! Please do not post two different (and apparently totally unrelated) issues in one question. – user31729 Jul 3 '16 at 10:24
  • If you want to remove the numbering, just remove the \protect\numberline{\thesubsection} code snippet in \addcontentsline – user31729 Jul 3 '16 at 10:29
  • Crosspost: mrunix.de/forums/showthread.php?77109 – esdd Jul 4 '16 at 11:09

scrartcl is a KOMA-Script class. So you can use

  \subsectionmark{#1}% add subsection mark (header)
  \addsubsectiontocentry{}{#1}% add as subsection to ToC

to add this text as subsection without number to the table of contents.

Update using scrreprt which provides chapters (based on the MWE and the informations in this post on mrunix.de)


% Inputencoding hier selbst festlegen
\usepackage{cook}% see https://sourceforge.net/projects/chilicookbook/





  tocbeforeskip=5pt plus .2pt,%

  \sectionmark{#1}% Add subsection mark (header)

\fakesection{Deutsche Küche}
\begin{recipe}[]{Bandnudeln mit Lachs}{Quelle?}{}
  \ingredient{Salz, Pfeffer}
  Ins Restaurant gehen und kaufen, essen und freuen

  \ingredient{2 Äpfel}
  \ingredient{Prise Salz}
  Chips sind auch lecker

  \ingredient{120g Vollkorn-Weizenmehl}
  \ingredient{250g Äpfel}
  Äpfel sind auch so gesund

\begin{recipe}[]{Apfelkuchen mit Mandel-Zimt Streuseln}{}
  \ingredient{1 Päckchen Vanillezucker}
  \ingredient{2 Eier}
  Kekse kann man auch kaufen

enter image description here

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.