为了有一个子子子节,我使用了\paragraph
。问题是我在标题后立即获得了文本。如何在 之后获得一个空行\paragraph
?
答案1
使用titlesec
:
\documentclass{article}
\usepackage{titlesec}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\section{A test section}
text
\subsection{A test subsection}
text
\subsubsection{A test subsubsection}
text
\paragraph{A test paragraph}
text
\end{document}
\paragraph
无需包,只需从类中复制的定义并调整的第四和第五个参数\@startsection
;例如:
\documentclass{article}
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-3.25ex \@plus1ex \@minus.2ex}% original: without the minus
{1.5ex plus .2ex}% original {-1em}%
{\normalfont\normalsize\bfseries}}
\makeatother
\begin{document}
\section{A test section}
text
\subsection{A test subsection}
text
\subsubsection{A test subsubsection}
text
\paragraph{A test paragraph}
text
\end{document}
要使段落带有编号,请添加
\setcounter{secnumdepth}{4}
到序言中;要将它们包含在目录中,还需添加
\setcounter{tocdepth}{4}