-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature request: Numbered in-text citations in flextables #40
Comments
I think I need three features:
Each of them are quite tough..., especially (1).
(2) is going to be a big change in ftExtra's internal formatting. (3) can be done by inserting yaml metadata block together with flextable object. I will start with (3) because this feature improves user experience. Users will no longer have to write |
An alternative that would be adequate for many use cases would be for the user to specify a second citation style (CSL file) specifically for flextables. Medical journals typically use [1] as the main citation style but often allow Russell 2019 in tables. An important consideration is what happens when a work is cited in the flextable but not the main text. Does that citation not show up in the reference list? If so there are simple workarounds for the end user but clear documentation would be helpful. |
Thank you for suggesting the alternative way. It is already possible with a example below (you need to add bib and csl files).
In that case, citations not show up in the reference list, and that is why I mention
|
this is the attempt to include citations to reference list without asking users for YAML metadata block. |
(2) is done via #46. |
(3) is done via #48 |
Thanks @atusy! I'll make do with the workaround of using a different CSL in-table for now. I'm glad this request helped prompt two useful enhancements |
I'd be happy if you could review the usage before merge. However, if it is not likely to happen, I will merge anyway in a week or so. Feel free to feed me back even after the merge. Thank you! |
Hi @atusy. This feature works for me, thank you! However, this doesn't handle the fact that some sources cited in the table may also be cited in the main text and should be given the same number that was used earlier. Because of this, I think using a different citation style in the table may still be the best approach for my purposes. |
Thanks, @altonrus , for the check.
Would you provide a reproducible example so that I can attempt a fix without misunderstanding the context? |
I figured out the reproducible example and closed #60. |
ftExtra::colformat_md() lets you put in-text citations within cells of flextables. Because it treats each cell as it's own Rmarkdown document, this doesn't work properly when using an in-text citation format that uses the number of the reference (i.e., [3] instead of Russell 2019, as dictated by the CSL file). All citations show up as a [1] regardless of their number in the reference list of the actual Rmd document. The desired behavior would be for the in-text citation within the table to be consistent with the overall Rmd document.
This issue first came up on twitter: https://twitter.com/altonrus/status/1366856898943852551?s=20
Thank you for offering to look into it @atusy!
The text was updated successfully, but these errors were encountered: