Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Citations to Existing Citation Blocks Fails #8337

Closed
4 tasks done
dragonstyle opened this issue Nov 10, 2020 · 8 comments
Closed
4 tasks done

Adding Citations to Existing Citation Blocks Fails #8337

dragonstyle opened this issue Nov 10, 2020 · 8 comments
Assignees
Labels
bug visual markdown
Milestone

Comments

@dragonstyle
Copy link
Contributor

@dragonstyle dragonstyle commented Nov 10, 2020

I notice if you use visual markdown and add references and then go back to add another reference in the same place it is buggy: The reference is not "added" as a cluster but as an additional reference. You can try to correct that with removing the around the new reference added but then the references are not recognized at all! Switching the visual markdown off shows the new added reference in plain markdown has “@....” once the “\” is removed from before @ and the additional deleted the reference cluster is recognized correctly.

e.g. [@Vrillon2020[@Robson2020; @Zhuang2020; @Farfour2020]]

See:
https://community.rstudio.com/t/mechanism-to-check-for-duplicate-citations-while-adding-citations-in-the-preview-releases/87335/4

System details

RStudio Edition : All
RStudio Version :  All
OS Version      :  All
R Version       : 

Steps to reproduce the problem

  1. Insert a citation using the form [@foo].

  2. Place the cursor at the end of the citation and insert one or more additional citations.

Describe the problem in detail

Brackets are nested as a citation has been inserted into another citation. The brackets or @ may be escaped.

Describe the behavior you expected

Ideally, we would simply modify the existing citation by adding the additional entries.

  • 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 a 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.
@dragonstyle dragonstyle self-assigned this Nov 10, 2020
@dragonstyle dragonstyle added the visual markdown label Nov 10, 2020
@dragonstyle dragonstyle changed the title Insert Citations in Existing Citations Fails Adding Citations to Existing Citation Blocks Fails Nov 10, 2020
@jjallaire jjallaire added this to the v1.4 milestone Nov 10, 2020
@kfeinauer
Copy link
Contributor

@kfeinauer kfeinauer commented Dec 2, 2020

@dragonstyle

This looks like it may not be working properly for me, but I'm not exactly sure of the expected behavior. I tested on the latest daily 1.4.1073.

When I attempt to insert a citation within a citation, the dialog pops up and does not automatically populate my existing citation, as if to extend it and make it a multi-citation. Then when I insert, it generates a citation tag like so:

[@Turcot@Isek2019te2019]

However, an actual multi-citation is different:

[@Isek2019; @Goh2019].

Also, I notice I don't see a citation preview for the multi-citation at all. Is that a separate bug or intended behavior?

@kfeinauer kfeinauer self-assigned this Dec 2, 2020
@kfeinauer kfeinauer reopened this Dec 2, 2020
@dragonstyle
Copy link
Contributor Author

@dragonstyle dragonstyle commented Dec 2, 2020

This is great feedback, thank you.

  • We aren't expecting the dialog to be re-entrant (e.g. it isn't really editing the existing citations, just inserting new citations).
  • It should do a better job at dealing with the actual insert into an existing citation (e.g. adding a delimiter if needed, perhaps even moving the cursor to the end of the citeId if the cursor is positioned in the middle of a citeId).

I'm going to take a look at the change to support deal with the second item above.

I do expect that previews of citations in the multiple citation should work properly. Are you able to consistently reproduce that issue as that would be unexpected...

@kfeinauer
Copy link
Contributor

@kfeinauer kfeinauer commented Dec 2, 2020

@dragonstyle The multi-citation never seems to show the preview like a regular citation. Seems to reproduce 100% of the time for me on macOS.

@dragonstyle
Copy link
Contributor Author

@dragonstyle dragonstyle commented Dec 2, 2020

@kfeinauer Ok great, would you mind sharing a sample doc + bibliography for me (email or slack or whatev)? (I'm not seeing it in my simple cases but I'm probably everything the way I always do and just missing another way to do things).

@kfeinauer
Copy link
Contributor

@kfeinauer kfeinauer commented Dec 2, 2020

Will send everything via Slack

@dragonstyle
Copy link
Contributor Author

@dragonstyle dragonstyle commented Dec 3, 2020

(Note to self) - the citation preview issue was caused by an empty entry in the bibliography

@misc{esquivel2007
}

When we use pandoc to convert this to CSL, it is expecting minimally a comma following the id, like:

@misc{esquivel2007,
}

Our internal Bibtex generator isn't writing that comma which causes parsing of the whole bibliography to fail (and hence the preview to fail). This is worse than the failing preview however, as it results in a failure to knit properly since the bibliography can't be parsed by pandoc.

@dragonstyle
Copy link
Contributor Author

@dragonstyle dragonstyle commented Dec 3, 2020

Both issues should be fixed. Thx @kfeinauer!

@kfeinauer
Copy link
Contributor

@kfeinauer kfeinauer commented Dec 4, 2020

This is looking great now!

Verified on 1.4.1078.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug visual markdown
Projects
None yet
Development

No branches or pull requests

5 participants