jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.48k stars 3.38k forks source link

'bibio-files' variable not set when 'bibliography' field is specified in YAML metadata #1661

Closed andrewmwhite closed 9 years ago

andrewmwhite commented 10 years ago

It appears that the 'bibio-files' template variable is not set when the 'bibliography' field is specified in YAML metadata (without '--bibliography' on the command line).

mwe.md:


---
bibliography: mwe.bib
...

Pandoc is great [@pandoc].

mwe.bib:

@misc{pandoc,
  title = {Pandoc: A Universal Document Converter},
  howpublished = {http://johnmacfarlane.net/pandoc},
}

Output with '--bibliography' (as expected):

> pandoc --biblatex --filter pandoc-citeproc --bibliography=mwe.bib -t latex mwe.md | grep bib
\usepackage{biblatex}
\bibliography{mwe}
\printbibliography

Should be the same, but the '\bibliography{mwe}' line is missing:

> pandoc --biblatex --filter pandoc-citeproc -t latex mwe.md | grep bib
\usepackage{biblatex}
\printbibliography

Side note: the '\bibliography' command is deprecated (according to the biblatex manual) and has been replaced with '\addbibresource'.

Version info:

> pandoc --version                                                                                                                                                                                           
pandoc 1.13.1
Compiled with texmath 0.8, highlighting-kate 0.5.9.
<snip>
> pandoc-citeproc --version                                                                                                                                                                                pandoc-citeproc 0.6
azrdev commented 9 years ago

Can confirm that.

> pandoc --version
pandoc 1.12.3.3
...
> pandoc-citeproc --version
pandoc-citeproc 0.3.1
lierdakil commented 9 years ago

Actually, this is expected behavior and not in any way a bug, according to README and changelog. It may be a reasonable enhancement though.

jgm commented 9 years ago

See also #1849, which should be fixed at the same time.

jgm commented 9 years ago

I think what makes sense for this issue and #1849 is the following:

lierdakil commented 9 years ago

@jgm I don't think that if we remove biblio-files, --bibliography should automatically imply -F pandoc-citeproc anymore, since using it with --biblatex/--natbib would be equally feasible option, and using -V bibliography/-M bibliography is somewhat counterintuitive.

pandoc-citeproc may be a reasonable default, if nothing else is specified, but should not be forced.

jgm commented 9 years ago

It's already the case that --bibliography doesn't imply -F pandoc-citeproc if you specify --biblatex or --natbib on the command line as well.

lierdakil commented 9 years ago

Oh, ok. I missed that.

jgm commented 9 years ago

Closed by f0817e19527dc366339c070ac814e71f6483f6f6 and c6debff1f898b0fd6a36efe8397dbfd18b84cacf

bscottm commented 9 years ago

For LaTeX: bad idea to escape underscores in file names (was doing some independent testing).

\addbibresource{foo_bar.bib} % works \addbibresource{foo_bar.bib} % no data source