如何在文档中添加新的小节

如何在文档中添加新的小节

我想添加一个子子部分到我的文档。我知道你会告诉我很多帖子都解释了如何做到这一点,但我真的无法将建议的解决方案包含到我的文章中。也许我模板中写的命令不能与其他命令结合使用。

这里是 main.tex:

\documentclass[12pt,twoside]{report}

% for the TODOS
\usepackage{todonotes}\usepackage{todonotes}

\usepackage[utf8]{inputenc}
\usepackage[style=numeric, sorting=none]{biblatex}
\bibliography{references}
\renewcommand*{\bibfont}{\normalfont\footnotesize}  % reduce the font size of the bibliography
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{array}
\usepackage{paralist}
\usepackage{listings}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{chngcntr}
\counterwithout{equation}{chapter} % remove the chapter number
\usepackage{subcaption}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{minted}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{diagbox}
\usepackage{array}
\usepackage{colortbl}
\tcbuselibrary{skins}
\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}

\tcbset{tab1/.style={fonttitle=\bfseries\large,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=red!75!black,colbacktitle=Salmon!40!white,
coltitle=black,center title,freelance,frame code={
\foreach \n in {north east,north west,south east,south west}
{\path [fill=red!75!black] (interior.\n) circle (3mm); };},}}

\tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!40!white,
coltitle=black,center title}}

% footnote always at the bottom of the page
\usepackage[bottom]{footmisc}

\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\usepackage{listings}
\usepackage{color}

\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}


\lstset{frame=tb,
  language=Java,
  aboveskip=3mm,
  belowskip=3mm,
  showstringspaces=false,
  columns=flexible,
  basicstyle={\small\ttfamily},
  numbers=none,
  numberstyle=\tiny\color{gray},
  keywordstyle=\color{blue},
  commentstyle=\color{dkgreen},
  stringstyle=\color{mauve},
  breaklines=true,
  breakatwhitespace=true,
  tabsize=3
}

