Using LaTeX with Hakyll: 2

Using LATEX with Hakyll: 2

Takayuki Muranushi

July 3, 2015

When I wish to write academic articles on my blog, I need to get many things done; the equations, the figures, the hyperlinks and the citations. Since LaTeX, after 35 years, is still an excellent tool for authoring with all those features, I decided it’s good to have the option to write my blog in LaTeX. Here I’ll leave the note how to write Hakyll articles using LaTeX, for people who want to do so, including future me. The source codes are published at the github repository.

This HTML is generated from LATEX source via htlatex and then embedded into Hakyll-hosted blog. The article is generated by two steps. First, you make the article at the post-specific directory, which will invoke htlatex and prepare the HTML for the post. Next, site.hs at the top directory will take the HTML, apply the blog template (headers, menus and so on) and integrate it into the blog. The latter process is usually automated as I run ./site.hs watch. When everything is done, I deploy the entire blog to github.io .

The use of LaTeX will allow us the use of complex expressions e.g. Gμ,ν = 8πcG4Tμ,ν and like Equation (1).

∂⃗v- =  ⃗∇s                          (1)
∂t

This attempt seems to be basically working, and the few glitches of the previous attempt, like the duplicated title is no more there. Fixing these were easy because all I had to do is to have some Hakyll metadata and append them directly to HTML.

The sad thing is the still poor quality of the the math equations rendering, although a little improvement is seen from the LaTeX2HTML version. Some day I’ll try out the technique by Todd.

I am further trying to use this technology in combination with Haskell DSLs such as authoring, units [Muranushi and Eisenberg2014] , units-of-measure plugin [Gundry2015] in order to write physical discussions in Haskell and LaTeX.

References

   A. Gundry. A typechecker plugin for units of measure. In Proceedings of the 2015 ACM SIGPLAN symposium on Haskell, 2015. URL http://adam.gundry.co.uk/pub/typechecker-plugins/.

   T. Muranushi and R. A. Eisenberg. Experience report: Type-checking polymorphic units for astrophysics research in haskell. In 2014 ACM SIGPLAN Symposium on Haskell. ACM, 2014. URL http://dl.acm.org/citation.cfm?id=2633362.

The content of this page is also availabe as a pdf document: Using LATEX with Hakyll: 2.