Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Bookdown - Customize width of TOC/Sidebar

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.

like image 772
William Stah Den Mayer Avatar asked Aug 12 '18 05:08

William Stah Den Mayer


1 Answers

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;
  position:absolute;
  top:0;
  left:-350px;
}

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

.book.with-summary .book-body {
    left: 350px;
}
like image 69
Ferroao Avatar answered Nov 12 '22 14:11

Ferroao