quarto-dev / quarto

Quarto open-source scientific and technical publishing system
https://quarto.org
GNU Affero General Public License v3.0
280 stars 19 forks source link

Inconsistent behaviour when inserting citations from Zotero in visual editor (RStudio and VSCode) #402

Open postylem opened 3 months ago

postylem commented 3 months ago

Bug description

When using the visual editor in RStudio to insert a citation for a conference proceedings paper from Zotero, the resulting biblatex entry that is added to the .bib file is different depending on whether I insert the citation using (1) inline completion versus (2) adding it via the "Insert > Citation ..." menu item. There seems to be a bug in the former that isn't there in the latter, so the resulting bib entry doesn't contain all the necessary information.

(Additionally, unfortunately the bug seems to exist for both insertion methods when using the visual editor in VSCode)

Steps to reproduce

In Zotero, say you have a citation that is type "Conference Paper", with the following data (importantly, it has a "conference name" as well as the title):

Title: A probabilistic Earley parser as a psycholinguistic model Item Type: Conference Paper Author: John T. Hale Date: 2001 Proceedings Title: Second meeting of the North American chapter of the Association for Computational Linguistics Conference Name: NAACL ... etc more information

Then, in RStudio, using the visual editor, there are two ways to add this reference to a document in a quarto project, while automatically importing it to a local references.bib file.

  1. type inline like @hal... and select auto completed citation, then use the "Citation from Zotero" dialogue box to insert the citation into a local bib file (default name 'references.bib'), or
  2. use the Insert > Citation ... menu item to insert citation from My Sources > Zotero, and select this citation item, and click "Insert" to add to references.bib.

Expected behavior

The expected behaviour would be for a new citation to be added to the references.bib file, corresponding to this citation, with all the relevant fields populated (and in particular the correct information in the title field and booktitle field).

Actual behavior

method 1 doesn't work correctly

When using method 1 (inserting a citation by typing "@" and using autocompleted citation), the citation item added to references.bib has a title field populated with the conference name (incorrectly), and no booktitle is added.

The main problem with this ^ bib entry is that it doesn't have the correct info in the title field (it used the "conference name" info from Zotero to populate the title field).

method 2 does work correctly

When using method 2 (inserting a citation via menu), the citation item added to references.bib has a title and booktitle fields populated correctly.

This ^ bib entry is better. Most importantly it has the correct title, and booktitle fields.

In VSCode

When I do the same thing in VSCode's version of the visual editor, I get the same bib entry as method 1 above (the bad behaviour), whether I insert using method 1 or 2.

Your environment

Quarto check output

quarto check output
❯ quarto check
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      Path: /Users/myusername/Documents/GitHub/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.03
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/j/Library/TinyTeX/bin/universal-darwin
      Version: 2023

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.12
      Path: /Users/myusername/.pyenv/versions/3.10.12/bin/python3
      Jupyter: 5.7.1
      Kernels: julia-1.10, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.45
      rmarkdown: 2.25

[✓] Checking Knitr engine render......OK