On 2020-11-19 20:27, Norman Ramsey wrote: > I've got a Lua filter that is meant to render certain document elements in > a `boxedminipage` environment. To accomplish this feat, I give the element > in a suitable `div`, and a Lua filter inserts the LaTeX environment. The > document itself remains universal, but the Lua filter is resolutely > intended for LaTeX. > > The filter adds a raw `\usepackage{boxedminipage2e}` to the > `header-includes` of the metadata, but unfortunately when `-V > header-includes=...` appears on the command line, it takes precedence and > the document metadata is ignored. However you can, if the filter appends any includes done in the filter to any existing meta.header-includes list combine it with header-includes defined in a *metadata file* via option --metadata-file=FILE or metadadata-files: in a defaults file using the usual idiom: `````````yaml header-includes: - | ````{=latex} \usepackage{relsize} ```` ````````` Alternatively you may even have a filter collect files and inject their contents into the metadata header includes. Two proof-of-concept filters attached: 1. `inject-includes.lua` shows how you may inject includes dynamically in a filter, either creating the meta.header-includes list or appending them to an existing one. 2. `inject-includes-files.lua` shows how you may inject the contents of a directory `header-includes` into the meta.header-includes list and thus get the best of both worlds! :-) -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3648902d-0ed0-be10-02c6-e5527d6eaaa4%40gmail.com.