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

citep(): format accent characters #51

Closed
zkamvar opened this issue Feb 17, 2014 · 3 comments
Closed

citep(): format accent characters #51

zkamvar opened this issue Feb 17, 2014 · 3 comments
Milestone

Comments

@zkamvar
Copy link

zkamvar commented Feb 17, 2014

Hello, this is similar to my previous issue*.

The function citep() doesn't appear to format the accent characters. After digging around, It seems that print.bibentry() calls format.bibentry(), which seems to work some voodoo via Rd files using tools::Rd2txt(). In any case, my hopefully reproducible code is below. Is there any easy way to work the formatting into the inline citations?

library(knitcitations)
x <- structure(list(grunwald2006hierarchical = structure(list(title = "Hierarchical analysis of diversity, selfing, and genetic differentiation in populations of the oomycete Aphanomyces euteiches", 
    author = structure(list(structure(list(given = c("N.", "J."
    ), family = "Gr{\\\"u}nwald", role = NULL, email = NULL, 
        comment = NULL), .Names = c("given", "family", "role", 
    "email", "comment")), structure(list(given = "G.-A.", family = "Hoheisel", 
        role = NULL, email = NULL, comment = NULL), .Names = c("given", 
    "family", "role", "email", "comment"))), class = "person"), 
    journal = "Phytopathology", volume = "96", number = "10", 
    pages = "1134--1141", year = "2006", publisher = "Am Phytopath Society"), .Names = c("title", 
"author", "journal", "volume", "number", "pages", "year", "publisher"
), bibtype = "Article", key = "grunwald2006hierarchical")), .Names = "grunwald2006hierarchical", class = "bibentry")

citep(x)
## [1] "(<a href=\"\">Gr{\\\"u}nwald & Hoheisel, 2006</a>)"

It appears as:
(Gr{"u}nwald & Hoheisel, 2006)
when it should be:
(Grünwald & Hoheisel, 2006)

Here is my sessionInfo():

R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitcitations_0.5-0 bibtex_0.3-6        knitr_1.5          

loaded via a namespace (and not attached):
[1] digest_0.6.4   evaluate_0.5.1 formatR_0.10   httr_0.2       RCurl_1.95-4.1
[6] stringr_0.6.2  tools_3.0.2    XML_3.95-0.2   xtable_1.7-1 

Thanks!
Zhian

*I swear it's not a problem existing between the keyboard and chair this time!

@cboettig
Copy link
Owner

Yup, looks like a bug on my end in the default text format. Will try and fix soon.

@Nowosad
Copy link

Nowosad commented May 3, 2014

Up

@cboettig
Copy link
Owner

Okay, I still have to fix this, (think I have a good way to improve all the formatting), but meanwhile I'm curious if you might prefer the pandoc-based solution I've just released to address #57? Since pandoc will be handling the final formatting of the inline citation, this should sidestep the issue. (Note that a pandoc markdown parser is set to become a standard part of RStudio as well).

@cboettig cboettig added this to the 0.7 milestone May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants