MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Embedding glued Latex Math fails without :label reference

Open psychemedia opened this issue 4 years ago • 0 comments

Describe the problem

Embedding LaTeX extensions using a glue:math tagged block but no equation reference raises an error.

Link to your repository or website

No response

Steps to reproduce

Creating a Latex equation:

import sympy as sym
f = sym.Function('f')
y = sym.Function('y')
n = sym.symbols(r'\alpha')
f = y(n)-2*y(n-1/sym.pi)-5*y(n-2)

And glueing it:

glue("sym_eq", sym.rsolve(f,y(n),[1,4]))

Renders fine if we specify a labelled (albeit empty labelled) equation [re: empty label, see https://github.com/executablebooks/MyST-NB/issues/354]:

```{glue:math} sym_eq
:label: eq-sym
```

But raises an error with the :label reference:

```{glue:math} sym_eq
```

Error is:

Exception occurred:
  File "/usr/local/lib/python3.9/site-packages/docutils/nodes.py", line 625, in __getitem__
    return self.attributes[key]
KeyError: 'math_number'

The version of Python you're using

No response

Your operating system

No response

Versions of your packages

No response

Additional context

No response

psychemedia avatar Sep 25 '21 14:09 psychemedia