Skip to content

Eval inside $$ blocks #746

Answered by agoose77
germanesosa asked this question in General
Discussion options

You must be logged in to vote

Hi @germanesosa,

Right now the answer is no. My feeling is that we probably won't support this; parsing {eval} inside LaTeX would require a custom Math parser, which would be a headache. Instead, it would make sense to generate the LaTeX using {eval} in a language that's easier to write and debug e.g. Python

from IPython.display import Latex, display

first = "x"
second = "10"

body = f"""
The equation is ${first} + {second}$
"""
math = Latex(body)

Then embed it using eval

The equation is {eval}`math`

or as a standalone code cell with referenced output.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rowanc1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants