pandoc
pandoc copied to clipboard
Issues with Jupyter notebook + sympy + latex -> pdf
Explain the problem.
Hello everyone!
I was typing down some math with sympy
on a jupyter notebook (using jupyter-lab) and I wanted to export a pdf out of it. I have attached the notebook in the .zip as example.ipynb
. In that notebook I want to use a function to print out in one line some symbolic math using in this minimal example:
def show_my_equation():
display(Markdown(f"[{index}]: ${latex(y)}$ = ${latex(x_1 + x_2)}$"))
In the notebook the equation is displayed just fine.
I then use pandoc to export it as pdf (example_pandoc_from_notebook.pdf
), but the equation is displayed as a Markdown object. This is technically correct, but not useful.
I then tried to export as latex (example_pandoc.tex
) and got the same result.
I finally exported as Markdown (example.md
) and apparently it is correctly interpreted, but then converting that markdown into .pdf (example_pandoc_from_markdown.pdf
) erases the equation display again.
Is this a bug, or a known lack of support of this kind of thing?
Thanks in advance.
As a sidenote, jupyter-lab can't do it either:
I tried to export as .pdf (example.pdf
), but the equations aren't displayed anymore. I also tried to export as LaTeX and the cell output isn't even included in the .tex file.
Pandoc version?
❯ pandoc --version
pandoc 2.12
Compiled with pandoc-types 1.22, texmath 0.12.1.1, skylighting 0.10.4,
citeproc 0.3.0.8, ipynb 0.1.0.1
User data directory: /home/george/.local/share/pandoc
Copyright (C) 2006-2021 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.