Replace \u2013 with "-" in BibTeX.js

238 views
Skip to first unread message

Wantee Wang

unread,
May 18, 2012, 6:33:07 AM5/18/12
to zotero-dev
Hi all,

When i use zotero in FF to import item from Google scholar, the
dash in the pags field is wrongly to be "–"(\u2013). I don't know why,
maybe it is due to my Simplified Chinese FF. Then i checked the files
in translator directory of zotero and found that i can replace it with
"-" in BibTex.js.
It works for me, but i do not know whether there is a better way to
solve the problem. Here is the code https://gist.github.com/2724474

I don't know much about js, would anyone please review the code,
Thanks!

Wantee

Dan Stillman

unread,
May 18, 2012, 10:36:23 PM5/18/12
to zoter...@googlegroups.com
On 5/18/12 6:33 AM, Wantee Wang wrote:
> When i use zotero in FF to import item from Google scholar, the
> dash in the pags field is wrongly to be "–"(\u2013).

An en dash (\u2013) is the correct character to use in page ranges.

Avram Lyon

unread,
May 19, 2012, 12:59:55 AM5/19/12
to zoter...@googlegroups.com

If you have documentation that Chinese bibliographic practice uses a different delimiter, please advise. Otherwise, we believe the n-dash is internationally the norm. If this is causing issues for your usage of something like BibTeX, post to forums.zotero.org with your situation.

Avram

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To post to this group, send email to zoter...@googlegroups.com.
To unsubscribe from this group, send email to zotero-dev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/zotero-dev?hl=en.

Rintze Zelle

unread,
May 19, 2012, 8:26:19 AM5/19/12
to zoter...@googlegroups.com
Apparently Russian doesn't use the en-dash: http://forums.zotero.org/discussion/18480/endash-instead-of-hyphen-in-collapsed-numeric-citations/

(there is a page-range-delimiter term scheduled for inclusion in CSL 1.0.1 so that this delimiter becomes configurable)

Rintze

Wantee Wang

unread,
May 21, 2012, 2:33:15 AM5/21/12
to zoter...@googlegroups.com
Sorry, i hadn't mentioned that, it actually causes problem with my BibTex.

To unsubscribe from this group, send email to zotero-dev+...@googlegroups.com.

Avram Lyon

unread,
May 21, 2012, 2:46:44 AM5/21/12
to zoter...@googlegroups.com

This then becomes very hard to do properly upon export to BibTeX or the like, since translators don't have locale info. It seems to me that BibTeX should be able to handle such a common delimiter; if you can't handle it in your environment, try exporting BibTeX from Zotero in an encoding other than UTF-8; that will trigger the conversion to a basic ASCII character.

I don't think we want to enable locale-dependent export settings, and this can probably be handled from within your TeX environment. If you run into more trouble, post to the forums; this isn't really a development question.

Avram

Reply all
Reply to author
Forward
0 new messages