5 ms·
I tried to get into jupyter the other day, but there's no native way to reference python variables in markdown cells. This seems like an insanely huge oversight
by katmannthree 5y ago
I tried to get into jupyter the other day, but there's no native way to reference python variables in markdown cells. This seems like an insanely huge oversight, being able to include the results of calculations within text and TeX equations would be half the utility of the thing...
- tadfisher 5y agoHuh, you'd think with the prior art [1], it would have this capability. I haven't tried jupyter, but I use and rely on Org which seems like it satisfies the same need. [1]: https://orgmode.org/manual/Evaluating-Code-Blocks.html https://orgmode.org/manual/Evaluating-Code-Blocks.html
- Tarq0n 5y agoR markdown is able to evaluate expressions inline outside of code blocks as well.
- mitchellgoffpc 5y agoIt’s possible, though not quite as clean as you’d like: from IPython.display import display, Markdown as md display(md(f'*pi = {math.pi}*'))
- katmannthree 5y agoTried that, it works well for simple equations but python's string escape character is the same as LaTeX's control character for math objects (\frac{}{}, etc). Doing anything beyond the simplest of equations becomes ridiculously tedious.