对于
subparagraph
,它不与段落内联为什么的内容
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
:
对于book
documentclass,段落和子段落标题的默认行为如下:
\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
您更改了标题的样式paragraph
,subparagraph
但标题保持不变。这可以按照以下 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}