我有一个大型项目(报告类),其中我要导入单独的文件。我想做的是在报告类中使用子部分,并让它们出现在目录中,并为子部分添加编号标题。
回答过类似的问题这里适用于 toptesi,但我无法将其定制为我的报告。这里简要描述了正在发生的事情。非常感谢您的帮助。
\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{import}
% For subsubsection in report class
\setcounter{secnumdepth}{3}
%%%%%%%%%%%%%%%%%%%%%
% LINE SPACING
\newcommand{\linespacing}{1.5}
\renewcommand{\baselinestretch}{\linespacing}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HYPERREF
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=blue,citecolor=blue,linkcolor=blue,bookmarksnumbered,plainpages=false]{hyperref}
%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% TABLE OF CONTENTS
\newpage
\pdfbookmark[0]{Contents}{contents_bookmark}
\tableofcontents
\chapter{Introduction}
\input{file1}
\end{document}
在 file1.tex 中,我有这些。
\section{Section File1}\label{file1}
\subsection{Subsection File1}
\subsubsection{Subsub section 1}
\subsubsection{Subsub section 2}
\subsubsection{Subsub section 3}
答案1
还设置 tocdepth
\documentclass[a4paper,11pt]{report}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3} %<--------
\pagestyle{plain}
\begin{document}
\tableofcontents
\chapter{Introduction}
\section{Section File1}\label{file1}
\subsection{Subsection File1}
\subsubsection{Subsub section 1}
\subsubsection{Subsub section 2}
\subsubsection{Subsub section 3}
\end{document}