1

In the appendix of a document I want to add an additional table of content to represent the following drawings.

Please consider the following example code:

\documentclass[]{article}

\begin{document}
\tableofcontents

\section{Section 1}
\section{Section 2}

\appendix
\section{Appendix 1}
\section{Appendix 2}

% Example of the structure of the additional table of content just for appendix
1.000.000               Fertigungskonzept       1
   1.100.000            Baugruppe               2
      1.110.000         Unterbaugruppe          3
         1.111.000      Unter-Unterbaugruppe    4
            1.111.001   Einzelteil              5
            1.111.002   Einzelteil              6
         1.112.000      Unter-Unterbaugruppe    7
           1.112.001    Einzelteil              8
           1.112.002    Einzelteil              9
      1.120.000         Unterbaugruppe          10

%Here the actual drawings are following
\subsection{Fertigungskonzept}
\subsubsection{Baugruppe}
% etc...

\end{document}

The additional section in the appendix should not be shown in the main table of content, just in the appendix.

Do you know how to do this?

  • This means: A different section numbering system as well? – user31729 Jul 13 '15 at 20:17
  • 2
    Have a look at the etoc package – cgnieder Jul 13 '15 at 20:18
  • @ChristianHupfer that would be preferable. – larkee Jul 13 '15 at 20:18
  • 1
    @larkee, yes, but it is weird and illogical. You can't have more than 9 Unterbaugruppen before the counter 'overflows' ;-) – user31729 Jul 13 '15 at 20:39
  • 1
    @larkee: Are you currently using any packages related to sectioning or the appendix? – Werner Jul 13 '15 at 20:48
3

A very short version, with minitoc and a special way of generating the (strange) section etc. counter values.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{minitoc}
\usepackage{tocloft}


\dosecttoc

\newcommand{\fillbefore}[1]{%
  \ifnum#1<10 
  00#1%
  \else
  \ifnum#1 <100
  0#1%
  \else
  #1%
  \fi
  \fi
}


\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{5}
\setcounter{secttocdepth}{5}
\addtolength{\cftsecnumwidth}{30pt}
\addtolength{\cftsubsecnumwidth}{20pt}
\addtolength{\cftsubsubsecnumwidth}{15pt}
\addtolength{\cftparanumwidth}{15pt}
\addtolength{\cftsubparanumwidth}{15pt}

\begin{document}
\tableofcontents

\section{Normal section}



\clearpage
\appendix


\adjuststc
\secttoc

\addtocontents{toc}{\setcounter{tocdepth}{-5}} % preventing the appearance of the following sections in the normal ToC!

\renewcommand{\thesection}{\arabic{section}.\fillbefore{\the\numexpr100*\value{subsection}}.\fillbefore{0}}
\renewcommand{\thesubsection}{\arabic{section}.\the\numexpr100*\value{subsection}.\fillbefore{0}}
\renewcommand{\thesubsubsection}{\arabic{section}.\the\numexpr100*\value{subsection}+10*\value{subsubsection}.\fillbefore{0}}
\renewcommand{\theparagraph}{\arabic{section}.\the\numexpr100*\value{subsection}+10*\value{subsubsection}+\value{paragraph}.\fillbefore{0}}
\renewcommand{\thesubparagraph}{\arabic{section}.\the\numexpr100*\value{subsection}+10*\value{subsubsection}+\value{paragraph}.\fillbefore{\arabic{subparagraph}}}
\section{Fertigungskonzept}
\blindtext[5]
\subsection{Baugruppe}
\blindtext[5]
\subsubsection{Unterbaugruppe}
\blindtext[5]
\paragraph{Unter-Unterbaugruppe}
\blindtext[5]
\subparagraph{Einzelteil 1}
\blindtext
\subparagraph{Einzelteil 2}
\blindtext
\paragraph{Unter-Unterbaugruppe}
\blindtext[5]
\subparagraph{Einzelteil 1}
\subparagraph{Einzelteil 2}

\subsubsection{Neue Unterbaugruppe}
\blindtext[5]

\end{document}

enter image description here

| improve this answer | |

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.