Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latexify rendering #4

Open
arnold-c opened this issue Jun 16, 2022 · 0 comments
Open

Latexify rendering #4

arnold-c opened this issue Jun 16, 2022 · 0 comments

Comments

@arnold-c
Copy link

I was wondering if it would be possible to add support for Latex strings? The package Latexify is pretty useful for producing and displaying the differential equations used in your code, but unfortunately they are not correctly rendered with Quarto (korsbo/Latexify.jl#222). I have tried to convert it using Markdown.parse(), but sadly this also does not render.

MWE below.

Using ParameterizedFunctions, Latexify

sir_ode = @ode_def SIRModel begin
    dS = -β*S*I
    dI = β*S*I-γ*I
    dR = γ*I
    end β γ

latexify(sir_ode)

Output in the notebook (i.e. doesn't render the equation):

L"\begin{align}
\frac{dS(t)}{dt} =&  - \beta I\left( t \right) S\left( t \right) \\
\frac{dI(t)}{dt} =&  - \gamma I\left( t \right) + \beta I\left( t \right) S\left( t \right) \\
\frac{dR(t)}{dt} =& \gamma I\left( t \right)
\end{align}
"
latexify(sir_ode) |> Markdown.parse        # or Markdown.parse("$(@latexrun $(sir_ode))")
  \begin{align} \frac{dS(t)}{dt} =& - \beta I\left( t \right) S\left( t \right) \ \frac{dI(t)}{dt} =& - \gamma I\left( t \right) + \beta I\left( t \right) S\left( t
  \right) \ \frac{dR(t)}{dt} =& \gamma I\left( t \right) \end{align}

Screen Shot 2022-06-14 at 21 26 31

A similar result occurs when using the suggested Markdown.parse(latexify(sir_ode), double_linebreak=true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant