-
Notifications
You must be signed in to change notification settings - Fork 213
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
Support Add reference by bibtex @
in the function tab_source_note
#112
Comments
@
in the function tab_source_note
Thanks for filing this issue. It seems like a very good idea to integrate citations with BibTeX. I'll look into how this can be done easily. |
Looking into the possibility of adding a new method for LaTeX that could use additional arguments for different citation types. |
Closely related, it would be really useful for me if there was some sort of fmt_citation function, which would take a bibtex file and then format a column of @-tags ("@li2019") into a column of short ("Li (2019)") or long ("'Title of a Good Paper'. Bob Li, 2019 Journal of Cool Stuff vol. 4 no. 20" ) citation. This would be good for literature reviews, meta-analyses, tables of software used/data sources, etc. Thanks for the great package! |
My understand is that the reason @-tags don't work in |
I think I have a solution. Key takeaways:
Generally speaking, UPDATE citeproc_to_natbib <- function(x){
p <- grepl("^\\[.+\\]$", x)
# strip square brackets, if any
if(p) x <- gsub("(^\\[)|(\\]$)", "", x)
txt_lst <- strsplit(x, ";\\s?")
txt_lst <- lapply(txt_lst, function(i) gsub("^@", "",i))
ltr <- ifelse(p, "p", "t")
txt <- sapply(txt_lst, paste0, collapse = ", ")
paste0("\\cite", ltr, "{", txt, "}")
} |
I am reading the vignette and find this table add a source note with reference McNeil, D. R. (1977).
Here is related R code I copy from this vignette.
Does the function
tab_source_note
to support BibTeX reference in the future?Maybe it is hard because I don't see other packages to support this feature.
The text was updated successfully, but these errors were encountered: