fiduswriter / biblatex-csl-converter

A set of JavaScript converters: bib(la)tex => json, json => csl, and json => biblatex
GNU Lesser General Public License v3.0
34 stars 10 forks source link

information request: pages field #51

Closed retorquere closed 7 years ago

retorquere commented 7 years ago

When parsing the pages field I get this structure:

[[[{"type":"text","text":"300"}],[{"type":"text","text":"301"}]]]

does that mean "a pages field can occur multiple times, and can be a range"? I didn't know the pages field could occur multiple times.

johanneswilm commented 7 years ago

I don't think we allow any field more than once, do we?

The innermost [...] is there because it can contain styling. The next [...] is there because we allow a range of pages. The third level [...] is because we allow pages and ranges (plural). See the description in the biblatex PDF:

One or more page numbers or page ranges

retorquere commented 7 years ago

I didn't think so either, but I was trying to parse this field. Indented, it looks like this:

[
  [
    [
      {
        "type": "text",
        "text": "300"
      }
    ],
    [
      {
        "type": "text",
        "text": "301"
      }
    ]
  ]
]

So that's a single-element array, containing a two-element array (the range); I had expected a two-element top-level array to designate the range.

johanneswilm commented 7 years ago

Right. So for example you could have these values:

"301-302, 310-313"

It's plural "ranges", right?

retorquere commented 7 years ago

Oh, right. I'll have to figure out how to translate that to Zotero (only one pages field there). Thanks for the info!

johanneswilm commented 7 years ago

Also, one needs to be able to differentiate between: "310, 313" and "310-313".

johanneswilm commented 7 years ago

And the pages field in Zotero doesn't allow more than one range? In bibtext it's just one instance of the pages field, but that one field can contain several page ranges, as I understand it.

retorquere commented 7 years ago

That looks to be right, and Zotero doesn't really do much itself with the pages field. I'd have to go dive into the CSL processor to see what it does with the field value.

johanneswilm commented 7 years ago

Hmm, Just tried out Zotero. For input it seems just to give a simple input field and doesn't really seem to care about what I put into it.

retorquere commented 7 years ago

That's Zotero. It leaves most of the interpretation to citeproc (or BBT)