biblatex.js and uppercase

Hy!

I'm using biblatex.js
My problem is:
in Zotero, title field:
My title (XX-XXI century)

becomes in my file.bib:
title = {My title {(XX-XXI} century)}

Why does the parenthese appear after '{' ??

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

Thanks
C
  • First point: It shouldn't matter much. The BibTeX processor should do the correct thing for that title (parentheses in text mode don't need to be balanced).

    Second point: That isn't the code used by default. By default, case is preserved with:protectCapsRE = new ZU.XRegExp(
    "(.)\\b(\\p{Letter}*\\p{Uppercase_Letter}\\p{Letter}*)" // Non-initial words with capital letter anywhere
    + "|^(\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*)" // Initial word with capital in non-initial position
    , 'g');

    This captures the parenthesis.

    You can add the hidden bool extensions.zotero.translators.BibTeX.export.dontProtectInitialCase and set it to true in about:config. This would use the regex you gave and the parenthesis wouldn't be put in the preserving brackets. But this would impact other capitalization on export too.
  • edited June 30, 2015
    It doesn't for me. I get the perfectly lovely
    title = {My title ({XX}-{XXI} century)},
    which also corresponds to the XRegex you helpfully posted.

    Are you using the better bibtex add-on? The developer, I believe, has a custom version on the biblatex translator.

    Edit: I'm pretty sure I'm right here for biblatex. noksagt's answer is correct for regular bibtex.
  • @noksagt: there is no change with your codeline: the {(XX-YY} cent.) remain
    extensions.zotero.translators.BibTeX.export.dontProtectInitialCase does not appear in my about:config

    @adamsmith: I'm using BibLaTeX.js 2014-08-25 06:43:15. What's your codeline?
  • That's the same, up to date version I have, but if you look at the code, it wouldn't produce what you're getting: \b wouldn't start outside the parentheses, so something odd is going on. How exactly are you exporting?
Sign In or Register to comment.