Open yuxi-liu-wired opened 9 months ago
Thanks for the report!
Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks.
Including the format in which it is not working.
Note that unless a complicated and long equation is required, a small one is preferable.
Also, the numbering here is done by MathJax (when HTML format) and using$$
syntax.
You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````
).
````qmd
---
title: "Quarto Playground"
format: html
---
Cross-reference to @eq-demo.
$$
\begin{equation*}
X + Y \tag{A name}
\end{equation*}
$$ {#eq-demo}
Related threads:
- #4132
Playing with MathJax/LaTeX is a bit tricky and you'll have to read the corresponding documentations.
HTML | |
---|---|
---
title: "Quarto Playground"
format:
html: default
pdf: default
---
::: {.content-visible when-format="pdf"}
## PDF
Cross-reference to \ref{eq-demo}.
\begin{equation}
X + Y \tag{A name} \label{eq-demo}
\end{equation}
:::
::: {.content-visible when-format="html"}
## HTML
Cross-reference to \ref{eq-demo}.
\begin{equation}
X + Y \tag{A name} \label{eq-demo}
\end{equation}
:::
@mcanouil your example is not using the Cross ref syntax (https://quarto.org/docs/authoring/cross-references.html#equations)
I believe our cross reference system work on Numbers and not name. Not sure we can change that for equation, and indeed not using Quarto cross ref for that is required.
Is that the conclusion for you ?
Yes.
Some additional work on equation cross-ref might lift this limitation in 1.5.
Ok you labelled support so maybe we should label this as feature request instead right ?
Let's make a future enhancement.
Bug description
I can't get it to create a named equation while also referencing it.
Steps to reproduce
Here are several possible attempts. All of them produce the wrong result:
This one has an extraneous
(1)
number.This is exactly the same as above.
This fails to compile:
This breaks the reference:
Expected behavior
No response
Actual behavior
No response
Your environment
Windows 11
Quarto check output