Packages for LaTeX templating in julia (and symbolic algebra)

I want to make some tutorial sheets and fill them with partly randomised questions. I’m thinking of using some kind of template library in julia to replace certain tags in the document with questions (and separately with answers).

I’ve worked with jinja before in python, but ideally there’s a pure julia implementation I can play with. Any suggestions?

While I’m at it, any suggestions for packages to do some symbolic algebra. I’d like to be able to simplify expressions, factorise expressions, rearrange equations to solve for a given variable and solve systems of equations (ideally in julia). All of this is for middle / high school level maths, so I don’t need to be able to solve anything crazy.

It might not fit how you envision this all working, but if you want to leverage a tool like WeBWorK for the task of problem display, randomization, and score management then you might find this unregistered package of interest:

This allows you to author questions for WeBWorK as Julia scripts, using markdown with math markup in LaTeX and Mustache for variable substitution, such as is used for randomization. Randomization is created Julia side, so you can leverage symbolic math in computing acceptable answers (such as provided by SymPy.

Some example scripts for producing a collection of questions can be seen here.

The basic work flow is you write a script, execute it to create a pg file and then add that to a WeBWorK installation. The demo site is useful for debugging a pg file generated by the script.

We use this package for a class, so it has some testing, but for sure there are features to add and bugs to find. If you are interested and find something, please file an issue.

1 Like

I had a look at JuliaWeBWorK, but the lack of tests and docs put me off a little. I also played around with using weave to make sheets, but that’s not quite what I want. I ended up finding Mustache.jl (which I just saw @j_verzani is also involved in, XD). Mustache is pretty much exactly what I was looking for. It’s simple, easy and has everything I need. :slight_smile:

Edit: for symbolic manipulation I found a bunch of packages in pure julia. I’m gonna play with SymEngine.jl for now.

Not that it’s necessarily relevant or problematic, but SymEngine.jl is a wrapper around a C++ library.

The equivalent pure julia package is currently ModelingToolkit.jl

Oops, jup. I got confused. With Reduce, SymPy, ModelingToolkit, SymEngine and more, there are quite a few options at this point.