quarto-dev / quarto-dev/quarto-cli
Named equations are incompatible with referencing equations
Open
@cscheid is already working on this.
Since Dec 4, 2023.
crossref
enhancement
math
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
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.
Black-Scholes (@eq-black-scholes) is a mathematical model that seeks to explain the behavior of financial derivatives, most commonly options:
$$
\begin{equation*}
\frac{\partial \mathrm C}{ \partial \mathrm t } + \frac{1}{2}\sigma^{2} \mathrm S^{2} \frac{\partial^{2} \mathrm C}{\partial \mathrm C^2} + \mathrm r \mathrm S \frac{\partial \mathrm C}{\partial \mathrm S}\ = \mathrm r \mathrm C \tag{Black--Scholes Equation}
\end{equation*}
$${#eq-black-scholes}
This is exactly the same as above.
$$
\begin{equation}
\frac{\partial \mathrm C}{ \partial \mathrm t } + \frac{1}{2}\sigma^{2} \mathrm S^{2} \frac{\partial^{2} \mathrm C}{\partial \mathrm C^2} + \mathrm r \mathrm S \frac{\partial \mathrm C}{\partial \mathrm S}\ = \mathrm r \mathrm C \tag{Black--Scholes Equation}
\end{equation}
$${#eq-black-scholes}
This fails to compile:
$$
\frac{\partial \mathrm C}{ \partial \mathrm t } + \frac{1}{2}\sigma^{2} \mathrm S^{2} \frac{\partial^{2} \mathrm C}{\partial \mathrm C^2} + \mathrm r \mathrm S \frac{\partial \mathrm C}{\partial \mathrm S}\ = \mathrm r \mathrm C \tag{Black--Scholes Equation}
$${#eq-black-scholes}
This breaks the reference:
\begin{equation}
\frac{\partial \mathrm C}{ \partial \mathrm t } + \frac{1}{2}\sigma^{2} \mathrm S^{2} \frac{\partial^{2} \mathrm C}{\partial \mathrm C^2} + \mathrm r \mathrm S \frac{\partial \mathrm C}{\partial \mathrm S}\ = \mathrm r \mathrm C \tag{Black--Scholes Equation}
\end{equation}
{#eq-black-scholes}
Expected behavior
No response
Actual behavior
No response
Your environment
Windows 11
Quarto check output
>quarto check
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.3.450
Path: C:\Users\user\AppData\Local\Programs\Quarto\bin
CodePage: 1252
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.11.5 (Conda)
Path: C:/Users/user/miniconda3/python.exe
Jupyter: 5.3.2
Kernels: python3
(/) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[>] Checking Jupyter engine render....OK
[>] Checking R installation...........OK
Version: 4.3.1
Path: C:/PROGRA~1/R/R-43~1.1
LibPaths:
- C:/Users/user/AppData/Local/R/win-library/4.3
- C:/Program Files/R/R-4.3.1/library
knitr: 1.44
rmarkdown: 2.25
[>] Checking Knitr engine render......OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.