R Bookdown-自定义目录/边栏的宽度 [英] R Bookdown - Customize width of TOC/Sidebar

查看:153
本文介绍了R Bookdown-自定义目录/边栏的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管我可以通过修改.css中的页面包装器来更改r bookdown文档主体中不同元素的宽度和位置,但是有没有办法通过修改样式表来更改侧边栏的宽度?

Although I can change the width and position of different elements in the body of an r bookdown doc by modifying the page wrapper in the .css, is there a way to change the width of the sidebar by modifying the styles sheet?

我不是要更改目录中单词的字体或颜色,而只是更改宽度。

I'm not looking to change the font or color of the words in the TOC, just the width. Something like:

width:50px;
margin-right:0;

width: 50px; margin-right: 0;

我不需要宽的侧边栏,但我确实需要更大的宽度。

I don't need a wide sidebar, but I do need more width in the body.

我已经尽可能地扩大了内部主体,所以剩下的只是侧边栏。

I already widened the inner body as much as possible, so all that is left is the sidebar.

推荐答案

在您的 _output.yml 中添加css文件名

In your _output.yml add the css filename

bookdown::gitbook:
  css: style.css

创建 style.css 更改默认的300px

Create style.css to change the default 300px

.book .book-summary {
  width: 350px;
  position:absolute;
  top:0;
  left:-350px;
}

.book.with-summary .book-header.fixed {
    left: 350px;
}

.book.with-summary .book-body {
    left: 350px;
}

这篇关于R Bookdown-自定义目录/边栏的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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