Dataverse: In BibTex exports, convert quote characters so LaTex displays quotes

Created on 21 Dec 2018  ·  11Comments  ·  Source: IQSS/dataverse

In the title field for BibTex files, Dataverse needs to turn opening quote characters into two back ticks (``) and closing quote characters into two apostrophes ('').

This is because when LaTex sees the regular quote character next to some letters, like "A, it turns that string into a letter with a diaeresis, like Ä. In other cases, maybe when the letter is a consonant and wouldn't get a diaeresis, it looks like it uses the closing quote, twice.

So in this BibTex...

@data{DVN/NMCOBF_2018,
author = {Klasnja, Marko and Chauchard, Simon and Harish, S.P.},
publisher = {Harvard Dataverse},
title = {Replication Data for: "Getting Rich Too Fast? Voters' 
Reactions to Politicians' Wealth Accumulation"},
year = {2018},
doi = {10.7910/DVN/NMCOBF},
url = {https://doi.org/10.7910/DVN/NMCOBF}
}

... the quotes in the title field should look like:

title = {Replication Data for: ``Getting Rich Too Fast? Voters' 
Reactions to Politicians' Wealth Accumulation''},

And LaTex will turn those back ticks and apostrophes into opening and closing quotes.

Here's a published dataset on Harvard Dataverse with regular quotes in the dataset title.

This was reported in https://github.com/IQSS/dataverse/issues/3759 and described in this stackoverflow question.

Metadata

Most helpful comment

For a visual illustration:

1058-57b3b7e :
screenshot_20181221_122731

After bibtex changes:
screenshot_20181221_122743

All 11 comments

For a visual illustration:

1058-57b3b7e :
screenshot_20181221_122731

After bibtex changes:
screenshot_20181221_122743

Looks like capital letters turned into lowercase. Is that something BibTex formatting can prevent? Or maybe a LaTex package thing?

There are BibTex formatting options for preserving capitalization in citation fields (default to letting latex handle it with existing typesetting rules).

screen shot 2019-01-17 at 1 37 49 pm

@jggautier, @pameyer does this look OK?

@sekmiller To me, it doesn't look like that will have the expected behavior (with pdflatex/bibtex); although it's tough to check from an image of bibtex.

title="{Replication Data for:Test BibteX''}",

_should_ generate the expected output when processed.

@sekmiller It looks like you have a single " "double quote" character to close the title, but if I am reading this Stack Overflow answer that @jggautier provided, it needs to be two "apostrophe" characters ''.

Checked in with @djbrooke, and updated this branch slightly so that the dataset titles will be handled in a case sensitive manner after the BibTex output from Dataverse is processed by the bibtex software.

Updated the unit tests so that they continue to pass after the case sensitivity changes, but didn't extend them to account for quotations in dataset titles.

I chatted with @pameyer this morning about tests and I hope that he an others don't mind that I added a test for...

This Title ``Has Quotes'' In It

... in df7909d

I also attempted to address #5081 with a doc change in d5680cd

Finally, when I tried downloading BibTex for my dataset in production at https://dataverse.harvard.edu/file.xhtml?persistentId=doi:10.7910/DVN/TJCLKP/JKTORG&version=2.0 I noticed that Firefox throws a syntax error because we are telling browsers that we are sending JSON when we really aren't. I didn't try to fix this but I did add a FIXME in the code at b59cf09 . Here are a couple screenshots of the user experience in Firefox:

screen shot 2019-01-23 at 12 12 00 pm

screen shot 2019-01-23 at 12 09 51 pm

Finally, I'm dismayed to learn that code coverage reporting is broken with Netbeans again. Last time we fixed it with 792dd1c but when I tried to put in a similar fix I got this Resolving expression: '${argLine}': Detected the following recursive expression cycle in 'argLine': [argLine] -> [Help 2]. I didn't commit this, of course. I wrote about showing code coverage from Netbeans at http://guides.dataverse.org/en/4.10.1/developers/testing.html#observing-changes-to-code-coverage and I'd really like for this to work again.

@pameyer and I talked through the changes above and he's fine with them so I moved this to QA.

@poikilotherm if you have any idea about the Netbeans code coverage problem, please let us know!

For the Netbeans code coverage problem, see #5483 and associated pull request #5484.

Finally, when I tried downloading BibTex for my dataset in production at https://dataverse.harvard.edu/file.xhtml?persistentId=doi:10.7910/DVN/TJCLKP/JKTORG&version=2.0 I noticed that Firefox throws a syntax error because we are telling browsers that we are sending JSON when we really aren't. I didn't try to fix this but I did add a FIXME in the code at b59cf09 . Here are a couple screenshots of the user experience in Firefox

There's a new issue tracking this: Cite Dataset - BibTeX - Firefox json error #6029

Was this page helpful?
0 / 5 - 0 ratings