quarto-dev / quarto-dev/quarto
Inserting R Package citations in the Quarto visual editor generates incorrect BibTex
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
This was reported against the RStudio IDE, see https://github.com/rstudio/rstudio/issues/12768 for full details.
The problems start when the citation returned from R is converted to CSL (Citation Style Language) here:
The citeInfo for the "devtools" example is:
{
"type": "Manual",
"title": "devtools: Tools to Make Developing R Packages Easier",
"url": "https://CRAN.R-project.org/package=devtools",
"note": "R package version 2.4.5",
"doi": null,
"publisher": null,
"institution": null,
"address": null,
"journal": null,
"year": "2022",
"booktitle": null,
"chapter": null,
"number": null,
"volume": null,
"pages": null,
"series": null,
"school": null,
"author": [
{
"given": [
"Hadley"
],
"family": "Wickham",
"email": null,
"role": "aut"
},
{
"given": [
"Jim"
],
"family": "Hester",
"email": null,
"role": "aut"
},
{
"given": [
"Winston"
],
"family": "Chang",
"email": null,
"role": "aut"
},
{
"given": [
"Jennifer"
],
"family": "Bryan",
"email": "jenny@rstudio.com",
"role": "aut"
}
],
"editor": []
}
It is transformed to the following, changing the type and losing the note as described in the issue. The type mapping happens in types.ts: bibtextTypeToCSLType().
{
"type": "article",
"title": "devtools: Tools to Make Developing R Packages Easier",
"URL": "https://CRAN.R-project.org/package=devtools",
"author": [
{
"family": "Wickham",
"given": "Hadley"
},
{
"family": "Hester",
"given": "Jim"
},
{
"family": "Chang",
"given": "Winston"
},
{
"family": "Bryan",
"given": "Jennifer"
}
],
"issued": {
"date-parts": [
[
2022
]
]
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/editor/src/behaviors/insert_citation/source_panels/insert_citation-source-panel-packages.tsx at the cited conversion and inspect bibtextTypeToCSLType() in types.ts. Reproduce the devtools citation using the shown citeInfo and compare the generated CSL/BibTeX data. Done means the citation retains the appropriate type and note instead of producing the incorrect output described here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, typescript
- Domain
- content, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100