230 points · by fish45 · 5y ago · 45 comments
I've posted on r/rust as well (https://www.reddit.com/r/rust/comments/lqn5aa/calculatex_a_p...), and there seems to be interest in using it for scientific papers and such.
The only alternative I know of is PTC MathCAD, which is quite powerful and definitely worth looking into. However, it's quite expensive and Windows only.
The main repo (a Rust library and basic CLI) can be found here: https://github.com/mkhan45/CalcuLaTeX
The website repo using WASM and very hacky JS can be found here: https://github.com/mkhan45/CalcuLaTeX-Web
Is there a way to get the LaTeX source with the completed calculation (so that you can copy/paste the whole thing in your local LaTeX installation and, well, hand in your homework)? (sort of a "middle" tab)
The pictures give you the radius of the blast as a function of time.
All that could be important In determining the radius R as a function of time are the initial energy released, E, and the density of the undisturbed medium, Rho.
Thanks to your natural curiosity, you know the value of dimensional analysis and reason that the radius, with dimensions of length, must depend only on E, rho, and t, for which the correct expression can only be:
R(t) = (E/Rho t^2)^(1/5)
Since E/Rho has dimensions of (length)^5/time^2
A log-log plot of r vs t (imagine measuring the radius of the blast and carefully noting time stamps given in the picture captions) gives a slope of 2/5, checking the theory, and E/Rho could be obtained from extrapolation to the value of log R when log t= 0. Rho is known For air and thus E was determined to within a factor of order 1.
For the practitioner of dimensional analysis, the nations deepest secret had been published in Life magazine. (Goldstein States of Matter, chapter 6)
Ah, but how best to convey the findings? Surely the best way is to use a mathcad like, But open source tool which prints straight to latex!
Ah ...if only it could express fractional units...
GI Taylor prepares a letter to John wheeler, requesting a closed time like networked computing device so that the feature request can be made.
In all seriousness though, This project is awesome! Just kick in fractional unit support and it will surely be unstoppable.
GI Taylor should be able to publish his findings by the end next week
My main suggestion is better error handling: make it so that when a calculation is invalid, it shows the error where the result would be (e.g. red text with the error message) instead of failing to compile the whole script.
What made you choose LaTeX for the tool?
It seems like it wouldn't be too hard (maybe?) to get a proper algebra engine to assign variables. Currently you can do `x = 10` but you can't do `x / 2 = 5`. I feel like this would be very helpful since you're using this for scientific calculations.
It could then be possible to extend that further and leave the variable undefined if it doesn't (yet) have enough information to solve it. Then it could theoretically be used to solve simultaneous equations.
I was originally planning to use MathJax and HTML or Markdown but honestly it wasn't a completely conscious decision.
About proper algebraic stuff, it is a long term goal to have at least a basic polynomial solver, but I've no experience in the area and I'm not sure how far it can go.
One thing that’d make this even more awesome is the ability to drop in a data table and have it show up as a graph. The scripts I built in college allowed me to drop a CSV file into a directory and have it automatically turned into an EPS graph that I could use in LaTeX. It made for pretty easy, but very good looking reports.
[1] http://calca.io/
Typora is my favorite Mac Markdown editor: It looks like a plain word processor file, hiding the markdown annotations, but they're still there and can be edited. I think it's ideal.
5 kg + 5 kg = 10 kg
but
5 kg + 6 kg = 11.000 kg
yeah that's not supposed to happen. I'm not completely sure what's up there but thanks for the report
km/h doesn't work but km/hour does. I haven't added h as an alias for hour since it's also the SI prefix for hecto.
We have Windows app and beta web app. Also Mac app coming soon. It's free for students and otherwise still inexpensive.
Currently happily using smath studio which is free.