Safe Haskell | None |
---|---|
Language | Haskell2010 |
- convertFormulaDataURI :: ShrinkSize -> EnvironmentOptions -> (MathType -> FormulaOptions) -> Inline -> IO Inline
- convertAllFormulaeDataURI :: ShrinkSize -> EnvironmentOptions -> (MathType -> FormulaOptions) -> Pandoc -> IO Pandoc
- convertFormulaFiles :: NameSupply -> FilePath -> ShrinkSize -> EnvironmentOptions -> (MathType -> FormulaOptions) -> Inline -> IO Inline
- convertAllFormulaeFiles :: NameSupply -> FilePath -> ShrinkSize -> EnvironmentOptions -> (MathType -> FormulaOptions) -> Pandoc -> IO Pandoc
- type NameSupply = IORef Int
- newNameSupply :: IO NameSupply
- type ShrinkSize = Int
Data URIs
:: ShrinkSize | Denominator for all dimensions. Useful for displaying high DPI images in small sizes, for retina displays. Otherwise set to 1. |
-> EnvironmentOptions | System environment settings |
-> (MathType -> FormulaOptions) | LaTeX environment settings for each equation type (display and inline) |
-> Inline | |
-> IO Inline |
Convert a formula in a pandoc document to an image, embedding the image into the HTML using Data URIs.
convertAllFormulaeDataURI Source
:: ShrinkSize | Denominator for all dimensions. Useful for displaying high DPI images in small sizes, for retina displays. Otherwise set to 1. |
-> EnvironmentOptions | System environment settings |
-> (MathType -> FormulaOptions) | LaTeX environment settings for each equation type (display and inline) |
-> Pandoc | |
-> IO Pandoc |
Convert all formulae in a pandoc document to images, embedding the images into the HTML using Data URIs.
Separate Files
:: NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> ShrinkSize | Denominator for all dimensions. Useful for displaying high DPI images in small sizes, for retina displays. Otherwise set to 1. |
-> EnvironmentOptions | System environment settings |
-> (MathType -> FormulaOptions) | LaTeX environment settings for each equation type (display and inline) |
-> Inline | |
-> IO Inline |
Convert a formula in a pandoc document to an image, embedding the image into the HTML using Data URIs.
convertAllFormulaeFiles Source
:: NameSupply | Unique file name supply. Reuse this for every invocation that shares the same image directory. |
-> FilePath | Name of image directory where images will be stored |
-> ShrinkSize | Denominator for all dimensions. Useful for displaying high DPI images in small sizes, for retina displays. Otherwise set to 1. |
-> EnvironmentOptions | System environment settings |
-> (MathType -> FormulaOptions) | LaTeX environment settings for each equation type (display and inline) |
-> Pandoc | |
-> IO Pandoc |
Name Supplies
type NameSupply = IORef Int Source
If we use files for the images, we need some way of naming the image files we produce
A NameSupply provides us with a source of unique names via an ever-increasing integer.
It's important that any invocation of convertFormulaFiles
or convertAllFormulaeFiles
that shares the same image storage directory will also use the same name supply, or they
will overwrite each others images.
newNameSupply :: IO NameSupply Source
Create a new name supply.
Scaling
type ShrinkSize = Int Source
Denominator for various dimensions. For high DPI displays, it can be useful to use values of 2 or 4, so that the dimensions of the image are a fraction of the actual image size, and the image appears more crisp. Otherwise, a value of 1 will always produce sensible, if somewhat pixelated results.