marin343
marin343

Reputation: 11

How to add multiple table of contents to R Markdown?

I am using bookdown to knit together a technical report. I'd like to have a table of contents for the overall document. I'd also like to have another table of contents of the appendix starting at the end of the document. How do I input 2 tables of contents?

Upvotes: 1

Views: 607

Answers (1)

manro
manro

Reputation: 3677

Yes, we can do that.

The first table of contents will be created with a default function.

How it looks:

---
title: "Test"
output:
  html_document:
    toc: true
---    

If we want to make the second table of contents - we should use an additional R-Script from Github. You can download it there.

And find more info and example there.

It is cool, you can place it everywhere.

An illustration:

enter image description here

Here are two snags, which I have found:

  • a) The second, custom ToC will displayed in the first.

  • b) The custom ToC hasn't page numbers after knitting to PDF.


An addition: Check these LaTeX-solutions:

https://tex.stackexchange.com/questions/48900/two-independent-tocs

Upvotes: 1

Related Questions