\usepackage[chapter]{algorithm}
\usepackage{algpseudocode}
\algrenewcommand{\alglinenumber}[1]{\color{gray}\footnotesize#1:}

\newcommand {\mvd}{\mbox{$\; \rightarrow \! \! \! \! \rightarrow \; $}}    % multi-valued dependency
\DeclareMathOperator*{\argmax}{argmax}    % add argmax to math mode
\DeclareMathOperator*{\argmin}{argmin}    % add argmin to math mode

% names for autoref
\newcommand{\algorithmautorefname}{Algorithm}
\newcommand{\exampleautorefname}{Example}
\renewcommand{\sectionautorefname}{Section}
\renewcommand{\subsectionautorefname}{Subsection}

% environment: definition
\newcounter{definition}
\newenvironment{definition}[1][]{\refstepcounter{definition}\par\medskip
   \noindent \textbf{Definition~\thedefinition~(#1).} \rmfamily\itshape}{\par\medskip}

% environment: heuristic
\newcounter{heuristic}
\newenvironment{heuristic}[1][]{\refstepcounter{heuristic}\par\medskip
   \noindent \textbf{Heuristic~\theheuristic~(#1).} \rmfamily\itshape}{\par\medskip}

% environment: example   
\newcounter{example}[section]
\newenvironment{exmp}[1][]{\refstepcounter{example}\par\bigskip
   \noindent \textbf{Example~\theexample} \rmfamily\itshape}{\par\bigskip}

% image base path
\graphicspath{{images/}}

% listing style for SPARQL queries
\lstdefinestyle{sparql}{
    basicstyle=\scriptsize,
    frame=tb,
    keywordstyle=\bfseries,
    morekeywords={PREFIX, SELECT, DISTINCT, UNION, OPTIONAL, FILTER, WHERE}
}

\lstdefinestyle{base}{
    basicstyle=\footnotesize,
    morecomment=[f][\color{olive}][0]{\#},
}

% color definitions
\definecolor{lightblue}{RGB}{33,204,219}
\definecolor{darkgreen}{RGB}{0,166,0}

% for the inspirational quote
\usepackage{epigraph}
\setlength\epigraphwidth{\textwidth}
\setlength\epigraphrule{0pt}

% for the date
%\usepackage{datetime}
%\newdateformat{monthyeardate}{\monthname[\THEMONTH], \THEYEAR}

% blankpage
\usepackage{afterpage}
\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}

\newcommand{\addtotoc}[1]{\addcontentsline{toc}{chapter}{#1}}

% image positioning on cover
\usepackage[absolute]{textpos}

% acronyms
\usepackage[nopostdot,nonumberlist,acronym]{glossaries}
\makenoidxglossaries
\input{tex/glossarie.tex}

\renewcommand*{\lstlistlistingname}{List of Listings}  % change the header of the list of listings

\usepackage{adjustbox}
\usepackage{rotating}

\begin{document}
\pagenumbering{Roman}

\input{tex/titlepage.tex}           %% title page
\blankpage

\newpage
\setcounter{page}{1}
\input{tex/authorship.tex}          %% declaration of authorship
\afterpage{\blankpage}

\newpage
%%\input{tex/inspirational_quote.tex} %% inspirational quote
%%\afterpage{\blankpage}

\newpage
\input{tex/acknowledgement.tex}     %% acknowledgments
\afterpage{\blankpage}

\newpage
\input{tex/abstract.tex}
\afterpage{\blankpage}

\tableofcontents
{\small\listoffigures}
{\small\listoftables}
%{\small\lstlistoflistings}
%{\small\listofalgorithms}

\glsaddall
{\small\printnoidxglossaries}

\afterpage{\blankpage}
\newpage

%% set the page style
\pagestyle{fancy}
\fancyhead[R,C,L]{}
%\fancyhead[RE]{\small{ \emph{\nouppercase{\leftmark}}}}
%\fancyhead[LO]{\small \emph{\nouppercase{\rightmark}}}
\fancyhead[RE]{\small{\nouppercase{\leftmark}}}
\fancyhead[LO]{\small{\nouppercase{\rightmark}}}
\fancyfoot[L,R]{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{0pt}
\setlength{\headheight}{14pt}

\pagenumbering{arabic}
\chapter{Introduction}
\input{tex/01_introduction.tex}

\chapter{Background}
\input{tex/02_background.tex}

\chapter{Related Work} % Just describe what exists that is related, but without comparing with what you did
\input{tex/03_related_work.tex}

\chapter{Approach}
\input{tex/04_approach.tex}

\chapter{Architecture} % Abstract description of the system, what are the components
\input{tex/04_architecture.tex}

%\chapter{Approach}
%\input{tex/04_approach.tex}

\chapter{Implementation} % What you did, with which tools (Stencila, ORKG, OJS), so a (reference) implementation of the architecture
\input{tex/05_implementation.tex}


%\chapter{Experimental Evaluation}\label{sec:experiment}
%\input{tex/06_evaluation.tex}

\chapter{Application} % Use case with the Gentsch paper
\input{tex/06_application.tex}

\chapter{Discussion} % Advantages, Limitations, Future work, Compare frameworks (Stencila vs. JupyterBook), Compare your work with related work, Challenges, Lessons learned
\input{tex/07_discussion.tex}

\chapter{Conclusions}
\input{tex/08_conclusion.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%              APPENDIX             %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%             REFERENCES            %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\addtotoc{Bibliography}
\printbibliography

\end{document}

答案1

分段命令的通常层次结构是:

\part
\chapter
\section
\subsection
\subsubsection
\paragraph
\subparagraph

\chapter不会出现在article或基于此的课程中)。

由于命名约定的改变,最后两个通常会成为新 LaTeX 用户的绊脚石,但您应该\paragraph在您想要的地方使用\subsubsubsection

相关内容