R Markdown中的4级标题问题 [英] Level 4 Heading issue in R Markdown

查看:247
本文介绍了R Markdown中的4级标题问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将####用作4级标题时,pdf(latex)中的输出在段落开始之前不会在行中留下空格.例如,

When I use #### for a level 4 heading, the output in pdf(latex) does not leave a line space before the paragraph begins. For example,

#### 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)中的输出看起来像这样

Output only in pdf(latex) looks like this

标题4 Lorem Ipsum只是印刷和排版行业的虚拟文字.自1500年代以来,Lorem Ipsum一直是行业的标准伪文本,当时一位不知名的打印机拿起一个厨房,将其打乱成一本样本书.

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.

我到处都读到r减价允许标题使用1-6#,所以我试图找出我在这里做错了什么.

I have read everywhere that r markdown allows 1-6 #’s for the headings, so I am trying to figure out what am I doing wrong here.

我还认为我可以使用\ subsubsubsubsection代替####作为标题,但这给了我一个错误.

Also I figured I could use \subsubsubsubsection instead of #### for the heading but that gives me an error.

推荐答案

请参阅Mico对以下问题的回答:

See Mico's answer to the following question:

https://tex.stackexchange.com/questions/60209/如何在子小节的下方添加额外的小节

将此代码添加到您的tex头文件中,应该这样做:

Add this code to your tex header file and that should do it:

\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 Markdown中的4级标题问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