带有 knitr 幻灯片的长功能垂直滚动条 [英] Vertical scrollbar for long functions with knitr slides

查看:179
本文介绍了带有 knitr 幻灯片的长功能垂直滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用 knitr 幻灯片为长函数制作垂直滚动条(使用 xaringan 自定义样式)?我正在尝试基于上一个问题的一些选项 如何使垂直滚动条出现在 RMarkdown 代码块(html 视图)中 但不知道如何仅对长函数(高度超出框架)执行此操作.非常欢迎任何建议.

Is it possible to make vertical scrollbar for long functions with knitr slides (using xaringan custom style)? I was trying some options based on this previous question How to make vertical scrollbar appear in RMarkdown code chunks (html view) but no idea how to do it only for long functions (which height goes out of the frame). Any advice is more than welcome.

---
title: "title"
subtitle: "subtitle"
author: "author"
date: "2017"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: ["default", "style.css"]
    nature:
      highlightStyle: zenburn
      highlightLines: true
      countIncrementalSlides: false
---

```{r , echo=FALSE, include=FALSE}
library(knitr)
opts_chunk$set(fig.align='center', message=TRUE, error=TRUE, warning=TRUE, tidy=TRUE, comment = "##", echo = TRUE, dev='svg')
options(width=65)
```

```{r}
fu <- function(x){
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
}
```

推荐答案

您是否尝试过 这个答案

.scrollable-slide {
    height: 800px;
    overflow-y: auto !important;
}

这篇关于带有 knitr 幻灯片的长功能垂直滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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