### 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)

```quarto
::: {.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


2022-09-23T15:35:26Z
lcnbr
bug
Future
open
Conditional content does not work with latex macros
https://github.com/quarto-dev/quarto-cli/issues/2580