R knitr markown:设置HTML页面宽度
R knitr markown: Setting HTML page width
我正在使用 knitr
创建一个 HTML 网页。默认设置似乎是 800px 但我需要更大的页面大小 1100px
body {
max-width: 800px;
margin: auto;
padding: 1em;
line-height: 20px ;
}
我试过:
library("markdown")
library("knitr")
knit2html("test.Rmd",options = c(width=1100))
但这仍然给我 800px 的较小页面大小
如何设置 HTML 页面宽度的代码?
向您的文档添加 css
元素,例如
---
title: "test"
output:
html_document:
css: "test.css"
---
然后将您的新 css 信息放入该文件,例如
body {
max-width: 1100px;
margin: auto;
padding: 1em;
line-height: 20px ;
}
我正在使用 knitr
创建一个 HTML 网页。默认设置似乎是 800px 但我需要更大的页面大小 1100px
body {
max-width: 800px;
margin: auto;
padding: 1em;
line-height: 20px ;
}
我试过:
library("markdown")
library("knitr")
knit2html("test.Rmd",options = c(width=1100))
但这仍然给我 800px 的较小页面大小
如何设置 HTML 页面宽度的代码?
向您的文档添加 css
元素,例如
---
title: "test"
output:
html_document:
css: "test.css"
---
然后将您的新 css 信息放入该文件,例如
body {
max-width: 1100px;
margin: auto;
padding: 1em;
line-height: 20px ;
}