latex-svg-hakyll-0.2: Use actual LaTeX to render formulae inside Hakyll pages

Safe HaskellNone
LanguageHaskell2010

Hakyll.Contrib.LaTeX

Description

This module provides a basic framework to render LaTeX formulae inside Pandoc documents for Hakyll pages.

See the latex-svg page on GitHub for more information.

https://github.com/phadej/latex-svg#readme

Synopsis

Documentation

initFormulaCompilerSVG :: CacheSize -> EnvironmentOptions -> IO (PandocFormulaOptions -> Pandoc -> Compiler Pandoc) Source #

Creates a formula compiler with caching. Can be used as in the following minimal example:

main = do
    renderFormulae <- initFormulaCompilerSVG 1000 'defaultEnv"
    hakyll $
        match "posts/*.markdown" $ do
            route $ setExtension "html"
            compile $ pandocCompilerWithTransformM
                 defaultHakyllReaderOptions
                 defaultHakyllWriterOptions
                 (renderFormulae defaultPandocFormulaOptions)

initFormulaCompilerSVGPure :: EnvironmentOptions -> PandocFormulaOptions -> Pandoc -> Compiler Pandoc Source #

Creates a formula compiler. Can be used as in the following minimal example:

main = hakyll $ do
    let renderFormulae = initFormulaCompilerSVGPure 'defaultEnv"
    match "posts/*.markdown" $ do
        route $ setExtension "html"
        compile $ pandocCompilerWithTransformM
             defaultHakyllReaderOptions
             defaultHakyllWriterOptions
             (renderFormulae defaultPandocFormulaOptions)

type CacheSize = Integer Source #

Number of formula images to keep in memory during a watch session.

compileFormulaeSVG :: EnvironmentOptions -> PandocFormulaOptions -> Pandoc -> Compiler Pandoc Source #

A formula compiler that does not use caching, which works in a more drop-in fashion, as in:

compile $ pandocCompilerWithTransformM (compileFormulaeSVG defaultEnv defaultPandocFormulaOptions)