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

Double brackets and special characters problems from BibTex #93

Open
carbonmetrics opened this issue Oct 23, 2018 · 12 comments
Open

Double brackets and special characters problems from BibTex #93

carbonmetrics opened this issue Oct 23, 2018 · 12 comments

Comments

@carbonmetrics
Copy link

carbonmetrics commented Oct 23, 2018

I am trying out the new Radix for R Markdown.

The citations do not work very well for me. All titles have curly braces around them, and names with special characters are not shown correctly.

I have reported this via StackOverflow and via the radix Github account. The developer of radix thinks that the issue is related to the Distill framework.

screenshot

Here is an example:

---
title: "Untitled"
description: |
  A new article created using the Radix format.
author:
  - name: Nora Jones 
    url: https://example.com/norajones
    affiliation: Spacely Sprockets
    affiliation_url: https://example.com/spacelysprokets
date: "`r Sys.Date()`"
bibliography: bib.bib
output: radix::radix_article
---

This is the citation [@Rockstrom2009]
Using the bib.bib file:

@article{Rockstrom2009,
archivePrefix = {arXiv},
arxivId = {10.1038/461472a},
author = {Rockstr{\"{o}}m, Johan and Steffen, Will and Noone, Kevin and Persson, {\AA}sa and Chapin, F. Stuart and Lambin, Eric and Lenton, Timothy M. and Scheffer, Marten and Folke, Carl and Schellnhuber, Hans Joachim and Nykvist, Bj{\"{o}}rn and de Wit, Cynthia A. and Hughes, Terry and van der Leeuw, Sander and Rodhe, Henning and S{\"{o}}rlin, Sverker and Snyder, Peter K. and Costanza, Robert and Svedin, Uno and Falkenmark, Malin and Karlberg, Louise and Corell, Robert W. and Fabry, Victoria J. and Hansen, James and Walker, Brian and Liverman, Diana and Richardson, Katherine and Crutzen, Paul and Foley, Jonathan},
doi = {10.5751/ES-03180-140232},
eprint = {461472a},
isbn = {0028-0836},
issn = {17083087},
journal = {Nature},
keywords = {Atmospheric aerosol loading,Biogeochemical nitrogen cycle,Biological diversity,Chemical pollution,Climate change,Earth,Global freshwater use,Land system change,Ocean acidification,Phosphorus cycle,Planetary boundaries,Stratospheric ozone,Sustainability,carrying capacity,climate change,ecology,nitrogen,phosphorus,planetary boundaries},
number = {24 September 2009},
pmid = {19779433},
primaryClass = {10.1038},
title = {{Planetary boundaries: Exploring the safe operating space for humanity}},
volume = {461},
year = {2009}
}

The bib file was exported through Mendeley 1.19.2 with LaTeX escape special characters = on. Using RStudio 1.2.1060 and R 3.4.4 on a Xubuntu 64 16.04 system.

How can I make these references show correctly? I have already tried switching off LaTeX special characters. The same biographic entries work fine in LaTeX.

@colah
Copy link
Member

colah commented Oct 23, 2018

Hello! Is the double brace thing part of the bibtex standard? I've never seen it before and the package we use for parsing bibtex, bibtex-parse-js, doesn't seem aware of it.

I guess the questions are:
(1) Is this actually part of the standard -- or a strong de facto addition -- such that we should we support it? (Rather than being a weird thing that Mendeley does.)
(2) If it is, do the bibtex-parse-js people want to handle it on their end?
(3) If not, do we want to special case it? (Should be pretty easy to wrap in to the transform process.)

The fact that it works in LaTeX seems to point in the direction of yes to (1)...

In the mean time, you can always fix this by editing your bibliography file.

@carbonmetrics
Copy link
Author

carbonmetrics commented Oct 23, 2018

Thanks! I have looked for utilities to clean up my bibtex files. However, there is no such tool for this as the double curly brackets are meant to be there.

Another view is that this is a Mendeley problem. I have compiled the C program and it works as far as double brackets around titles are concerned. Authors have double brackets around them if they have double names: G.A. {Da Fonseca}. The special characters are still not shown (Rockstr{\"{o}}m).

The problem is in R markdown radix; everything is shown correctly in normal rmarkdown.

@lmullen
Copy link

lmullen commented Dec 8, 2018

I have this problem too. I can't speak to whether it is a part of the standard or not, but the extra braces are widely used to make sure that parsers don't modify text that should be presented as is. For example, title = {A history of the {U.S.} and {Canada}} marks U.S. and Canada as names which should always be capitalized. Other words, like history, will be capitalized or not according to the citation style.

@kevinykuo
Copy link

I just hit this, too. My use case is I want to include an organization name as an author, which I can't figure out how to do in distill right now. See also https://tex.stackexchange.com/questions/149769/how-to-cite-organizations-name-with-space-between-words. In the meantime, if anyone has a workaround please let me know...

@emitanaka
Copy link

+1 to this issue. I have hit this issue when author name is a team.
E.g. double curly brackets used here for author = {{R Core Team}} so it prevents from thinking Team is last name and R Core is first name.

@Manual{R2018,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2018},
    url = {https://www.R-project.org/},
    }

@kevinykuo
Copy link

@emitanaka FYI in case you're using radix, the organization author issue has been fixed on master.

@emitanaka
Copy link

Thanks @kevinykuo ! I'll check it out.

@LKMason
Copy link

LKMason commented Mar 16, 2021

Any progress on this issue? I am still getting it on the latest version of Template V2, and can't seem to find a workaround.

@carbonmetrics
Copy link
Author

Yes, there is progress. Radix has been relaunched as distill, and this issue has been solved.

@LKMason
Copy link

LKMason commented Mar 17, 2021

Thanks for the response, but I am not sure I understand. I am using the Distill V2 template to format a Distill paper, I am not aware of Radix. The issue still persists. I am writing a Distill paper and am unable to format organization/institution references correctly. The double brackets parsing does not seem to work.

@carbonmetrics
Copy link
Author

Ah, OK. I opened this issue for Radix way back in Oct 2018, and the curly brackets referred to citations, as you can see in the head of this issue. You didn't mention that you were using Distill. Better open a new issue then.

@LKMason
Copy link

LKMason commented Mar 17, 2021

#131 Opened a new issue

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

6 participants