quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.58k stars 295 forks source link

link-citation activated when suppress-bibliography is true throw a LaTeX compilation error due to missing citeproc command #7439

Closed cderv closed 6 months ago

cderv commented 8 months ago

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/7431

Originally posted by **cderv** October 31, 2023 I believe this is an issue with Pandoc itself. Take this example ````markdown --- title: test references: - type: article-journal id: WatsonCrick1953 author: - family: Watson given: J. D. - family: Crick given: F. H. C. issued: date-parts: - - 1953 - 4 - 25 title: 'Molecular structure of nucleic acids: a structure for deoxyribose nucleic acid' title-short: Molecular structure of nucleic acids container-title: Nature volume: 171 issue: 4356 page: 737-738 DOI: 10.1038/171737a0 URL: https://www.nature.com/articles/171737a0 language: en-GB link-citations: true suppress-bibliography: true --- See @WatsonCrick1953 for additional discussion ```` Now render with ````powershell quarto pandoc -f markdown -t latex -s --citeproc -o test.pdf test.qmd ```` You will get the error; You could also do `-o test.tex` and look inside the file - there is no defintion of the `\citeproc` command. Remove `suppress-bibliography: true` and run ```powershell quarto pandoc -f markdown -t latex -s --citeproc -o test.tex test.qmd ``` The citation information from pandoc are correctly inserted ````tex % definitions for citeproc citations \NewDocumentCommand\citeproctext{}{} \NewDocumentCommand\citeproc{mm}{% \begingroup\def\citeproctext{#2}\cite{#1}\endgroup} ```` It comes from template https://github.com/jgm/pandoc/blob/d3d0406515cb6aae6f43e60dfa37014bdd91e79c/data/templates/default.latex#L337-L341 so somehow something deactivate the insertion. or did not change the use of ````tex (\citeproc{ref-WatsonCrick1953}{1953}) ```` Running with Quarto 1.3 which has a different pandoc we see that the .tex is changed ````tex (\protect\hyperlink{ref-WatsonCrick1953}{1953}) ```` This means this is an issue between this two version of pandoc Doing a bit of bisecting with pandoc version, first one to fail is 3.1.7 (https://github.com/jgm/pandoc/releases/tag/3.1.7) They did some changes about LaTeX writer and citation linking. So possibly related. I'll open an issue upstream.
cderv commented 8 months ago

Though I am thinking we can deactivate link-citations maybe if suppress-bibliography: true as this is not working (and not useful and it links nowhere.... 🤔 )

cderv commented 8 months ago

Issue opened

cderv commented 8 months ago

This has now been fix in dev pandoc: https://github.com/jgm/pandoc/commit/db92f61f1e29f7da63016e2f86400097bafdb214

It will be available in next Pandoc, so soon in quarto...

cderv commented 6 months ago

We've update to Pandoc 3.1.11, so this should be closes now