You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Convert both the left and right hand side to expressions of basic types
30
-
# that latexify can deal with.
31
-
32
-
rhs =getfield.(eqs, :rhs)
33
-
rhs =convert.(Expr, rhs)
34
-
rhs = [postwalk(x -> x isa ModelingToolkit.Constant ? x.value : x, eq) for eq in rhs]
35
-
rhs = [postwalk(x -> x isa Expr &&length(x.args) ==1? x.args[1] : x, eq) for eq in rhs]
36
-
rhs = [postwalk(x -> x isa Expr && x.args[1] ==:Differential&&length(x.args[2].args) ==2? :($(Symbol(:d, x.args[2]))/($(Symbol(:d, x.args[2].args[2])))) : x, eq) for eq in rhs]
37
-
rhs = [postwalk(x -> x isa Expr && x.args[1] ==:Differential?"\\frac{d\\left($(Latexify.latexraw(x.args[2]))\\right)}{d$iv}": x, eq) for eq in rhs]
38
-
39
-
var =getfield.(getfield.(eqs, :x),:name)
40
-
ns =getfield.(eqs, :n)
41
-
lhs = [ns[i] ==1? Latexify.LaTeXString("\\frac{d$(Latexify.latexraw(var[i]))}{d$iv}") :LaTeXString("\\frac{d^{$(ns[i])}$(Latexify.latexraw(var[i]))}{d$iv^{$(ns[i])}}") for i in1:length(var)]
0 commit comments