Skip to content

Conditional content does not work with latex macros #2580

Open
@lcnbr

Description

@lcnbr

Bug description

It seems like macros in hidden divs still get expanded by pandoc. This is problematic as I have defined some macros that only work with mathjax not latex (and vis versa) (for example the mathjax mathtip macro)

::: {.content-visible unless-format="pdf"}

\newcommand{\test}{one}

:::

::: {.content-visible unless-format="html"}

\newcommand{\test}{two}

:::

$\test$

Quarto will complain that the second macro has already been defined irrespective of output. Ideally for macros one should be able to have a sort of preamble for html that gets parsed by pandoc (not just passed through like include-before-body does), thus one could specify which to include in yaml dependent on output wanted

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions