Handcalcs.@handcalcMacro
@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.@handcalcsMacro
@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> @handcalcs begin 
    c = a + b; "eq 1";
    d = a - c
end
L"$\begin{align}
c &= a + b = 2 + 5 = 7\text{  }(\text{eq 1})
\\[10pt]
d &= a - c = 2 - 7 = -5
\end{align}$"

julia> c
7
julia> d
-5
Handcalcs.@handfuncMacro
@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{align}
Ix &= \frac{b \cdot h^{3}}{12} = \frac{5 \cdot 15^{3}}{12} = 1406.25
\end{align}$"

julia> Iy
1406.25

Note how Iy is evaluated but Ix is not.