R Bookdown - Customize width of TOC/Sidebar

坚强是说给别人听的谎言 提交于 2020-01-01 15:36:46

问题


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;

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.


回答1:


In your _output.yml add the css filename

bookdown::gitbook:
  css: style.css

Create style.css to change the default 300px

.book .book-summary {
  width: 350px;
}

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

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


来源:https://stackoverflow.com/questions/51805885/r-bookdown-customize-width-of-toc-sidebar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!