图内的 Latex 子部分 - toc 显示子部分

图内的 Latex 子部分 - toc 显示子部分

我尝试将很多这些元素融入我的论文中:

\subsection{Maschine}
\begin{figure}[!ht]
\begin{center}
\begin{tikzpicture}
\node[fill=gray!10,text width=0.9\textwidth, draw, minimum height=1 cm] at (1,9)
{\begin{center}\textbf{Factory}\end{center}};
\node[fill=white,text width=0.9\textwidth, draw, minimum height=1 cm] at (1,8)
{String bestehend aus beliebig vielen Komponenten};
\node[fill=white,text width=0.9\textwidth, draw, minimum height=1 cm] at (1,7)
{\texttt{<Factory> Komponenten </Factory>}};
\end{tikzpicture}
\end{center}
\vspace{0.5cm}
Description
\end{figure}

我想修复它们。所以我在小节周围写了一个图形标签。

在此代码之前,我使用了下一行来防止这些小节显示在目录中:

 \addtocontents{toc}{\protect\setcounter{tocdepth}{1}}

但由于小节周围有图形标签,因此它们被显示出来。

有没有办法防止乳胶将它们放入目录中或在没有图形标签的情况下将子部分保持在一起?

相关内容