Insertion point of include-in-header

Open
#13,991 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, latex
Domain
build-system

Research direction

Start by reproducing the supplied Quarto Markdown example with PDF output and inspect the generated TeX preamble, comparing it with the attached demo-2-edited.tex. Done means include-in-header content is emitted after Quarto's generated theorem declaration so the document compiles to PDF.

Written by the indexing model from the issue text.

Description

bug latex
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

Code provided to include-in-header is not inserted at the end of the header.

Steps to reproduce
---
format:
    pdf:
        keep-tex: true
        include-in-header: 
            - text: |
                \usepackage{tcolorbox}
                \usepackage{keytheorems}
                \tcbset{definition_style/.style={}}
                \renewkeytheorem{definition}[style=definition,tcolorbox={definition_style}]
---

::: {#def-prime-number}
## Prime number
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers.
:::
Actual behavior

Latex code fails to compile because \renewkeytheorem precedes \newtheorem{definition}{Definition}[section] inserted by quarto.

Expected behavior

Generates PDF document. The attached tex file works since the code in question has been moved to the end of the preamble.

demo-2-edited.tex.zip

Your environment
  • OS: macOS Tahoe 26.2
Quarto check output
Quarto 1.8.27
[✓] Checking environment information...
      Quarto cache location: /Users/maba/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.3.1: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.8.27
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /Library/TeX/texbin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.11
      Path: /Users/maba/usr/python/global-venv/bin/python3
      Jupyter: 5.7.2
      Kernels: python3, julia-1.11, julia-1.10

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.5.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/maba/Library/R/arm64/4.5/library
        - /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
      knitr: 1.50
      rmarkdown: 2.30

[✓] Checking Knitr engine render......OK
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.