当我使用 #### 作为 4 级标题时,pdf(latex) 中的输出在段落开始之前不会留下行间距。例如,
#### Heading 4
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
specimen book.
仅在 pdf(latex) 中输出看起来像这样
标题 4 Lorem Ipsum 只是打印和排版行业的虚拟文本。自 1500 年代以来,Lorem Ipsum 一直是行业标准的虚拟文本,当时一位不知名的打印商拿走了一堆字体并将其打乱以制作一本字体样本簿。
我到处都读到 r markdown 允许 1-6 # 作为标题,所以我试图找出我在这里做错了什么。
我还想我可以使用\subsubsubsubsection 而不是 #### 作为标题,但这给了我一个错误。
最佳答案
查看 Mico 对以下问题的回答:
将此代码添加到您的 tex 头文件中即可:
\documentclass{article}
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-2.5ex\@plus -1ex \@minus -.25ex}%
{1.25ex \@plus .25ex}%
{\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
关于r - R Markdown 中的 4 级标题问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33134416/