I'm writing Pandoc LaTeX and Beamer templates that need to include images for corporate branding. So I want to insert an includegraphics command into the template, using the include-before-body option, or even modifying the default template if necessary.

The problem is that at the time pandoc is invoked, we don't know the path to the images,
but we do know their location relative to the "user data directory" (e.g. /home/amy/.local/share/pandoc) and the location of the YAML defaults file.

Here's the directory structure I'm using for testing.

.
├── example.md
└── templates
    └── defaults                  <-- Ultimately this will live in the user data directory
        ├── test.yaml
        ├── body-include.tex      <-- Contains "\includegraphics{test.png}"
        ├── header-include.tex    <-- Contains "\usepackage{graphicx}"
        └── test.png

I have tried two approaches.

1. Using --resource-path. This option can be used to specify locations to look for images. That works fine for images that are included in the main document, but not for images included in the template.

2. Passing some location information to body-include.tex (or the default template if I need to modify that), so it can construct a path to the image. The only way I know of to accomplish this is to use ${.}, but that only works in fields that expect file paths, not in variables that LaTeX or Beamer templates can use, as far as I know.

--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/83ac7dc5-5669-45b9-bfcf-2ffa3b32c512n%40googlegroups.com.