Replies: 1 comment 3 replies
-
A partial answer: for centered context, I suggest to use fenced divs in Markdown, and then a pandoc Lua filter to generate the desired output, e.g., function Div (div)
if div.classes:includes 'center' then
return {pandoc.RawBlock('latex', '\\begin{center}'} .. div.content .. {pandoc.RawBlock{'latex', '\\end{center}'}
end
end which should convert input like ::: {.center}
foo
::: to \begin{center}
foo
\end{center} The HTML-output of fenced divs can easily be styled via CSS. TikZ images are handled by the diagram filter. I don't have any immediate ideas for You may also be interested in the pandoc-based tool quarto, as it has a few more layout options built-in. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, I've got a nice setup for generating PDFs using Pandoc. Thanks to Pandoc Flavoured Markdown, I can write my prose in Markdown, have inline math with
$$
, and even write LaTeX with{=latex}
blocks. By using theheader-includes
option in YAML front matter I can even get arbitrary packages working.This is all very nice for outputting PDFs. I would like to output HTML as well, though. A lot of stuff works out of the box (MathML support is very nice). But more complicated things and especially anything using packages is silently dropped -- because there's no obvious way to render them.
I would like to have Pandoc render anything in a
\begin
block as an SVG, to be included in the raw outputted HTML. This would be really nice as I think I could use the div blocks feature to style and size them when desired. Specifically, I would like Pandoc to be able to render the following to HTML (in approx. order of priority):forest
package for syntactic treesbussproof
package for proof trees (this works with--mathjax
alr! but i use mathml)\begin{center}
How might I go about doing this? Are there setups or things that exist for this? I have heard some things about filters, but I'm not sure whether that would be enough. Maybe filters paired with modifying the default template? Any advice would be appreciated :-)
Beta Was this translation helpful? Give feedback.
All reactions