这回答展示了如何使用 \S 实现段落编号。
下面,我们如何才能使§1和§2之间的间距与§1上方文本的行距相同,而不改变后者的行距?此外,如何使§1和上方文本之间的间距符合相同的间距?
以下代码中的第二个是我根据接受的答案使用的解决方案。
\documentclass[12pt]{article}
\usepackage{chngcntr}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}
\begin{document}
Here are just some words to show the normal spacing between lines in the main document.
\paragraph{} 1st paragraph
\paragraph{} 2nd paragraph
\end{document}
\documentclass{article}
\usepackage{chngcntr,titlesec}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}
\titlespacing{\paragraph}
{15pt}{0pt}{-8pt}
\usepackage{showframe}
\begin{document}
Here are just some words to show the normal spacing between lines in the main document.
\paragraph{} 1st paragraph
\paragraph{} 2nd paragraph
\end{document}```
答案1
从您的帖子中,了解到您需要修改标签前的垂直间距\paragraph
,我的理解是否正确,然后请使用以下命令MWE
:
\documentclass{article}
\usepackage{chngcntr,titlesec}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}
\makeatletter
\titlespacing{\paragraph}
{0pc}{3.5ex \@plus -1ex \@minus -.2ex}{10pt}
\makeatother
\begin{document}
Here are just some words to show the normal spacing between lines in the main document.
\paragraph{} 1st paragraph
\paragraph{} 2nd paragraph
\end{document}
注意:正如您在评论中提到的那样,您正在使用article
类文件,因此我也保留了相同的上述垂直空间作为第一级标题\paragraph
......
这是我根据接受的答案采用的解决方案:
\documentclass{article}
\usepackage{chngcntr,titlesec}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}
\titlespacing{\paragraph}
{15pt}{0pt}{-8pt}
\usepackage{showframe}
\begin{document}
Here are just some words to show the normal spacing between lines in the main document.
\paragraph{} 1st paragraph
\paragraph{} 2nd paragraph
\end{document}