Eval inside $$ blocks #746
Answered
by
agoose77
germanesosa
asked this question in
General
-
Hi! Is there a way to include {eval} in latex or math blocks? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
agoose77
Mar 22, 2024
Replies: 1 comment
-
Hi @germanesosa, Right now the answer is no. My feeling is that we probably won't support this; parsing from IPython.display import Latex, display
first = "x"
second = "10"
body = f"""
The equation is ${first} + {second}$
"""
math = Latex(body) Then embed it using The equation is {eval}`math` or as a standalone code cell with referenced output. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
rowanc1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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. PythonThen embed it using
eval
or as a standalone code cell with referenced output.