0 votes

I'm embedding latex macros in a Jupyter notebook to document some equations and the macros are only rendering intermittently. 

I define the macros at the top of the notebook with commands like this in a markdown cell: 

$\newcommand{\expect}[1]{{\left\langle #1 \right\rangle}}$


And then use the macros in multiple markdown cells later in the notebook. Sometimes they render correctly. Sometimes they do not (and appear with a red font color, e.g. as \expect x). Most strangely, sometimes some markdown cells render the macros correctly and some do not within the same notebook. This is even after restarting the kernel and running all cells. 
by martini (120 points) | 61 views

1 Answer

0 votes
Hi, thanks for reaching out. We could not immediately reproduce the behavior you are seeing. Would it be possible for you to send a minimal ipynb file to datalab@noirlab.edu that reproduces this on the DL NB server?

Thank you!
by datalab (21.2k points)
Hi, thank you for sending the example notebook. Unfortunately/fortunately, it renders correctly for us. I tried with two different browsers, in case that's the issue (since the Jupyter stuff is not custom to Data Lab).

Could you please a) try with other browsers, b) let us know with which browsers the rendering fails for you, and c) maybe also try with a local JupyterLab? (if you have one installed).

432 questions

448 answers


648 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.