bibtex export suggestion: space in page range
Hi,
Currently bibtex.js replaces any number of dashes in a page range by '--'.
I would like to suggest to also remove any white space between the page numbers and the dashes by changing line 1485 from
writeField("pages", item.pages.replace(/[-\u2012-\u2015\u2053]+/g,"--"));
to
writeField("pages", item.pages.replace(/\s*[-\u2012-\u2015\u2053]+\s*/g,"--"));
Best regards,
Paul
Currently bibtex.js replaces any number of dashes in a page range by '--'.
I would like to suggest to also remove any white space between the page numbers and the dashes by changing line 1485 from
writeField("pages", item.pages.replace(/[-\u2012-\u2015\u2053]+/g,"--"));
to
writeField("pages", item.pages.replace(/\s*[-\u2012-\u2015\u2053]+\s*/g,"--"));
Best regards,
Paul
One export translator doesn't seem like the right place to fix this as it would also be incorrect for citations and other export formats.
The answer to your question is probably: sloppy manual entry. To me it feels natural to enter the range with spaces.
I don't understand what you mean by " incorrect for citations and other export formats."
I think most citation styles want this range without the spaces. Or is it possible to implement the removal of superfluous space in a bibtex style?
Paul
I don't think we'd be super inclined to fix things in one single export format that should really be fixed in the data in Zotero (and would then be fixed across the board). FWIW, it probably wouldn't be terribly hard to do via the built-in javascript API https://www.zotero.org/support/dev/client_coding/javascript_api or the web api.
Is it then possible to filter the field when editing is finished?
Paul
We could also normalize hyphens/dashes to be a single en dash, which is the typographically correct approach in U.S. English, but I don't know if that's universally true.