I am trying to make a Pluto notebook that is easy to compare the functions made in Pluto and the Codes (in this case AISC 360). Also, it should be as easy to use as possible for everyone to use.
I want the notebook fuunctions look as close as possible to the ones in the Codes, and be hard to use them incorrectly.
begin
using Latexify
using Unitful
import Unitful: π, π
end
Markdown.parse("""
#### Tensile yielding
Calculate the tensile yielding in the gross section.
$(
@latexrun P_ny(
F_y,
A_g
) = F_y * A_g
)
##### Arguments
- ``F_y``: specified minimum yield stress, ``π/π^2``.
- ``A_g``: gross area of member, ``π^2``.
""")
that it renders as
it looks wonderful, but I would like to improve/add the following:
- function only accepts specific units.
- add the function a Label (i.e. this function is (D2-1)).
- remove the arguments when displaying.
and I am struggling to do it by myself, or finding documentation to help me do this.
To only accepts specific units, I tried to add the following:
@latexrun P_ny(
F_y::Unitful.Quantity{<:Real, π / π^2, },
A_g::Unitful.Quantity{<:Real, Unitful.π^2, }
) = F_y * A_g
and get the following error Latexify.jl's latexoperation does not know what to do with one of the expressions provided (<:Real).
In the future, I would like to make it to a Pkg and use Handcalcs.jl
when using it in real projects.
Any advice or comments are welcome.
Thanks,
Eduardo