Skip to content

'Insert citation' not identifying all articles where multiple articles from same author in same year (and duplicating entries in bib file) #14409

Open

Description

@befriendabacterium

System details

RStudio Edition : Desktop
RStudio Version : RStudio 2023.6.1.524
OS Version      : Windows 10 x64 (build 19045), 
R Version       :   4.3.1 (2023-06-16 ucrt)

Steps to reproduce the problem

The folder in Zotero has three refs from same year:

image

In Zotero I export this as a standard .bib file (in this case called 'workingversion.bib'):

image

The contents of which is this:

@misc{viechtbauerForestPlotAggregated2022,
	title = {Forest {Plot} with {Aggregated} {Values} [{The} metafor {Package}]},
	url = {https://www.metafor-project.org/doku.php/tips:forest_plot_with_aggregated_values?s%3E[]=forest&s[]=plot&s[]=aggregated},
	urldate = {2024-01-22},
	journal = {The metafor Package: A Meta-Analysis Package for R},
	author = {Viechtbauer, Wolfgang},
	month = aug,
	year = {2022},
	file = {Forest Plot with Aggregated Values [The metafor Package]:C\:\\Users\\mlj206\\Zotero\\storage\\NW7PZHUJ\\tipsforest_plot_with_aggregated_values.html:text/html},
}

@misc{viechtbauerCrede2010Metafor2022,
	title = {Credé et al. (2010) [{The} metafor package]},
	url = {https://www.metafor-project.org/doku.php/analyses:crede2010?s[]=multiple&s[]=outcomes#intraclass_correlation_of_the_true_outcomes},
	journal = {The metafor Package: A Meta-Analysis Package for R},
	author = {Viechtbauer, Wolfgang},
	year = {2022},
}

@misc{viechtbauerComparisonRmaUni2022,
	title = {A {Comparison} of the rma.uni() and rma.mv() {Functions} [{The} metafor {Package}]},
	url = {https://www.metafor-project.org/doku.php/tips:rma.uni_vs_rma.mv?s[]=random&s[]=effects},
	urldate = {2024-02-28},
	journal = {The metafor Package: A Meta-Analysis Package for R},
	author = {Viechtbauer, Wolfgang},
	month = aug,
	year = {2022},
	file = {A Comparison of the rma.uni() and rma.mv() Functions [The metafor Package]:C\:\\Users\\mlj206\\Zotero\\storage\\Z5JA2K6R\\tipsrma.uni_vs_rma.html:text/html},
}

I go into my RMarkdown doc with Visual editor turned on, and use the Insert Citation feature to reference these three articles, but it only finds one of them (Bug 1 🐛):

image

I proceed to add this reference anywya, which adds the reference to my RMarkdown doc with a new tidy key:

image

However, it also creates a new entry for this key in the bib file, duplicating a reference (Bug 2 🐛):

@misc{viechtbauerForestPlotAggregated2022,
title = {Forest {Plot} with {Aggregated} {Values} [{The} metafor {Package}]},
url = {https://www.metafor-project.org/doku.php/tips:forest_plot_with_aggregated_values?s%3E[]=forest&s[]=plot&s[]=aggregated},
urldate = {2024-01-22},
journal = {The metafor Package: A Meta-Analysis Package for R},
author = {Viechtbauer, Wolfgang},
month = aug,
year = {2022},
file = {Forest Plot with Aggregated Values [The metafor Package]:C:\Users\mlj206\Zotero\storage\NW7PZHUJ\tipsforest_plot_with_aggregated_values.html:text/html},
}

@misc{viechtbauerCrede2010Metafor2022,
title = {Credé et al. (2010) [{The} metafor package]},
url = {https://www.metafor-project.org/doku.php/analyses:crede2010?s[]=multiple&s[]=outcomes#intraclass_correlation_of_the_true_outcomes},
journal = {The metafor Package: A Meta-Analysis Package for R},
author = {Viechtbauer, Wolfgang},
year = {2022},
}

@misc{viechtbauerComparisonRmaUni2022,
title = {A {Comparison} of the rma.uni() and rma.mv() {Functions} [{The} metafor {Package}]},
url = {https://www.metafor-project.org/doku.php/tips:rma.uni_vs_rma.mv?s[]=random&s[]=effects},
urldate = {2024-02-28},
journal = {The metafor Package: A Meta-Analysis Package for R},
author = {Viechtbauer, Wolfgang},
month = aug,
year = {2022},
file = {A Comparison of the rma.uni() and rma.mv() Functions [The metafor Package]:C:\Users\mlj206\Zotero\storage\Z5JA2K6R\tipsrma.uni_vs_rma.html:text/html},
}

@misc{viechtbauer2022a,
title = {A Comparison of the rma.uni() and rma.mv() Functions [The metafor Package]},
author = {Viechtbauer, Wolfgang},
year = {2022},
month = {08},
date = {2022-08-03},
url = {https://www.metafor-project.org/doku.php/tips:rma.uni_vs_rma.mv?s[]=random&s[]=effects}
}

The preamble of the RMarkdown doc should look something like (apologies i cannot attach here because github does not accept this file format):

---
title: "Multiple articles per author bug"
author: "Matt Lloyd Jones"
date: "2024-03-11"
output: html_document
bibliography: workingversion.bib
---

workinversion.bib should be in same directory as RMarkdown doc, for clarity.

Describe the problem in detail

RStudio/RMarkdown struggles to identify all papers where there are multiple papers from the same author from the same year (meaning I can't cite them all). I'm not sure but it might be limited to RStudio/RMarkdown's "Insert Citation" feature in the Visual editor linking to Zotero. It also duplicates any articles that are added in the bibliography file, but with a new, 'tidy' citation key.

Describe the behavior you expected

All articles should appear in the VisualEditor (Bug 1). Citation keys should be changed not duplicated in .bib file (Bug 2).

Checklist

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Session Info

R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045), RStudio 2023.6.1.524

Locale:
LC_COLLATE=English_United Kingdom.utf8 LC_CTYPE=English_United Kingdom.utf8 LC_MONETARY=English_United Kingdom.utf8
LC_NUMERIC=C LC_TIME=English_United Kingdom.utf8

time zone: Europe/London
tzcode source: internal

Package version:
base64enc_0.1.3 bslib_0.5.0 cachem_1.0.6 cli_3.6.0 digest_0.6.31 ellipsis_0.3.2 evaluate_0.23
fastmap_1.1.0 fontawesome_0.5.1 fs_1.5.2 glue_1.6.2 graphics_4.3.1 grDevices_4.3.1 highr_0.10
htmltools_0.5.5 jquerylib_0.1.4 jsonlite_1.8.7 knitr_1.43 lifecycle_1.0.4 magrittr_2.0.3 memoise_2.0.1
methods_4.3.1 mime_0.12 R6_2.5.1 rappdirs_0.3.3 rlang_1.1.1 rmarkdown_2.23 sass_0.4.7
stats_4.3.1 stringi_1.7.12 stringr_1.5.1 tinytex_0.45 tools_4.3.1 utils_4.3.1 vctrs_0.6.2
xfun_0.39 yaml_2.3.7

Pandoc version: 3.1.1

Other

I am running Zotero

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • formatted your issue so it is easier for us to read?

  • included a minimal, self-contained, and reproducible example?

  • pasted the output from xfun::session_info('rmarkdown') in your issue?

  • upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • installed and tested your bug with the development version of the rmarkdown package using remotes::install_github("rstudio/rmarkdown")?

Activity

  1. added
    new
    on Mar 12, 2024
  2. added this to the Product Backlog milestone on Mar 18, 2024
  3. added
    visual markdown
    and removed
    new
    on Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugvisual markdown

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions