cboettig / knitcitations

:package: Generate citations for knitr markdown and html files
http://carlboettiger.info
Other
220 stars 28 forks source link

bibliography(): print accent characters #50

Closed zkamvar closed 10 years ago

zkamvar commented 10 years ago

Hi, I've run into a slight hiccup with citations that I put into a bibtex file where there are accents over the Authors' names.

This returns This:

Fran{\c{c}}ois Balloux, Laurent Lehmann, Thierry Mee{^u}s, (2003) The population genetics of clonal and partially clonal diploids. Genetics 164 (4) 1635-1644

Is there a flag that I can use to properly parse these entries?

cboettig commented 10 years ago

Thanks for the bug report, I'll look into how to avoid this automatically. Meanwhile, try: bibliography(style="text"), which should give you the utf-8 accent characters instead of the bibtex ascii notation for accents.

zkamvar commented 10 years ago

Oh, frag, I didn't realize the input link wasn't static, sorry about that. Here's the contents of the bibtex file:

@article{balloux2003population,
  title={The population genetics of clonal and partially clonal diploids},
  author={Balloux, Fran{\c{c}}ois and Lehmann, Laurent and de Mee{\^u}s, Thierry},
  journal={Genetics},
  volume={164},
  number={4},
  pages={1635--1644},
  year={2003},
  publisher={Genetics Soc America}
}
cboettig commented 10 years ago

No problem. This should work with the text option I mentioned. If not, you may have an old version of knitcitations the bibtex package? Paste the output of sessionInfo() after running your example.


Carl Boettiger http://carlboettiger.info

sent from mobile device; my apologies for any terseness or typos On Feb 4, 2014 8:21 PM, "Zhian N. Kamvar" notifications@github.com wrote:

Oh, frag, I didn't realize the input link wasn't static, sorry about that. Here's the contents of the bibtex file:

@article{balloux2003population, title={The population genetics of clonal and partially clonal diploids}, author={Balloux, Fran{\c{c}}ois and Lehmann, Laurent and de Mee{^u}s, Thierry}, journal={Genetics}, volume={164}, number={4}, pages={1635--1644}, year={2003}, publisher={Genetics Soc America} }

Reply to this email directly or view it on GitHubhttps://github.com/cboettig/knitcitations/issues/50#issuecomment-34136542 .

zkamvar commented 10 years ago

It does seem to work with simply bibliography(style = "text"), however this does not work:

bibliography(.bibstyle = "pnas", style = "text")
Error: attempt to apply non-function

But the version without the style argument works. Below 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      
[5] RCurl_1.95-4.1 stringr_0.6.2  tools_3.0.2    XML_3.95-0.2  
[9] xtable_1.7-1 

Thanks for the quick reply!

cboettig commented 10 years ago

I am afraid "pnas" is not a valid option for bibstyle. Knitcitations doesn't support journal styles at this time.


Carl Boettiger http://carlboettiger.info

sent from mobile device; my apologies for any terseness or typos On Feb 4, 2014 10:33 PM, "Zhian N. Kamvar" notifications@github.com wrote:

It does seem to work with simply bibliography(style = "text"), however this does not work:

bibliography(.bibstyle = "pnas", style = "text") Error: attempt to apply non-function

But the version without the style argument works. Below 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 [5] RCurl_1.95-4.1 stringr_0.6.2 tools_3.0.2 XML_3.95-0.2 [9] xtable_1.7-1

Thanks for the quick reply!

Reply to this email directly or view it on GitHubhttps://github.com/cboettig/knitcitations/issues/50#issuecomment-34141122 .

zkamvar commented 10 years ago

Understood. Thank you for taking a look at it.