2017-05-31 27 views
0

RStudioのRmdファイルをHTMLに編成しています。本文と表/図の間のスペースを増やしたいと思います。 PDF出力の場合はHere's a nice solutionです。 CSSのどの部分がHTML出力でこの間隔を指定していますか?私はテンプレート全体の解決策を探していますが、マニュアルではありません<br>図/コードチャンクの上下に上下のスペースを追加する(HTML)

--- 
title: "Example" 
output: 
    bookdown::html_document2: 
    fig_captions: yes 
    number_sections: false 
    theme: cerulean 
    highlight: tango 
    toc: true 
    code_download: true 
    code_folding: "show" 
    toc_float: true 
--- 

<style type="text/css"> 

body{ /* Normal */ 
     font-size: 18px; 
     font-family: Helvetica; 
    } 

div#TOC li { 
    list-style:none; 
    background-image:none; 
    background-repeat:none; 
    background-position:0; 
} 
</style> 

```{r setup, include=FALSE} 
library(ggplot2) 
library(knitr) 
``` 

## Section 

Here is some text before a table. 

```{r cars} 
kable(head(cars)) 
``` 

Here is some text after the table. Here comes a plot. Could use more space after the table and before the plot. 

```{r pressure, echo=FALSE, fig.align="center", fig.cap="My caption", message=FALSE, warning=FALSE} 
ggplot(cars, aes(speed)) + 
    geom_histogram() 
``` 

Here is some text after the plot. Need some space between the figure caption and the body text. 

enter image description here

答えて

1

<style>タグ内

.figure { 
    margin-top: 100px; 
    margin-bottom: 100px; 
} 

table { 
    margin-top: 100px; 
    margin-bottom: 100px !important; 
} 

を追加します。明らかに必要な量に調整する。

+0

素晴らしい、@ガンガンバ。ありがとう。 –

関連する問題