packages feed

latex-formulae-pandoc 0.2.0.0 → 0.2.0.1

raw patch · 2 files changed

+4/−4 lines, 2 files

Files

latex-formulae-pandoc.cabal view
@@ -1,5 +1,5 @@ name:                latex-formulae-pandoc-version:             0.2.0.0+version:             0.2.0.1 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
@@ -97,7 +97,7 @@   -> PandocFormulaOptions -- ^ Formula display settings   -> Inline -> IO Inline convertFormulaDataURIWith f o (Math t s) = f (formulaOptions o t) s >>= \case-   Left e -> return $ Str (show e)+   Left e -> return $ errorDisplay o e    Right (b,i) -> let        Right bs = encodeDynamicPng i        dataUri = "data:image/png;base64," ++ BS.unpack (B64.encode bs)@@ -141,7 +141,7 @@   -> PandocFormulaOptions         -- ^ Formula display settings   -> Inline -> IO Inline convertFormulaFilesWith f ns bn o (Math t s) = f (formulaOptions o t) s >>= \case-   Left e -> return $ Str (show e)+   Left e -> return $ errorDisplay o e    Right (b,i) -> do      fn <- readIORef ns      modifyIORef ns (+1)@@ -194,7 +194,7 @@  -- | Render errors nicely, in order to show any problems clearly, with all information intact. displayError :: RenderError -> Inline-displayError ImageIsEmpty           = pandocError  [Str "The rendered image was empty"]+displayError ImageIsEmpty           = pandocError [Str "The rendered image was empty"] displayError CannotDetectBaseline   = pandocError [Str "Cannot detect baseline in rendered image"] displayError (LaTeXFailure str)     = pandocError [Str "LaTeX failed:", LineBreak, Code nullAttr str] displayError (DVIPSFailure str)     = pandocError [Str "DVIPS failed:", LineBreak, Code nullAttr str]