为什么小段落不与段落或章节对齐

为什么小段落不与段落或章节对齐
  1. 对于subparagraph,它不与段落内联

  2. 为什么的内容subparagrah不像其他的一样转到第二行?

\chapter{Chapter 5}
\label{chap:chapter-5}

\section{section}
Testing

\subsection{subsection}
Testing

\subsubsection{subsubsection}
Testing

\subsubsection{subsubsection}
Testing

\subsubsection{subsubsection}
Testing

\subsubsection{subsubsection}
Testing

\paragraph{paragraph}
Testing


\subparagraph{subparagraph}
Testing

在此处输入图片描述

以下是序言:

\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%  %for section paragraph
            {-2.5ex\@plus -1ex \@minus -.25ex}%   %for section paragraph
            {1.25ex \@plus .25ex}%  %for section paragraph 
            {\normalfont\normalsize\bfseries}}  %for section paragraph
\makeatother  %for section paragraph
\setcounter{secnumdepth}{5} % how many sectioning levels to assign numbers to  %for section paragraph
\setcounter{tocdepth}{5}    % how many sectioning levels to show in ToC   %for section paragraph
%for section paragraph 

答案1

这是假设使用的 documentclass 是book

对于bookdocumentclass,段落和子段落标题的默认行为如下:

在此处输入图片描述

\documentclass{book}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\begin{document}

\chapter{Chapter}

\section{section}
Section text

\subsection{subsection}
subsection text

\subsubsection{subsubsection}
subsubsection text

\paragraph{paragraph}
paragraph text


\subparagraph{subparagraph}
subparagraph text

\end{document}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}
\makeatother

您更改了标题的样式paragraphsubparagraph但标题保持不变。这可以按照以下 MWE 所示完成:

在此处输入图片描述

\documentclass{book}

\makeatletter
%%%%% Change the style of paragraph headings %%%%%
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}
%%%%% Change the style of subparagraph headings %%%%%
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}% 
            {\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\begin{document}

\chapter{Chapter}

\section{section}
Section text

\subsection{subsection}
subsection text

\subsubsection{subsubsection}
subsubsection text

\paragraph{paragraph}
paragraph text


\subparagraph{subparagraph}
subparagraph text

\end{document}

相关内容