quarto-dev / quarto

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

Possibility for a default .bib file for citation autocomplete? #321

Open filippogambarota opened 1 year ago

filippogambarota commented 1 year ago

Hi! For Quarto documents I commonly use a .bib file hosted on Github like this:

bibliography: "link"

Of course, Quarto is not able to suggest the citations but as a workaround, I used the pandoc citer extension that unfortunately there is a conflict because it is triggered by the "@". I wondered if one could set a general file (e.g., hosted locally) that quarto uses to autocomplete citations.

cderv commented 1 year ago

Did you try already the Visual Editor (in VSCODE for example) ? See https://quarto.org/docs/visual-editor/vscode/

It has support for autocompletion when using @. It should use any file used in bibliography YAML field. It seems like the pandoc citer extension you shared.

Quarto Visual editor also integrates with Zotero for globally stored reference.

Hope it helps

filippogambarota commented 1 year ago

Yes, personally I use the source version of the document. The problem is that the bib file needs to be placed in the YAML. I was wondering if there could be the possibility to set a general bib file to be used for all qmd files to use for autocompletion. I generally specify the bib file as an url (pointing to a github repo) thus the autocompletion is not working. The pandoc citer extension allows setting a general bib file in the extension settings.

cderv commented 1 year ago

to be used for all qmd files

All qmd in a single Quarto project ? Or globally on your computer ?

filippogambarota commented 1 year ago

to be used for all qmd files

All qmd in a single Quarto project ? Or globally on your computer ?

ideally, whenever I open a qmd file in vscode, the "@" triggers autocomplete for cross-refs and bib keys (based on the global file). Then the actual bibliography is based on the file defined in the yaml header.

roaldarbol commented 7 months ago

Just chiming in here. I could see a solution where it would be possible to specify a project-wide .bib file, to be used in all the files recursively. After all, VS Code is based on project folders, so it makes sense to be able to specify a project-wide bibliography.

The option to specify the file could have it's own shortcut/entry in the dropdown menu. And then, once specified, it should be used as default, but you could retain the option of choosing an alternative within the Citation Picker.