latex-svg for blogs in .tex

Posted on 2020-05-10 by Oleg Grenrus

I’m a weird person. I like writing \text{\LaTeX} . With all of its downsides, it’s quite flexible.

This blog post is written in tex file, not markdown. With the help of latex-svg, the included math and some other environments work. We are still constrained by what pandoc supports, but there is a lot.


Let us write few examples of what we can do.



\sin^2 \theta + \cos^2 \theta = 1


\begin{aligned} \sin&39; &= \cos \\ \cos&39; &= - \sin\end{aligned}

work nicely.


As pandoc can preserve raw latex blocks and latex-svg renders them, you can draw tikzcd diagrams:

\begin{tikzcd} A \arrow[r,"f"] & B \end{tikzcd}


Writing tables in markdown is a pain. It is painful in \text{\LaTeX} also but less.

foo bar quu
foo1 2345678 quu9
foo123 456 quu789

#Code snippets

pandoc recognizes code environment. So we get code highlighting!

fact :: Integer -> Integer
fact n = product [2 .. n]

#Rendering as PDF

The benefit of writing posts in \text{\LaTeX} is that you can convert to PDF. You can also start with markdown, and use pandoc to convert it to tex document, and that is what more reasonable people do.


Site proudly generated by Hakyll