Hi,
I am using kramdown and I am able to get latex formulas displayed correctly. Now I would like to add an algorithm using the latex package algorithm2e. This answer on the tex.stackexchange shows that it works with markdown and pandoc.
I added the package in a post on my jekyll site using minimal mistakes theme in the preamble and copied the example from stackexchange but the algorithm does not get rendered as expected.
How can I add extra latex packages using kramdown?
The answer of an issue in kramdown states to use a custom latex template. However, I have no idea how to use a new template.
As you suggested I googled already and could not find any helpful information on using latex packages with jekyll.
Your correct, the other links use pandoc and kramdown directly.
I also don’t know if this forum is the right place to ask this kind of question as it is kind of a feature request, I guess. I will post my question on github too.
will strip all of the LaTeX code from an algorithm environment except for the basic $x+y$-type expressions. The links posted above re: custom templates only seem to apply when converting from markdown to LaTeX. The pandoc --filter option only works after the file is parsed. Pandoc parses out the surrounding \begin and \end statements, without making a Div to separate the algorithm environment, so it is nearly impossible to recreate the algorithm using a filter. Does anyone know how to “shield” an environment from pandoc to preserve the raw LaTeX? It would then be easy to run your file through pandoc and add a Liquid tag:
{% include pseudocode.html id="1" code="
\begin{algorithm}
...
\end{algorithm}
" $}
This method will preserve the LaTeX file for compilation to pdf, but the \iffalse statements are ignored by pandoc. It’s sketchy since it seems to rely on a bug, but it works. All that is left is to clean up the \fi and \iffalse lines leftover.
It’d be nice to have a more robust way of telling pandoc how to handle unknown environments though, or at least have it wrap them in a Div so you can process them with a filter.