latex-formulae
latex-formulae copied to clipboard
Added PandocFormulaOptions customization helper
I had a problem with changing the colour of rendered equations on my blog. Default ones are black and it doesn't work well with dark backgrounds. I managed to work it around by appending custom preamble to default one. Since it's relatively laborious thing to do, I've abstracted it out.
For example, suppose I want to change font colour to #c5d4db
. Now, mathColour "c5d4db"
returns FormulaOptions
with following preamble
\usepackage{xcolor}
\definecolor{fg}{HTML}{c5d4db}
\everymath\expandafter{\the\everymath \color{fg}}
\everydisplay\expandafter{\the\everydisplay \color{fg}}
Since FormulaOptions
has now Semigroup
instance, we can append it to default preambles, like math
or displaymath
. With customize
we can now easily add new features, e.g.
defaultPandocFormulaOptions `customize` mathColour "c5d4db"
Hope I'm not missing anything and somebody will find it useful.