### Bug description

The cross reference system is broken inside math mode when we want to do theorem proving by equation chaining.

Reproduce:

```
# Test math and theorem proving

::: {#def-mydef}
This definition says that $A = B$.
:::

$$
  B = C 
$$ {#eq-myeq}

$$
\begin{align} 
     A \ &= B   &&, \text{ by } @def-mydef \\
         &= C   &&, \text{ by } @eq-myeq \\
\end{align}
$$

Outside math, references to @def-mydef and @eq-myeq work as expected.
```

More info:

- Quarto 1.2.280
- R studio 2022.12.0 Build 353
- Windows 11 Pro 22H2

### Checklist

- [X] Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] Please [format your issue](https://quarto.org/bug-reports.html#formatting-make-githubs-markdown-work-for-us) so it is easier for us to read the bug report.
- [X] Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] Please document the operating system you're running. If on Linux, please provide the specific distribution.
cscheid
2022-12-26T18:31:33Z
fulem
duplicate enhancement crossref
v1.4
closed
Cross references broken inside math
https://github.com/quarto-dev/quarto-cli/issues/3764