How to show math equations in theorem environment names

I have been writing a book in bookdown over the last several years. When bookdown moved to the new theorem environments based on Pandoc's fenced div blocks and I changed all of my theorem blocks to this new format, I ran into the problem that math equations no longer print out correctly when they are included in the text to the name argument. For example, the following Proposition does not display math in the name when the file is rendered:

::: {.proposition name="Standard error for $\\hat{\\mu_i}$"}
The standard error for $\hat{\mu}_{i},$ $\mathrm{se}(\hat{\mu}_{i}),$
can be calculated exactly and is given by: 
\begin{equation}
\mathrm{se}(\hat{\mu}_{i})=\frac{\sigma_{i}}{\sqrt{T}}.(\#eq:semuhat)
\end{equation}
:::
1 Like

This issue likely stems from Pandoc not processing LaTeX math inside the name attribute. A workaround is to use raw LaTeX inside name by escaping brackets:

::: {.proposition name="Standard error for \\(\hat{\\mu_i}\\)"}

Alternatively, define the theorem title in the body rather than the name attribute to ensure proper math rendering. If the issue persists, consider reporting it to the Bookdown or Pandoc maintainers for potential fixes.