하위 단락 및 하위 하위 단락을 만드는 방법은 무엇입니까?

하위 단락 및 하위 하위 단락을 만드는 방법은 무엇입니까?

하위 단락과 하위 하위 단락을 만들려고 합니다. 하위 하위 단락은 잘 작동하지만 하위 하위 단락으로 인해 목차에서 이상한 결과가 나타납니다.

내 코드는 다음과 같습니다.

\documentclass[parskip=full]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{titlesec}

\makeatletter

\titleclass{\subsubparagraph}{straight}[\subparagraph]
\titleformat{\subsubparagraph}{\normalfont\normalsize\bfseries}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}.\arabic{subparagraph}.\arabic{subsubparagraph}}{1em}{}

\titlespacing{\subsubparagraph}{0pt}{-3.25ex plus-1ex minus-.2ex}{1.25ex plus .1ex}

\newcounter{subsubparagraph}[subparagraph]

\titlespacing{\subparagraph}{0pt}{-3.25ex plus-1ex minus-.2ex}{1.25ex plus .1ex}
\titleclass{\subsubsubparagraph}{straight}[\subparagraph]

\titleformat{\subsubsubparagraph}{\normalfont\normalsize\bfseries}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}.\arabic{subparagraph}.\arabic{subsubparagraph}.\arabic{subsubparagraph}}{1em}{}

\titlespacing{\subsubsubparagraph}{0pt}{3.25ex plus-1ex minus-.2ex}{1.25ex plus .1ex}

\newcounter{subsubsubparagraph}[subsubparagraph]

\renewcommand\thesubsubparagraph {\arabic{section}.\arabic{subsection}.\arabic{subsubsection}.\arabic{paragraph}.\arabic{subparagraph}.\arabic{subsubparagraph}}% 

\setcounter{secnumdepth}{8}
\setcounter{tocdepth}{8}

\newcommand*\l@subsubparagraph{\@dottedtocline{7}{12em}{2em}}
\newcommand*\l@subsubsubparagraph{\@dottedtocline{8}{17em}{2em}}


\begin{document}

\setcounter{tocdepth}{10}
\setcounter{secnumdepth}{10}
\tableofcontents

\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
\paragraph{Paragraph}
\subparagraph{Subparagraph}
\subsubparagraph{Subsubparagraph}
\subsubsubparagraph{Subsubparagraph}

\end{document}

하위 단락의 제목이 번호 매기기와 겹칩니다. 여기에 이미지 설명을 입력하세요

이 문제를 어떻게 해결할 수 있나요?

답변1

패키지는 titlesecKOMA 스크립트 기능 중 일부를 손상시킵니다. 따라서 이 패키지를 와 함께 사용하는 것은 권장되지 않습니다 scrartcl.

\DeclareNewSectionCommands다음 을 사용할 수 있습니다 \RedeclareSectionCommand.

\documentclass[parskip=full]{scrartcl}[2016/05/10]
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\DeclareNewSectionCommands[
  style=section,
  level=\subparagraphnumdepth+1,
  beforeskip=-3.25ex plus -1ex minus -.2ex,
  afterskip=1.25ex plus .1ex,
  counterwithin=subparagraph,
  font={},
  indent=0pt,
  toclevel=\subparagraphtocdepth+1,
  tocnumwidth=6em
]{subsubparagraph,subsubsubparagraph}

\RedeclareSectionCommand[
  tocindent=12em
]{subsubparagraph}
\RedeclareSectionCommand[
  tocindent=14em
]{subsubsubparagraph}

\setcounter{secnumdepth}{\subsubsubparagraphnumdepth}
\setcounter{tocdepth}{\subsubsubparagraphtocdepth}

\begin{document}
\tableofcontents
\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
Text
\paragraph{Paragraph}
Text
\subparagraph{Subparagraph}
Text
\subsubparagraph{Subsubparagraph}
Text
\subsubsubparagraph{Subsubsubparagraph}
Text
\end{document}

결과:

여기에 이미지 설명을 입력하세요

이미지에서 볼 수 있듯이 paragraph인라인 subparagraph제목입니다. 음수 값은 afterskip가로 건너뛰기를 설정하여 인라인 제목이 됩니다. 따라서 새로 정의된 수준의 제목도 인라인 제목이어야 하는 경우 를 사용하세요 afterskip=-1em. 그러나 뒤에 수직 공간이 있어야 paragraph하고 subparagraph이를 afterskip긍정적인 값으로 변경해야 하는 경우 다음과 같습니다.

\RedeclareSectionCommands[
  afterskip=1.25ex plus .1ex
]{paragraph,subparagraph}

관련 정보