You should be able to use `-M header-includes='\usepackage{mypackage}'` or put whatever LaTeX you want in a file and include it with `-H file.tex` but then you can't have any header-includes in your file metadata. In my latex template I have something like this near the top: ```` $for(use-packages)$ if(use-packages.name)$ \usepackage[$for(use-packages.opts)$$use-packages.opts$$sep$,$endfor$]{$ use-packages.name$} $else$ \usepackage{$use-packages$} $endif$ $endfor$ ```` (I wrote this from memory so some details may be wrong.) Now I can do this in my metadata: ```` --- use-packages: - somepackage - name: otherpackage opts: optname - name: thirdpackage opts: - firstoption - secondoption --- ```` and on the command line I can do: ```` -M use-packages=thispackage -M use-packages=thatpackage ```` Also if you are converting from some format other than Pandoc's Markdown you can use the `--metadata-file=metadata.yaml` option and use ```````` header-includes: - | ```{=latex} \usepackage{somepackage} ``` ```````` or custom template stuff and whatever metadata you need in that file. Den fre 17 maj 2019 19:29ivo welch skrev: > > [Apologies. I read the docs twice, but I could not find it. This must be > obvious.] > > I want to include in latex documents a '\usepackage{abc}`, so that my > latex runs (or pdf runs) include it (following kpsewhich, of course). I do > not want pandoc to include the file itself and I do not want to set it in > the yaml header. > > How? > > -- > 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/674a937f-d17b-4c83-b293-e2163e089146%40googlegroups.com > > . > For more options, visit https://groups.google.com/d/optout. > -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBoueM%2BP7N3-9Vq2aYKiu%2BTh3oVwpAwH2TMcaep65BEjw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.