Skip to content

Pandoc replacing underscores in bibliography by UTF-8 bytes #11152

@dominikmg

Description

@dominikmg

Hi everyone, first thanks for your work! I have a small bug with bibliography path:

Explain the problem.
Absolute paths with underscores in bibliography get escaped into invalid LaTeX
For example:

pandoc draft.md \
  --from=markdown \
  --to=latex \
  --bibliography=/Users/example_user/reference_dominik.bib \
  -o draft.tex
``

I am using the following defaults: 

pdf-engine: latexmk
pdf-engine-opt:
- "-lualatex"
- "-bibtex"
cite-method: natbib


It is probably similar to https://github.com/jgm/pandoc/issues/2921 but for the bibliography.

--bibliography=references_dominik.bib

is converted to

\bibliography{references\_dominik.bib}

Also _ in the path are incorrectly. But the _ un the path should remain unchanged. Pandoc should not escape underscores inside bibliography file paths, only inside bibliography entry fields (like titles).

**Pandoc version?**
pandoc 3.8
Features: +server +lua
Scripting engine: Lua 5.4
MacOS ARM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions