Channels

#share-your-work

Title

# share-your-work

s

Sam Ritchie

03/14/2022, 4:16 AMAlong those lines, I have another Clerk demo, this time with interactive animations of physical systems powered by a state of the art ODE solver that lives in the browser.
For this “viewer”, given a Lagrangian (basically a function from some description of a system => kinetic minus potential energy, a SCALAR), the viewer is able to figure out how to physically animate the system. This is bonkers stuff.
Here is a Twitter thread with a link to three videos: https://twitter.com/sritchie/status/1503220063264026629

❤️ 2

k

Konrad Hinsen

03/14/2022, 6:19 AMExcellent. That's the most convincing demo so far for physicists who don't fundamentally care much about programming. I don't know any platform other than Mathematica that could do this - and you can't really share Mathematica with your students.

👍 1

j

Jack Rusher

03/14/2022, 6:59 AM😿 1

👍 1

o

Orion Reed

03/14/2022, 12:16 PMThis was super compelling! I’m really interested in the interactive animations and physics here, but I’d actually love to know more about the TeX integration. Is there somewhere I can read more about that? I’ve only done a little Clojure so maybe it’s nothing novel, but goddamn would I love to have tighter TeX integration in my day-to-day work.

s

Sam Ritchie

03/14/2022, 12:27 PM`+`

, `-`

, `*`

, `/,`

, all the trig operators, `transpose`

, etc etc, and those functions are overloaded for (among other types) numbers and symbolic math. Symbolic math operations simply build up a clojure expression tree, like `(+ (sin x) (expt (cos x) 3))`

2. the library also contains a powerful simplifier that can transform tree => simplified tree…
3. There there is a -TeX> function that can turn this expression into a string of TeX. When you use Clerk to show TeX, it uses `->TeX`

and then points katex or mathjax at the resulting string.
There are some other fun features of `->TeX`

, like, if a symbol is named after a greek letter it gets shown as greek. `'x_1`

, underscores, show up an subscripts, and superscripts work too;❤️ 1

the library can also run in Nextjournal fully in the browser, forget all this hybrid clerk stuff 🙂 scroll down a bit and you can see examples of TeX generation:

`\the{usual}`

, without any ceremony, would be REALLY valuable beyond physics etco

Orion Reed

03/14/2022, 12:49 PMs

Sam Ritchie

03/14/2022, 12:52 PM👍 well let’s keep talking, here or in a Github Discussion on https://github.com/sicmutils/sicmutils if a specific project like, for example, “I want to use ->TeX without thinking about Clojure, from this editor” etc comes to mind

💯 1

k

Konrad Hinsen

03/14/2022, 1:44 PMThis sounds like the beginning of Markdown but for LaTeX. Go ahead! 🙂

🙂 1

💯 2