News for hackers. Stuff that matters.
Re:Jupyter.org now runs its notebooks on WebAssembly by katmannthree on Saturday March 05, 2022 @09:33PM (#30574464)
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...
Re:Jupyter.org now runs its notebooks on WebAssembly by mitchellgoffpc on Sunday March 06, 2022 @01:16AM (#30575453)
It’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}*'))
Re:Jupyter.org now runs its notebooks on WebAssembly by katmannthree on Sunday March 06, 2022 @08:50AM (#30577589)
Tried 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.
Re:Jupyter.org now runs its notebooks on WebAssembly by tadfisher on Saturday March 05, 2022 @10:24PM (#30574749)
Huh, 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

Re:Jupyter.org now runs its notebooks on WebAssembly by Tarq0n on Sunday March 06, 2022 @09:07AM (#30577674)
R markdown is able to evaluate expressions inline outside of code blocks as well.