Handcalcs.Handcalcs
— ModuleModule for better calc documentation.
Handcalcs.get_handcalcs
— Functionget_handcalcs
Get a Dict with the user-specified default kwargs for handcalcs, set by set_handcalcs
.
Handcalcs.reset_handcalcs
— Methodreset_handcalcs()
Reset user-specified default kwargs for handcalcs, set by set_handcalcs
.
Handcalcs.set_handcalcs
— Methodset_default(; kwargs...)
Set default kwarg values for handcalcs.
This works for all keyword arguments. It is additive such that if you call it multiple times, defaults will be added or replaced, but not reset.
Example:
set_handcalcs(cols = 2, spa = 5)
To reset the defaults that you have set, use reset_handcalcs
. To see your specified defaults, use get_handcalcs
.
Handcalcs.@handcalc
— Macro@handcalc expression
Create LaTeXString
representing expression
. The expression being a vaiable followed by an equals sign and an algebraic equation. Any side effects of the expression, like assignments, are evaluated as well. The RHS can be formatted or otherwise transformed by supplying a function as kwarg post
.
Examples
julia> a = 2
2
julia> b = 5
5
julia> @handcalc c = a + b
L"$c = a + b = 2 + 5 = 7$"
julia> c
7
Handcalcs.@handcalcs
— Macro@handcalcs expressions
Create LaTeXString
representing expressions
. The expressions representing a number of expressions. A single expression being a vaiable followed by an equals sign and an algebraic equation. Any side effects of the expression, like assignments, are evaluated as well. The RHS can be formatted or otherwise transformed by supplying a function as kwarg post
. Can also add comments to the end of equations. See example below.
Examples
julia> a = 2
2
julia> b = 5
5
julia> e = 7
7
julia> @handcalcs begin
c = a + b; "eq 1";
d = a - c
e
end
L"$\begin{aligned}
c &= a + b = 2 + 5 = 7\;\text{ }(\text{eq 1})
\\[10pt]
d &= a - c = 2 - 7 = -5
\\[10pt]
e &= 7
\end{aligned}$"
julia> c
7
julia> d
-5
Handcalcs.@handfunc
— Macro@handfunc expression
Create LaTeXString
representing expressions
. These expressions represent a number of expressions that exist within the function that was called. A single expression being a variable followed by an equals sign and the function being called. The expression is evaluated as well (not the expressions within the function). The RHS can be formatted or otherwise transformed by supplying a function as kwarg post
.
Examples
julia> @handfunc Iy = calc_Ix(5, 15)
L"$\begin{aligned}
Ix &= \frac{b \cdot h^{3}}{12} = \frac{5 \cdot 15^{3}}{12} = 1406.25
\end{aligned}$"
julia> Iy
1406.25
Note how Iy is evaluated but Ix is not.