首页 > 解决方案 > 使用 rmdformats 使用最大页面宽度?

问题描述

在使用 rmdformats::readthedown 渲染 R markdown 文档时,我尝试使用整个页面宽度。首先,您可以看到仅使用 html_document 作为输出(以及第一个块之前的 YAML 下方的样式定义)不是问题。 在此处输入图像描述

YAML 和样式:

---
title: "Data checks for table T32100359"
author: "Crop Reporting Unit, Statistics Canada"
date: "`r Sys.Date()`"
output: 
    html_document:
      keep_md: true
runtime: shiny
---
<style type="text/css">
.main-container {
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}
</style>

使用 rmdformats 我的身材被削减了。实际上整个页面是: 在此处输入图像描述

YAML 和样式:

---
title: "Data checks for table T32100359"
author: "Crop Reporting Unit, Statistics Canada"
date: "`r Sys.Date()`"
output: 
    rmdformats::readthedown:
      keep_md: true
runtime: shiny
---
<style type="text/css">
.main-container {
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}
</style>

请注意,我也尝试过

<style>
.main-container {
    width: 100%;
    max-width: unset;
}
</style>

如何确保整个页面宽度与 rmdformats 一起使用?谢谢!

标签: cssrr-markdown

解决方案


推荐阅读