-
DescriptionIn my document, I'm creating my own pdf table of contents in a custom location. Rather than hard-code tocdepth, I do this:
That's my use case. For my MWE, I use the quarto book template, with
And then at the end of index.qmd I add this line:
I know |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
You should use raw code block to include raw content as documented in https://quarto.org/docs/authoring/markdown-basics.html#raw-content Have you considered using partials and templates? Assuming you'll read Quarto and Pandoc documentation to know the name of the options and their locations: Regarding the error, that's because books are complex projects and that the meta shortcode cannot access some if not all global options likely because Quarto uses both TypeScript and LUA for processing of books. What's the purpose of setting |
Beta Was this translation helpful? Give feedback.
-
In LUA, writer options can be retrieved using So you could write a shortcode using Lua that retrieve this value. Or you could use https://github.com/mcanouil/quarto-lua-env as recommended above as described in the README. Example ---
title: "Sample Document"
format: html
toc-depth: 2
filters:
- lua-env
---
TOC DEPTH: {{< meta lua-env.pandoc.PANDOC_WRITER_OPTIONS.toc_depth >}} This may be included in a generic Quarto feature at some point. You can follow |
Beta Was this translation helpful? Give feedback.
The same way as filters: https://quarto.org/docs/extensions/filters.html#activating-filters