On Thursday, 7 October, 2021 at 1:37:34 pm UTC+5:30 BP wrote:
It isn't. Pandoc only ever produces a single output per run, unless something has changed very recently.
Thanks. That clarifies this.
Then you can use a Makefile to run pandoc once for each output with each defaults file:
(watch out for spaces where there should be tabs!)
``````make
all: document.html document.pdf
.PHONY: all
document.html: document.md html.yaml common.yaml
pandoc -d html.yaml $< -o $@
document.pdf: document.md pdf.yaml common.yaml
pandoc -d pdf.yaml $< -o $@
``````
Still nicer than including a loooong command line in the Makefile!
Thanks for this. I've never used a Makefile before, and thought I'd try. I renamed `defaults/cis_ihrl_69a.defaults.yaml` to `defaults/cis_ihrl_69a.common.defaults.yaml` to make it clearer what it was. I included a reference to it in both the html and the pdf defaults files. I then created this as my Makefile:
```make
.PHONY: all html pdf
all : html pdf
html : defaults/cis_ihrl_69a.html.defaults.yaml source/cis_ihrl_69a.md
pandoc -d $<
pdf : defaults/cis_ihrl_69a.pdf.defaults.yaml source/cis_ihrl_69a.md
pandoc -d $<
```
That works great. However, I was hoping for something that would work easily on Windows as well, for collaborators. I think I'll just have to provide them instructions to run two `pandoc -d` commands in sequence.