Source code is not foldable in Rmd using a LaTeX "awesomeblock"?

19 views Asked by At

I'm working on an R Markdown script with several sections and headers, which I would like to be able to fold while I'm writing the document for better overview. Usually, it works like a charm, but I inserted an "awesomeblock" using the awesomebox package along with customizations as suggested here, and after that, the headers were not recognized as sections in the Rmd document anymore. The rendered pdf looks fine and I can't make out any errors in the rendered tex file.

I noticed that creating a code chunk between the awesomeblock and the section header removes the issue, but that seems very clunky to me. How can I get Rmd to recognize my sections even after an awesomeblock?

---
title: "Reprex"
author: "Tave"
date: "2024-03-27"
output:
  pdf_document: 
    toc: true
    number_sections: true
    extra_dependencies: awesomebox
---

# Some header

## Foldable code, all good

::: {.awesomeblock data-latex="[lightgray]{2pt}{\faLightbulb[regular]}{violet}"}
My really cool box
:::

# Another Header

## Code can't fold? 

I'm using TinyTex with R version 4.3.3 (2024-02-29 ucrt) on Win 11

0

There are 0 answers