- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这是我的代码:
---
title: "A Multi-page HTML Document"
author: "Yihui Xie and Romain Lesur"
date: "`r Sys.Date()`"
output:
pagedown::html_paged:
toc: true
toc_depth: 3
# change to true for a self-contained document, but it'll be a litte slower for Pandoc to render
self_contained: false
---
# Exercises 1 {-}
# Exercises 2 {-}
# Exercises 3 {-}
如何修复这些空白页?那时我想抹掉。
最佳答案
就像评论中的人所说,解决这个问题的唯一方法就是使用自己的风格。如果他们将来提供一个内置选项来执行此操作,那就太好了。
/* page size */
@page {
size: 6in 9in;
}
/* store some string variables */
.shorttitle1 {
string-set: h1-text content(text);
}
.shorttitle2 {
string-set: h2-text content(text);
}
/* left page */
.running-h1-title {
position: running(runningH1Title);
width: var(--running-title-width);
text-overflow: ellipsis;
overflow: hidden;
}
.running-h1-title:before {
content: string(h1-text);
}
@page :first {
@top-left {
content: none;
}
@top-right {
content: none;
}
@bottom-right {
content: none !important;
}
background-image: var(--front-cover);
background-position: center;
background-size: contain;
background-repeat: no-repeat;
}
@page :left {
@top-left {
content: counter(page);
}
}
@page :right {
@top-right {
content: counter(page);
}
}
/* Front cover */
.front-cover {
break-after: page;
}
/* page breaks; aka CSS fragmentation */
.level1 {
break-before: page;
}
.section > h1, .section > h2, .section > h3, .section > h4, .section > h5, .section > h6 {
break-after: avoid;
}
.footnotes {
break-before: always;
break-after: always;
}
.figure {
break-inside: avoid;
}
/* do not break captions */
caption {
break-inside: avoid;
break-after: avoid;
}
并像这样使用它:
---
title: "A Multi-page HTML Document"
author: "Yihui Xie and Romain Lesur"
date: "`r Sys.Date()`"
output:
pagedown::html_paged:
toc: true
toc_depth: 3
# change to true for a self-contained document, but it'll be a litte slower for Pandoc to render
self_contained: false
css:
- custom.css
---
# Exercises 1 {-}
# Exercises 2 {-}
# Exercises 3 {-}
关于r - 如何删除Rmarkdown中的空白页(pagedown),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58365933/
我正在尝试使用此示例将 3 个文件编织在一起:http://rmarkdown.rstudio.com/rmarkdown_websites.html 我的文件都共享同一个目录,该目录已在 RStud
我正在将 Rmarkdown 与 python 一起使用。相当于R python的内联代码? 例如,在 https://rmarkdown.rstudio.com/lesson-4.html我可以 `
我正在用 Rmarkdown 编写一系列相互补充的报告。我想将上一份报告的结果包含在我目前正在处理的报告中。我看到其他问题建议使用 purl 从 Rmarkdown 文档中提取 R 代码然后运行它,所
我想演示如何编写 RMarkdown,其中所说的 RMarkdown 演示嵌入在用于创建类(class) Material 的 RMarkdown 文档中。在这个围栏代码块中,我不希望 knitr 执
我在 Amazon AWS EC-2(Amazon Linux AMI 2015.09.1 (HVM),SSD Volume Type - ami-60b6c60a)上安装了一个 Shiny 的服务器
我刚刚开始使用 rmarkdown、pandoc 和 knitr。我在尝试让 pandoc 获取比 rmarkdown 文档高一级的图像时遇到了很多困难。例如,考虑我们的项目目录是 ~/test,下面
我希望将 Bootstrap 导航栏(如此处所示:https://getbootstrap.com/docs/4.0/components/navbar/)添加到我正在创建的 R Markdown 模
我正在尝试通过 Rmarkdown 并排打印两个表格,输出为 PDF。 我可以很好地打印这些表格,但它们最终靠得很近,我找不到在它们之间创造更多空间的方法。我在其他帖子中找到的解决方案返回奇怪的输出或
我报告了一个问题 https://github.com/rstudio/rmarkdown/issues/967我想知道是否有解决方法(如何使其工作)? 下面的可重现示例(改变 n 和 nGroup
我正在将 Rmarkdown PDF 文档与以下 YAML 设置放在一起: --- output: pdf_document: fig_caption: true fig_crop
我有类似于以下的代码,它是动态生成并存储在变量中的: --- title: "test" author: "me" date: "3 June 2019" output: html_document
我经常编写可供技术人员和高管阅读的 Markdown 文档。 从这个意义上说,我想知道是否可以在 HTML 中创建一个按钮来隐藏或显示最终输出中的代码块? 目前,我正在创建两个单独的文件,我认为这是一
我正在使用 rmarkdown 在 RStudio 中进行投影仪演示。我想在演示文稿的顶部获得幻灯片代码。德累斯顿主题应该支持那些股票 Dresden 那么是否有可能通过使用 rmarkdown 来获
我有一个简单的问题。我如何使用 Rmarkdown/knitr 创建词汇表。我与 RStudio 合作。 我尝试这个但没有成功 \usepackage{glossaries} 在 header.tex
我有R包,它的功能之一-产生报告。在inst/markdown中,我有一个模板rep.rmd。在包函数ProduceReport()中,我有以下代码: render.file <-"rep.Rmd
嗨,我想在我的 Rmarkdown 文件的一侧添加一个页面导航。如果它看起来像侧边栏就好了 on this page . --- title: "My Title" author: "My Name"
当我为学生准备教程时,我需要一种方法来隐藏可折叠面板中的内容,这些面板可以通过单击按钮来显示。我已经使用下面的代码让它工作了。 RMarkdown 文件如下所示: --- title: Collaps
我最近开始使用 r-markdown使用来自 rticles 的便捷模板准备期刊文章.但是,我们最终使用 Word 而不是 LaTex 提交。合作者更喜欢 Word,目前,并非所有期刊都接受 LaTe
我有两个 RMarkdown 文件。 main.Rmd这是渲染的主文件 example.Rmd它包含更长的示例并在其他地方使用(因此它存在于自己的文档中)。 我想包括example.Rmd在 main
在我的 R 文件中,我有: library(rmarkdown) rmarkdown::render("C://Users//me//Desktop//test_param.Rmd",
我是一名优秀的程序员,十分优秀!