Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Issue rendering math output from Julia Code #118

Open
mmcky opened this issue Jan 20, 2023 · 0 comments
Open

BUG: Issue rendering math output from Julia Code #118

mmcky opened this issue Jan 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mmcky
Copy link
Member

mmcky commented Jan 20, 2023

Describe the bug

There is an issue when using julia from tools_and_techniques/geom_series.md (QuantEcon Lecture)

```{code-cell} julia
# Creates algebraic symbols that can be used in an algebraic expression
@variables g, r, x0
G = (1 + g)
R = (1 + r)
p0 = x0 / (1 - G * R ^ (-1))
print("Our formula is")
p0
```

When building the Julia lectures if there is generated math from code the ipynb json blob is

   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Our formula is"
     ]
    },
    {
     "data": {
      "text/latex": [
       "$$ \\begin{equation}\n",
       "\\frac{x0}{1 + \\frac{-1 - g}{1 + r}}\n",
       "\\end{equation}\n",
       " $$"
      ],
      "text/plain": [
       "x0 / (1 + (-1 - g) / (1 + r))"
      ]
     },

which gets wrapped in tex as

\begin{sphinxuseclass}{cell_output}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
Our formula is
\end{sphinxVerbatim}
\begin{equation*}
\begin{split} \begin{equation}
\frac{x0}{1 + \frac{-1 - g}{1 + r}}
\end{equation}
 \end{split}
\end{equation*}
\end{sphinxuseclass}\end{sphinxVerbatimOutput}

and xelatex really does not like nested equation environments.

Is this something we could fix in sphinx-jupyterbook-latex?

maybe for Julia we should have nowrap for all math blocks that are generated by code

Reproduce the bug

See Above

List your environment

Julia issue

@mmcky mmcky added the bug Something isn't working label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant