notZaki / PandocCiter

Visual Studio Code extension for autocompleting citations and cross-references for Pandoc/Markdown documents
https://marketplace.visualstudio.com/items?itemName=notZaki.pandocciter
MIT License
66 stars 9 forks source link

Duplicate references in the compilation output #48

Open YeyouminTian opened 10 months ago

YeyouminTian commented 10 months ago

I was using Pandoc within Visual Studio to compile a Markdown document that contains literature citations. The specific problem arises after compilation: the resulting document displays each referenced bibliography entry twice, leading to duplicate references in the output. This issue persists despite the correct implementation of Markdown syntax for citations and the appropriate setup of the bibliography file (mybib.bib) and the CSL file (china-C.csl) which are correct. Additionally, the YAML header in the Markdown document seems to be correctly formatted with necessary fields like bibliography, csl, and other document settings. The problem appears to be related to the PandocCiter conversion process or possibly the settings or templates used during this conversion.

---
bibliography: ['bibliography.bib']

csl: [china-national-standard-gb-t-7714-2015-numeric-AuLower-Bilan.csl]

title: Test
link-citations: true
lang: en-US
figPrefix:
  - "Fig."
  - "Figs."
linkReferences: true
papersize: a4
colorlinks: true
links-as-notes: true
author: Author
abstract: Abstract
keywords: [nothing, nothingness]

---

Reference[@aidalaHousingStatusMedical2016]

The result of compilation is:

Reference[1]

[1] Matthews R B, Gilbert N G, Roach A, et al. Agent-Based Land-Use Models: A Review of Applications[J/OL]. Landscape Ecology, 2007, 22(10): 1447–1459[2023–12–18]. https://doi.org/10.1007/s10980-007-9135-1. DOI:10.1007/s10980-007-9135-1[1]Matthews R B, Gilbert N G, Roach A, et al. Agent-based land-use models: A review of applications[J/OL]. Landscape Ecology, 2007, 22(10): 1447–1459[2023–12–18]. https://doi.org/10.1007/s10980-007-9135-1. DOI:10.1007/s10980-007-9135-1.

How can I fix it?

notZaki commented 10 months ago

This extension is only a helper for adding in the citation key, so it shouldn't affect the rendering process.

Perhaps some of the YAML settings are creating the duplicates? I would try playing with the linkReferences and links-as-notes settings (perhaps set them to false) and see if that does anything.