Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
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

Capitalization of abbreviation starting with a number for biblatex export. #1949

Closed
knusch opened this issue May 29, 2019 · 2 comments · Fixed by #2086
Closed

Capitalization of abbreviation starting with a number for biblatex export. #1949

knusch opened this issue May 29, 2019 · 2 comments · Fixed by #2086
Assignees

Comments

@knusch
Copy link

@knusch knusch commented May 29, 2019

Auto capitilization of capitalized words for biblatex export (i.e. insserting curly braces around the word), does not appear to work when the capitalized word starts with a number. My example was an article named
3D intensity and phase imaging from light field measurements in an LED array microscope,
which turns up in the .bib file as
{3D intensity and phase imaging from light field measurements in an {LED} array microscope},
with no braces around the '3D' part.

I have tested other abbreviations starting with a number, and it appears to behave the same in all my tests.

@zuphilip

This comment has been minimized.

Copy link
Collaborator

@zuphilip zuphilip commented Dec 15, 2019

The extra spaces for preserving the uppercase letters in such cases comes from:

var protectCaps = new ZU.XRegExp("\\b\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*", 'g');
if (field != "pages") {
	value = ZU.XRegExp.replace(value, protectCaps, "{$0}");
}

which does not yet handle the cases with numbers as the 3D. Moreover, in chemistry there are more examples like for example MgO-FeO-Al2O3-SiO2-H<sub>2</sub>O. We could extend this with the numbers by using instead

var protectCaps = new ZU.XRegExp("\\b[\\p{Letter}\\d]+\\p{Uppercase_Letter}[\\p{Letter}\\d]*", 'g');

However, this would still leave the H2O case unchanged. But I am not sure, what is the desired output for this case anyway?

@zuphilip

This comment has been minimized.

Copy link
Collaborator

@zuphilip zuphilip commented Dec 15, 2019

But this should be then combined with the issue #1667.

zuphilip added a commit to zuphilip/translators that referenced this issue Dec 15, 2019
For example 3D will then become {3D} in BibTeX export.
This fixes zotero#1949 for BibTeX.
@zuphilip zuphilip self-assigned this Dec 25, 2019
adam3smith added a commit that referenced this issue Jan 20, 2020
For example 3D will then become {3D} in BibTeX export.
This fixes #1949 for BibTeX.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.