Closed co1emi11er2 closed 4 months ago
I think this will be very difficult to do. How does Latexify know to expand a
but not sqrt
?
You could have some kind of "special kind of Symbol
" that gets interpolated in the first step, but you'll get to the point where it's probably easier to just say LaTeXString("x = \\sqrt{a-b} = \\sqrt{$a-$b} = $(x = sqrt(a-b))")
.
If someone has a good idea for implementation it would be cool, but I don't think I'll try.
Use Symbolics.jl? It uses Latexify to render. What you're looking for is just a symbolic library that renders to Latex?
Does Symbolics.jl do it all in one line? Numeric substitution and all? I thought Symbolics.jl would do the symbols and then you would later have to define the variables afterwards?
It looks like I was able to get a rough version working. I have written this same functionality in excel vba, but with latexify I can render in latex. This needs to be cleaned up but here is a first example. The only thing left is to get the h to evaluate.
Here is excel version:
Here is rough julia version.
It seems like I got things working quite well. It even works with Unitful!
I am very new to julia (couple days), so I could use some help on path forward. Should this be implemented here or should I create a new package? I only modified/added 2 lines to the latexdefine macro to get this working. I could use a little help too since I was wanting to get multiple lines (begin and end cells) to work as well.
That looks pretty cool 🙂 It's a form of usage that I've not really paid much attention to. What's the modification that you made?
It was originally just 2 modified lines, but I've tweeked it a bit. Here is the code. the highlighted portion is what is different from latexdefine.
I wanted to add the ability to add a reference to the side of the calc or any helpful comments. This is a video of the process so far. I am able to parse multiple lines, but it doesn't compute unless I call lines individually. Here is an example video of what I am trying to workout currently.
https://github.com/korsbo/Latexify.jl/assets/143426779/cac07086-1828-4be6-81bd-cd22eadba63a
I developed my own package for this. See Handcalcs.jl if interested.
Hi,
First off, thank you for the amazing package. It is very helpful.
I had a feature that I wanted to request.
@latexdefine executes the expression, and latexifies the expression together with its value.
Could you implement another macro (or modify @latexdefine) that executes the expression, and latexifies the expression together with symbols, then with values of symbols, then with resulting value?
For example, here is a package in python that does this called handcalcs:![image](https://github.com/korsbo/Latexify.jl/assets/143426779/1d6b6c67-f9e8-4137-9e2b-63df320bea23)
This package can also be used to parse and latexify functions.![decorator](https://github.com/korsbo/Latexify.jl/assets/143426779/6fb30a89-7a3f-4ecc-8e57-6b173b4d0518)
Another huge feature is the ability to add comments to the side of equations.![image](https://github.com/korsbo/Latexify.jl/assets/143426779/74946cc9-690c-4320-ab14-2e77c1e85b71)
I am a structural engineer who is starting to see some of the downsides to excel, and I am trying to decide the best programming language to use to develop tools with. I really like some of the things I have heard about Julia, and I like what Pluto offers over Jupyter. If there was a package like this, I think it would give me some runway to start writing in Julia.
Thanks, Cole