The order of #commandline parameter generally doesn't matter for #pandoc, but there are cases when the order becomes relevant. We'll collect some examples below:
Setting the output file when printing a default template: All parameters after `--print-default-template`/`-D` are ignored, only the preceding ones are respected. E.g., this writes the default LaTeX template to `default.tex`
pandoc -o default.tex -D latex
while this prints the template to the terminal
pandoc -D latex -o default.tex
Filters run in the order in which they are given on the command-line. This includes the built-in filter `citeproc`. I.e., the command
pandoc -F pandoc-crossref --citeproc -L diagram.lua …
will let pandoc run the JSON filter `pandoc-crossref` first, processes citations in the once-filtered document, and finally run the `diagram.lua` Lua filter. The order is important when filters interact.
#pandoc #pandocFilter
Default files are searched in the data directory, which can be set via `--data-dir`. However, this option affects the `-d`/`--defaults` options that come *after* `--data-dir`.
Example:
pandoc -d pdf --data-dir=./data
will look for the file `defaults/pdf.yaml` in the default data directory, but
pandoc --data-dir=./data -d pdf
will check for `./data/defaults/pdf.yaml`.