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

adding toc on rmarkdown documents #139

Closed
emmandecena opened this issue Jan 27, 2020 · 6 comments
Closed

adding toc on rmarkdown documents #139

emmandecena opened this issue Jan 27, 2020 · 6 comments

Comments

@emmandecena
Copy link

Hi,

I cannot seem to show the table of contents on my rmarkdown generated document.
I tried adding bookToC: true , booktoc: true or toc: true to the front matter of my rmarkdown document but still the toc does not show on the rendered html.

@alex-shpak
Copy link
Owner

Hi!
Parameter BookToC in site and page params is true by default, perhaps your toc is limited by markup config, by default hugo starts to render headings from second level in toc.

Try this in your site config:

[markup.tableOfContents]
  startLevel = 1
  endLevel = 6

Ref: https://gohugo.io/getting-started/configuration-markup/#table-of-contents

If that doesn't help compare your settings and content to exampleSite, ToC works there.

@emmandecena
Copy link
Author

I was able to show the toc by putting the following code on my Rmarkdown front matter:
output: blogdown::html_page: toc: true

However, I would like the toc to be on the right side, just like your template. How do I extract this toc and put it on the template? See attached image. Thank you.
Screen Shot 2020-01-29 at 8 47 20 PM

@alex-shpak
Copy link
Owner

Hi!
Did you try suggestions I had in previous comment?
Maybe you can create example site to reproduce issue, so I can have a look at it.

@alex-shpak
Copy link
Owner

alex-shpak commented Jan 29, 2020

Can be related: rstudio/blogdown#58

@alex-shpak
Copy link
Owner

Perhaps you need to switch output format from rmd to md for that. Unfortunately I don't have experience with blogdown.

@emmandecena
Copy link
Author

I figured there might not yet be a feature to extract the toc from and rmd file. Will try to address this issue on the blogdown page. Thank you!

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

2 participants