-
Notifications
You must be signed in to change notification settings - Fork 126
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
headings do not appear in TOC when inside 2-column layout #336
Comments
After digging deeper into this, it turns out, that neither pagedown (nor bookdown) are the source of this problem, but it stems from pandoc treating fenced divs as "isolated environments" for now. Closing this here with a link to a comment I posted on a related pandoc issue in case anyone is interested Multiple subheadings in same fenced div don't appear in the TOC |
Thanks for the investigation and posting back! Just FYI, I started rewriting the R Markdown ecosystem this year as the new litedown package, and I've also partially rewritten pagedown there. Below is your example using the litedown setup (to be built via ---
title: "TOC error reprex"
author: "Myself"
date: "`{r} Sys.Date()`"
output:
html:
meta:
css: ["@default", "@book", "@pages"]
js: ["@pages"]
options:
toc:
depth: 3
---
# H1 - normal page
This is a normal page without 2 columns. The level 2 headings are included in the toc.
## H2A - normal page
The first h2.
### H3A - normal page
The first h3.
## H2B normal page
The second h2.
### H3B - normal page
The second h3.
<!-- Here is the CSS: -->
```{css}
.columns-2 {
display: flex;
justify-content: space-between;
}
```
# H1 - 2-column page
This is a 2 column layout. The level 2 and 3 headings are NOT included in the toc.
:::: {.columns-2}
::: {}
## H2A - 2-column page
The first h2 in the left column.
### H3A - 2-column page
The first h3 in the right column.
:::
::: {}
## H2B - 2-column page
The second h2 in the right column.
### H3B - 2-column page
The second h3 in the right column.
:::
:::: And the HTML output can be printed to PDF in browser: TOC.pdf |
When you use a two-column layout on a page and include any heading inside of the columns, these are not recognized / shown in the table of contents.
Reprex:
Do you have any idea how to solve this?
Best, Ulf
The text was updated successfully, but these errors were encountered: