Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floating TOC in tufte book #72

Open
1 task done
chipbrock opened this issue Sep 10, 2019 · 7 comments
Open
1 task done

floating TOC in tufte book #72

chipbrock opened this issue Sep 10, 2019 · 7 comments

Comments

@chipbrock
Copy link

This is a question and issue that has not received an answer on Stackoverflow after a day.
floating TOC in tufte book

Since I posted it I've confirmed it in another approach to standing up a stock tufte book. I believe this is real, although I confess that I'm still learning.

Here is a few-line modification to the index.Rmd file for the demo:

--- 
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output:
  tufte::tufte_html: default
  tufte::tufte_book:
    citation_package: natbib
    latex_engine: xelatex
  bookdown::tufte_html_book:
    toc: true
    toc_float: true
    css: toc.css
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: "This is a minimal example of using the bookdown package to write a book. The output format f

Inclusion of toc: true works. The top_float: true insertion results in the error:

Error in rmarkdown::html_document(..., extra_dependencies = c(extra_dependencies,  : 
  You must use a theme when specifying the 'toc_float' option
Calls: <Anonymous> ... html_chapters -> base_format -> html_document2 -> <Anonymous>
Execution halted

Exited with status 1.

This happens with the toc lines where they are shown and also as an argument to the tufte::tufte_html: line.

I don't see that the need to include a theme is included in the toc section in the "Definitive Guide" book. In any case, addition of a theme in what I think is the normal way doesn't help. I'd appreciate some help.

I have written and am currently using a variation of tufte format starting from (the award-winning!) programmingforpsych but I think I'd prefer to stick with the standard tufte package. But only if I can include the floating toc.

Thanks in advance for your help.


By filing an issue to this repo, I promise that

  • [ x] I have fully read the issue guide at https://yihui.name/issue/.
  • [ x] I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('tufte'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/tufte').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@JanaJarecki
Copy link

Hi,
I second the issue: I LOVE the tufte style you guys generated, and it would be great to include floating tocs. Or, probably, write a more informative error message if floating tocs are not supported at all?
Thank you,
cheers

@lrdegeest
Copy link

Agreed, a floating TOC would be a great feature.

@yihui
Copy link
Member

yihui commented May 7, 2020

Sorry, but floating TOC is not supported in this package. I'll consider it in the future. Thanks!

@ghost
Copy link

ghost commented Mar 17, 2021

I would be excited if TOC can be supported in this package.

@ghost
Copy link

ghost commented Aug 28, 2021

I am wondering the following example would make you (@chipbrock) be satisfied for now.

https://www.crumplab.com/programmingforpsych/index.html

@ogorodriguez
Copy link

@yihui any input on this advance. Thanks.

@epistecius
Copy link

A solution seems to have been implemented in the book: "Modern Statistics for Modern Biology", combining the tufte with a floating TOC.
Unfortunately, the MSMB Style Package from @grimbough does seem to include the floating TOC solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants