-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Escaping hyphens in the Pages field #943
Comments
After a bit more reading I've discovered this is more of a bibtex issue. I've tried including an @string definition for a hyphen, but unfortunately that is also converted to an en dash. I have found one solution is to include a command in the .bib's preamble:
https://tex.stackexchange.com/questions/21773/hyphenating-a-number-in-the-bibtex-pages-field Is it at all possible to do this within zotero/better-bibtex? I'd like to avoid editing the .bib directly if possible. |
🤖 this is your friendly neighborhood build bot announcing test build 5.0.116.6221.issue-943 ("adjust test cases for #943"). |
OK so the hyphen issue is partly my fault, as BBT was a little zealous in changing anything dash-y into en-dashes. 6221 changes that. That should make what you want to do easier. Not trivial though. There are two ways to get
For the preamble you'll have to use a postscript in any case as it stands. I am considering adding a preamble field, but I think I'd have to add two (what works for BibTeX will not necessarily work for BibLaTeX). The postscript would look like
which means:
|
really need that feedback. |
As far as I recall, a page range in a bib file should always be given as "1-3", i.e., with a single hypen. Depending on the .bst file, the single hypen for page range in the .bib file will be expanded to an em-dash or, in some rare cases, to an en-dash. |
I think that's mostly what it does now, right? Have you tested the new behavior? |
I have not tested it, but I believe you. My comment was meant as just that. Another comment is that the page range "16-1 -- 16-4" is in many journals written as "16(4)". |
Thanks for your work on this. Note that in the meantime I've simply used 16:1-4, which should be fine for me. The page numbers '16-1',...'16-4' are what are printed on the conference abstract itself. What's happening is that '16' is an electronic article identifier (separate to DOI). What complicated matters is that there's no field for this identifier except perhaps for issue, which isn't available for conference abstracts (@inproceedings) -- and sometimes journal articles have an issue number AND an electronic identifier anyway. I guess writing 16(1-4) in the page field may be a realistic compromise? Note that these identifiers can change significantly. For example, I have another which is We MIN 06, and I'm yet to settle on a principled way to get these into the bibliography. |
@njbart, is it correct I should use a single hyphen for page ranges? This is mostly related to import, because I'm going to pass on what's in the |
Many BibTeX style files (.bst) files will do a search and replace, so that
"-" is replaced by "--" in the output (.bbl file). This is certainly true
for all the Physics journals that I have published in.
However, some journals use an en-dash in the page range (I seem to recall
that I have seen this in some French journals, but don't quote me on that).
So always using "--" this will call for extra corrective work in the .bbl
file for these journals.
…On 10 April 2018 at 13:30, Emiliano Heyns ***@***.***> wrote:
@njbart <https://github.com/njbart>, is it correct I should use a single
hyphen for page ranges? This is mostly related to import, because I'm going
to pass on what's in the pages field as-is on output, only translating a
unicode en-dash to --, and unicode m-dashes to --- for output.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#943 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHlBJDldgYhUXjgrq2lq9salaVnbDJPRks5tnJfhgaJpZM4THybU>
.
--
____________________________________________________________________
Emeritus Professor Dr Bo Thidé
https://www.researchgate.net/profile/Bo_Thide
Swedish Institute of Space Physics (IRF), P. O. Box 537, SE-751 21 Uppsala
Phone: Office +46184715902 Mobile/Cell +46705613670 Home +46184951801
Visiting address: Ångström Laboratory, Rm# 84108, Lägerhyddsvägen 1, Uppsala
|
I'm not always using |
I was referring to the average user who uses "12--17" instead of the more preferable "12-17" in his/her .bib file. |
If I can be sure that a user never wants a double-hash in the pages field (@njbart?) then perhaps I could replace them, but it seems iffy. In some cases, I need some work to be left for cleanup by the user; can't algorithmically catch them all ¯\_(ツ)_/¯. A postscript is always an option. |
In good typography (a definition that varies from language/country to
language/country), four different "dashes" are used:
1. Hyphenation: "Andy Fairweather-Lowe", breaking a multisyllable word at
the end of a line. In LaTeX: "-" (single "-").
2. Range: "The years 1939-1945". In LaTeX: "--" (double "-").
3. Separation: "Typesetting - a difficult skill". In LaTeX: " --- " or
(e.g., in American typography) "---" (triple "-").
4. Negation: "The temperature is -3 degrees C". In LaTeX: "$-$" (math
mode, single "-").
…On Fri, 13 Apr 2018, 08:04 Emiliano Heyns, ***@***.***> wrote:
Would a single em-dash (u+2014, usually translated to triple dash in
latex) count as longer or shorter than a double hypen?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#943 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHlBJOeAfFNHulKQa9Rn9osBoV1hb0kMks5toD-2gaJpZM4THybU>
.
|
Except if @njbart 's interpretation of the biblatex wiki is correct, any number of non-braced consecutive dash symbols of various kinds would constitute a @njbart offered a heuristic to determine what dash-like things to brace and which not, but "longest" to me is ambiguous on whether it means pre-processing length (in which case double-hyphen would be longer than em-dash) or post-processing length (in which case em-dash is longer than double-hyphen). Not at all sure I'm going to do this yet, as I'd have to do further parsing of the pages field for multiple ranges, and parsing of Zotero input is brittle. But I'm considering doing it. |
What I had in mind was post-processing length, i.e., en-dash=double-hyphen longer than single-hyphen (and em-dash=triple-hyphen longer than double-hyphen – though I’m not sure the latter situation ever occurs in the wild). |
Neither have I, but nothing surprises me at this point. The state of references ready-to-import for Zotero is not stellar, and all kinds of stuff ends up in the database. |
Hope you don't mind me butting in here. I can only say things with confidence for the @bothide is right when they say that the dash can be considered a kind of meta character in the
So it seems that back when BibTeX was devised the preferred way was actually a double dash and the single dash was only used for backwards compatibility reasons. I don't know if there are any more authoritative sources nowadays that recommending For I do, however, not agree with the sentiment that numeric fields should always be written without braces. It is a feature of the
(Nicolas Markey: Tame the BeaST, p. 20, http://mirrors.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf) But this is clearly worded as optional here and I haven't seen anyone else endorsing leaving out the braces. In fact
What does that mean for you?
|
Let me just repeat my comment that a convenient (and, seemingly, nearly a de facto standard) way of writing a page range of the type 6-1 through 6-14 is 6(14). This is used by, e.g., the American Physical Society publications such as the Physical Review journals. |
IOW the current behavior in the regular release is OK as-is? |
I don't use BBT (or Zotero for that matter), so verification would have to come from someone who does. But from what I can read here things should be fine if BBT does not change I had a look at
still seems to convert some - to -- .
I'd probably go for an en-dash or even a hyphen instead. |
I'll get those changed later today. |
🤖 this is your friendly neighborhood build bot announcing test build 5.0.129.6395.issue-943 ("adjust tests for #943"). |
I still get the following warning in my BBT exported BibLaTeX file: I thought |
Fixed, will be in the next release. |
🤖 this is your friendly neighborhood build bot announcing test build 5.0.137.6668.master ("re-fixes #943"). |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi all,
I'm trying to export to bibtex the citation for a journal article with page numbers "16-1", "16-2", "16-3", and "16-4". I'd like the page range to appear in bibtex as '16-1--16-4'. Unfortunately, if the Pages field in Zotero is '16-1-16-4', then all hyphens are converted to en dashes and the corresponding bibtex field is '16--1--16--4'. Is there any way to escape hyphens here, or alternatively force '16-1' and '16-4' to be interpreted as strings?
The text was updated successfully, but these errors were encountered: