latex-formulae-pandoc 0.2.0.1 → 0.2.0.2
raw patch · 2 files changed
+12/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
latex-formulae-pandoc.cabal view
@@ -1,5 +1,5 @@ name: latex-formulae-pandoc-version: 0.2.0.1+version: 0.2.0.2 synopsis: Render LaTeX formulae in pandoc documents to images with an actual LaTeX installation description: This library provides utility functions to convert LaTeX equations to images in Pandoc documents using the @latex-formulae-image@ package. It requires an actual LaTeX installation to work (@latex@,@dvips@), along with ImageMagick's @convert@ (which needs to understand PostScript)
src/Image/LaTeX/Render/Pandoc.hs view
@@ -105,10 +105,21 @@ (w,h) = (ow `div` shrinkBy o, oh `div` shrinkBy o) in return $ RawInline (Format "html") $ "<img width=" ++ show w +++ " alt=\"" ++ processAltString s ++ "\"" ++ " height=" ++ show h ++ " src=\"" ++ dataUri ++ "\"" ++ " class=" ++ (case t of InlineMath -> "inline-math"; _ -> "display-math") ++ " style=\"margin:0; vertical-align:-" ++ show (b `div` shrinkBy o) ++ "px;\"/>"+ where processAltString = (>>= \case+ '<' -> "<"+ '>' -> ">"+ '&' -> "&"+ '"' -> """+ '\'' -> "&39;"+ '\n' -> " "+ '\r' -> " "+ '\t' -> " "+ x -> [x]) convertFormulaDataURIWith _ _ x = return x -- | A generalisation of 'convertAllFormulaeDataURI' which allows the actual image rendering