在文档的附录中,我想添加额外的内容表来表示以下图纸。
请考虑以下示例代码:
\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}
附录中的附加部分不应显示在主目录中,而应显示在附录中。
你知道怎么做吗?
答案1
一个非常简短的版本,带有minitoc
一种生成(奇怪的)部分等计数器值的特殊方法。
\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}