Preparing tutorials and books

Hi.

I am not sure whther this is the right category for posting my query. I cannot find the appropriate category.

What software or platform do you use for writing Julia languge tutorials and books?
Is it the good old tex or are there any libraries availble for the purpose. I have tried using Weave. Its good for writing tutorials. What options are available for writing longer book length documents containing sections and chapters. R has the excellent bookdwn package. My document will contain many mathematical equations.

1 Like

You could look at Publish.jl.

2 Likes

Pluto.jl maybe?

(I just found out that it is possible to create a table of contents in the notebook, and the looks are very nice, even if simply at the end one exports the notebook to html).

3 Likes

Oops, I forgot DocumenterEpub, which lets you use Documenter.jl to create Epub books.

1 Like

Might be of some help

6 Likes

Latex sounds like the best option.
I am not sure how to include julia code and output in the tex document. Perhaps the listings package. I will give it a try.

1 Like

Take a look at GitHub - sisl/tufte_algorithms_book: A template for textbooks in the same style as Algorithms for Optimization

3 Likes

The video I posted is a talk by someone who wrote and published a textbook in LateX with Julia. They did this with the julia code being run as the book is compiled.

Also this topic has been discussed here: What do you use to embed Julia code in LaTeX?

This is also excellent if you with to produce talk slides with julia code embeded: GitHub - mossr/julia-tufte-beamer: Tufte-style beamer template with Julia integration

2 Likes

I came looking for a topic like this — I’m writing a note-set using Documenter.jl.

Maybe this is a bit niche, but for anyone else wanting to publish open source notes and textbooks online, would you have any interest in a separate Julia registry (not General) for hosting and tracking educational content?

I would recommend taking a look at Quarto which has support for Julia. I’ve used the setup from SISL/TufteAlgorithmBook that @EvoArt mentioned, and it is fairly good, but the environment setup as well as customization is cumbersome. I wish there was a way to do it with Pluto.jl by stitching notebooks together and somehow enabling crossref and references.

There is also Books.jl and Franklin.jl. In particular Books.jl looks nice and they have published book using it.

2 Likes

I am currently using the Tufte algorithms template GitHub - sisl/tufte_algorithms_book: A template for textbooks in the same style as Algorithms for Optimization to write a Julia textbook as referenced a lot in previous posts and it’s really good, but has some pain points. e.g. when wanting to write an algorithm and then use it in the console so I’ve had some work arounds to fix this. Overall, I would recommend it if you are already used to LaTeX and the book is quite long. Having the figures and graphs use the actual code you write is exceptionally useful.

The installation procedure can be a little tedious, but does work on any Linux machine, and I have got it to work on my Windows machine by using the chocolatey package manager to install the packages needed.

1 Like

I’ve been happy with LaTeX, using the publisher’s style file, and IJulia. The mapping from notebook to/from print book is not trivial, but once you figure it out progress is fast. I just finished such a project and had a great time.

If your book will have a significant software component, you should consider building a package for that. This will help you stay organized and give you a convenient way to do CI. I had a very good experience with this and it was much better than trying to do the same thing in Matlab and letting the publisher store the files.

Putting your examples in an IJulia notebook also keeps you organized.

There’s a new Julia-based book that’s worth a look too.

4 Likes