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

How can I export LaTeX block equations to svg using dvisvgm except inline equations? #706

Open
LuciusChen opened this issue Mar 24, 2023 · 0 comments

Comments

@LuciusChen
Copy link

STARTUP: content showstars indent inlineimages hideblocks
#+OPTIONS: toc:nil
#+HUGO_BASE_DIR: ~/Dropbox/hugo/
#+HUGO_SECTION: posts/main
#+HUGO_WEIGHT: auto
#+HUGO_AUTO_SET_LASTMOD: t
#+HUGO_CUSTOM_FRONT_MATTER: :mathjax true
#+LaTeX_HEADER: \usepackage[ruled,LinesNumbered]{algorithm2e}
#+LaTeX_HEADER: \renewcommand{\thealgocf}{}
#+LaTeX_HEADER: \SetKwProg{FnPeriodically}{periodically}{ do}{end}
#+LaTeX_HEADER: \SetKwProg{FnOn}{on}{ do}{end}
#+LaTeX_HEADER: \SetKw{KwSend}{send}
#+LaTeX_HEADER: \SetKw{KwTo}{to}
#+LaTeX_HEADER: \SetKw{KwAppend}{append}
#+LaTeX_HEADER: \SetKw{KwDeliver}{deliver}
#+LaTeX_HEADER: \SetKw{KwDefine}{define}
#+LaTeX_HEADER: \SetKwProg{FnFunction}{function}{}{end}
#+begin_latex
\begin{document}
\begin{algorithm}
\caption{Initialisation}
\FnOn{\textsf{\upshape initialisation}}
{\textsf{\upshape \(currentTerm\) := 0; \(votedFor\) := null}\;
\textsf{\upshape\(log := \langle\rangle; commitLength\) := 0}\;
\textsf{\upshape\(currentRole\) := follower; \(curentLeader\) := null}\;
\(votesReceived := {}; sentLength := \langle\rangle; ackedLength := \langle\rangle\)}

\FnOn{\textsf{\upshape recovery from crash}}
{\textsf{\upshape \(currentRole\) := follower}\;
\textsf{\upshape \(currentLeader\) := null}\;
\(votedReceived := {}; sentLength := \langle\rangle; ackedLength := \langle\rangle\)}

\FnOn{\textsf{\upshape node \(nodeId\) suspects leader has failed, or on election timeout}}
{\textsf{\upshape \(currentTerm := currentTerm + 1; currentRole\) := candidate}\;
\textsf{\upshape \(votedFor := nodeId; votesReceived := { nodeId } ; lastTerm := 0\)}\;
\If{\textsf{\upshape \(log\).length > 0}}{\textsf{\upshape \(lastTerm\) := \(log[log\).length − 1\(]\).term;}}
\textsf{\upshape \(msg\) := (VoteRequest, \(nodeId\), \(currentTerm\), \(log\).length, \(lastTerm\))}\;
\For{\textsf{\upshape each \(node \in nodes\)}}{\KwSend \textsf{\upshape \(msg\) to \(node\)}}
\textsf{\upshape start election timer}}
\end{algorithm}
\end{document}
#+end_latex

MathJax does not support this complex pseudocode, so I would like to be able to export svg to hugo, but after adding #+options: tex:dvisvgm, inline equations will also be converted to svg. I would still like to be able to export block equations to svg separately, while inline equations can be rendered with MathJax.

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