# Notebook Use Case for Mathematicians?

**URL:** https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200
**Category:** Tooling
**Tags:** question, latex, pluto
**Created:** [July 7, 2021, 9:05am UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200 "2021-07-07T09:05:31Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)
#### Post date: [July 11, 2021, 4:19am UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/22 "2021-07-11T04:19:26Z")

</div>

for the reasons you mentioned (Among others) I think [`Neptune.jl`](https://github.com/compleathorseplayer/Neptune.jl) should get more attention.

It should be the sequential form of `Pluto.jl` with reactivity (Adding `LaTeX` reactivity should be a feature added to both).  
Once the community keeps parity between `Neptune.jl` and `Pluto.jl` I think `Neptune.jl` will be come the de factor _Jupyter Notebook_ of Julia with the advantages of being version control friendly to generate standard notes while `Pluto.jl` will become the standard way to generate reactive HTML pages with Julia.

Being sequential and non reactive has many advantages when dealing with large data sets and heavy computations. Hence it is a good complementary to `Pluto.jl`.

---

<div class="post-metadata">

### Author: ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)
#### Post date: [July 11, 2021, 11:42am UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/23 "2021-07-11T11:42:24Z")

</div>

As a wrapup, there are different types of notebooks w.r.t. reactivity and cell order:

1. No reactivity, cells are executed manually. Technically, cell order does not matter but practically cells should be in execution order (or the latter be explicitly documented) so that notebooks are reproducable. Examples: Jupyter, Neptune.jl
2. Reactive notebooks, where cells must be in execution order. This is the request of @kapple if I understand it correctly.
3. Reactive notebooks where cell order in the notebook does not matter. Examples: Observable (JS), Pluto.jl.

Type 2. in Pluto is already possible, but there are no tools available for bringing the cells into execution order. The information however is already in the frontend ([https://github.com/fonsp/Pluto.jl/pull/891](https://github.com/fonsp/Pluto.jl/pull/891) ).  
One idea would be to extend [https://github.com/fonsp/Pluto.jl/pull/1144](https://github.com/fonsp/Pluto.jl/pull/1144) so that pressing Ctrl shows the execution order for all cells. This would allow the users to re-order them if needed.

In general due to the sparsity of developer resources it would be better to concentrate on a few products (I would say Jupyter and Pluto) than forking if there is a way to avoid it.

---

<div class="post-metadata">

### Author: ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)
#### Post date: [July 16, 2021, 10:54am UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/24 "2021-07-16T10:54:55Z")

</div>

Thanks for the summary @lungben.

The only thing I’ll correct is, I was mainly (and unclearly) requesting/wishing for a notebook that would be reactive for mathematics and programming. I suggested cells be in execution order, i.e. top-down execution, because I thought it might assist with reactivity for the mathematics. However, [others](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/12) have clarified that it would not necessarily solve the issue, or might reduce productivity significantly. Starting anew or like you said, forking, is less efficient for development.

As a little criticism of Pluto, I’ll also repeat that in the plethora of presentations, lectures, and courses that use Pluto notebooks, pretty much all of them are presented/read from the top, downwards.

---

<div class="post-metadata">

### Author: ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)
#### Post date: [July 16, 2021, 1:42pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/25 "2021-07-16T13:42:34Z")

</div>

Even if you use the notebook from top downwards, it is good to have the option to move parts which are not required for didactical purposes (like utility functions) to the Appendix.

---

<div class="post-metadata">

### Author: ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)
#### Post date: [July 16, 2021, 1:52pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/26 "2021-07-16T13:52:31Z")

</div>

Yes, agreed. Which is similar to MATLAB scripts having script-defined function blocks at the end of the script.

And even in LaTeX docs, it’s nice to have an appendix that calls for the code source files and prints it all nicely.

I do this too, it’s just that there’s some instances where it would be beneficial to have the top-down evaluation order. I’m not against Pluto’s cell evaluation order, I’m saying it shouldn’t be the only option.

---

<div class="post-metadata">

### Author: ![stochastic\_guy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stochastic_guy/32/9877_2.png) [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)
#### Post date: [July 16, 2021, 2:40pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/27 "2021-07-16T14:40:47Z")

</div>

TexMacs does this, they have a beta version of the julia plugin for TexMacs.

---

<div class="post-metadata">

### Author: ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)
#### Post date: [July 16, 2021, 3:02pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/28 "2021-07-16T15:02:03Z")

</div>

I just watched [a quick tour of TeXmacs](https://youtu.be/H46ON2FB30U). Although I prefer the more programmatic typesetting experience, it’s quite nice. I love Pluto because its use of Julia `String`s is what brings out the documentation texting experience, and you can programmatically play with the strings.

If I understand correctly from [this conversation](http://forum.texmacs.cn/t/julia-programming-language/115), TeXmacs has already demonstrated executing Julia as a kernel through a Jupyter plugin, but now you’re/they’re looking at developing a TeXmacs plugin that calls Julia directly? If so, what will be the difference? Performance?

---

<div class="post-metadata">

### Author: ![stochastic\_guy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stochastic_guy/32/9877_2.png) [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)
#### Post date: [July 16, 2021, 4:27pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/29 "2021-07-16T16:27:34Z")

</div>

Yes, they have a separate standalone plugin: [GitHub - mgubi/tm-julia: TeXmacs plugin for the Julia language](https://github.com/mgubi/tm-julia)  
I haven’t started using TexMacs + Julia in my workflow so can’t comment on the performance and other stuff.

---

<div class="post-metadata">

### Author: ![lungben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lungben/32/12314_2.png) [@lungben](https://discourse.julialang.org/u/lungben)
#### Post date: [July 16, 2021, 5:35pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/30 "2021-07-16T17:35:23Z")

</div>

Issue for showing the cell execution order in Pluto created:

> <https://github.com/fonsp/Pluto.jl/issues/1326>
>
> It would be great to optionally show the execution order of cells in Pluto.
> 
> U…se cases:
> \* notebook debugging
> \* creation of (mostly) linear notebooks for educational purposes (see https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/23?u=lungben)
> 
> In order not to create too much "noise" in the notebook, the execution order could only be shown when hitting the Ctrl key (analogue to https://github.com/fonsp/Pluto.jl/pull/1144).
> 
> The cell order information is already available in the Pluto frontend (see https://github.com/fonsp/Pluto.jl/pull/891), therefore this requires only enhancements on the JS side.

Is there anyone with JavaScript knowledge who wants to do it?

---

<div class="post-metadata">

### Author: ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)
#### Post date: [August 13, 2021, 2:33pm UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/31 "2021-08-13T14:33:14Z")

</div>

I’ve been thinking about your solution that you mention is flawed/suboptimal, i.e.

> [@ess3sq](#):
>
> Execute all cells after a change was made. This would fix LaTeX, but is not viable because if intense calculations are made, you don’t want to have the machine perform them again just because you updated some formula.

This is essentially what Weave.jl does anyway. Each call of `weave(filename)` during document development essentially starts anew, and having a top-down evaluation in Pluto would be a step above what Weave does.

---

<div class="post-metadata">

### Author: ![kapple](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapple/32/218915_2.png) [@kapple](https://discourse.julialang.org/u/kapple)
#### Post date: [September 15, 2024, 2:13am UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/32 "2024-09-15T02:13:44Z")

</div>

Necroposting a solution I’m mostly satisfied with.

Basically the solution is to create the document with [Typst](https://typst.app/).  
You can use the Typst [Jlyfish package](https://typst.app/universe/package/jlyfish/) to run Julia code in your document during the document development. The code and its results are cached to reduce unnecessary code re-runs.  
The VS Code [Typst extension](https://github.com/nvarner/typst-lsp) enables essentially a linearly-executed reactive document preview session.  
And Typst has excellent math syntax, arguably better than LaTeX, at least for me.  
Compiles faster than LaTeX too.

There are few small issues with it, but all of them are acceptable tradeoffs when compared with the alternatives.

---

<div class="post-metadata">

### Author: ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)
#### Post date: [September 15, 2024, 10:16am UTC](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200/33 "2024-09-15T10:16:36Z")

</div>

For completeness – as it was referred to neither in this final post nor in the previous posts – let me mention [Quarto](https://quarto.org) as another option. I am not perfectly sure if it fits all your needs, though. In particular, those fine requirements on Latex. But in general it allows to write texts with Latex math and Julia code cells executed from top to bottom.

[Previous page](https://discourse.julialang.org/t/notebook-use-case-for-mathematicians/64200.md?page=1)
