Skip to content
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

Issue vs Number APA 7th edition; Number and Issue not shown under certain conditions #5827

Closed
ThiloteE opened this issue Jan 5, 2022 · 9 comments · Fixed by #6255
Closed

Comments

@ThiloteE
Copy link

ThiloteE commented Jan 5, 2022

Problem description:

Initial problem description, discussion and how to reproduce can be found in this thread: JabRef/jabref#8372

Short summary: What we found out so far is that in Jabref, the number field is not shown under certain conditions and that in Zotero, the issue field is not shown under different conditions. The tests were done with Zotero and Jabref.

How to reproduce:

  1. Import these entries (as .bib file (bibtex/biblatex)) into your library management program:
@Article{foo..vin,
  author  = {Foo, Bar},
  title   = {volume + issue + number},
  issue   = {9issue},
  number  = {3number},
  pages   = {45--67},
  volume  = {1},
  journal = {Bib(La)TeX Journal},
}

@Article{foo..vi,
  author  = {Foo, Bar},
  title   = {volume + issue},
  issue   = {9issue},
  pages   = {45--67},
  volume  = {1},
  journal = {Bib(La)TeX Journal},
}

@Article{foo..v,
  author  = {Foo, Bar},
  title   = {volume},
  pages   = {45--67},
  volume  = {1},
  journal = {Bib(La)TeX Journal},
}

@Article{foo..n,
  author  = {Foo, Bar},
  title   = {number},
  number  = {3number},
  pages   = {45--67},
  journal = {Bib(La)TeX Journal},
}

@Article{foo..i,
  author  = {Foo, Bar},
  title   = {issue},
  issue   = {9issue},
  pages   = {45--67},
  journal = {Bib(La)TeX Journal},
}

@Article{foo..in,
  author  = {Foo, Bar},
  title   = {issue + number},
  issue   = {9issue},
  number  = {3number},
  pages   = {45--67},
  journal = {Bib(La)TeX Journal},
}
  1. When using Zotero,

    • select all the items, right click
    • and create bibliography from items.
    • Choose the Citation-Style: American Psychological Association (APA) 7th edition.

    The following will be the output:

    • Foo, B. (n.d.-a). Issue. Bib(La)TeX Journal, 9issue, 45–67. Correct.
    • Foo, B. (n.d.-b). Issue + number. Bib(La)TeX Journal, 3number, 45–67. Issue missing.
    • Foo, B. (n.d.-c). Number. Bib(La)TeX Journal, 3number, 45–67. Correct
    • Foo, B. (n.d.-d). Volume. Bib(La)TeX Journal, 1, 45–67. Correct
    • Foo, B. (n.d.-e). Volume + issue. Bib(La)TeX Journal, 1(9issue), 45–67. Correct
    • Foo, B. (n.d.-f). Volume + issue + number. Bib(La)TeX Journal, 1(3number), 45–67. Issue missing
  2. When using Jabref (v5.4):

    • Go to options>preferences>entry preview
    • Search for and select: American Psychological Association 7th edition
    • Check out the preview for the items in the entry editor.

    The following will be the output:

    • Foo, B. (n.d.). volume + issue + number. Bib(La)TeX Journal, 1(9issue), 45–67. Number missing
    • Foo, B. (n.d.). volume + issue. Bib(La)TeX Journal, 1(9issue), 45–67. Correct
    • Foo, B. (n.d.). volume. Bib(La)TeX Journal, 1, 45–67. Correct
    • Foo, B. (n.d.). number. Bib(La)TeX Journal, 45–67. Number missing
    • Foo, B. (n.d.). issue. Bib(La)TeX Journal, 9issue, 45–67. Correct.
    • Foo, B. (n.d.). issue + number. Bib(La)TeX Journal, 9issue, 45–67. Number missing

Desired outcome:

  1. Fix the situations in which either the number or issue are missing from the rendered text

  2. To my knowledge, the APA Style dictates to change the format in the following way:
    image
    Therefore, it is not a question of issue OR number, but it should be taken into account that issue and number are two different things and should not be replaced with each other. This logic follows CSL and Biblatex form and definition, where issue and number both exist and this apparently is incompatible with the very old definition provided by Bibtex, where only the number field is present. Converting from CSL/Biblatex to Bibtex is possible, but converting from Bibtex to CSL/Biblatex mixes up issue and number.

    I would suggest to change the APA citation-style code in such a way that it

    • follows its own style guide
    • and keeps being compatible with CSL and Biblatex definition of issue and number
    • and ultimately refrains from mapping or rendering the fields issue and number in such a way that one of the two gets replaced by the other.

How:

I don't know.

Additional Info:

@adam3smith
Copy link
Member

adam3smith commented Jan 5, 2022

No, the style does this right: it prints the issue whenever it is in the data and the number when no page range is present, entirely independent of the issue number.

What you're seeing are the results of testing CSL with Bib(La)TeX, which isn't appropriate. The two formats can be mapped (not without some issues), but they have no formal relationships, so any mapping is due to the tool doing the mapping and has nothing to do with CSL or a specific style.

What you're seeing from Zotero is the result of it importing the number field as issue when both are in the .bib file. The problem there is the fact that it's not trying to distinguish between BibLaTeX (where that's clearly wrong) and BibTeX (where it's not clear if it's wrong given the definition of number you link to). In any case, that's a question for Zotero, not CSL. If you add the number in Zotero's Extra field in addition to the issue number (which is how it'll get picked up by the CSL style) you get the correct output:
image

Foo, B. (n.d.). Volume + issue + number. Bib(La)TeX Journal, 1(9issue), Article 3number.

@ThiloteE
Copy link
Author

ThiloteE commented Jan 5, 2022

@michel-kraemer

@bwiernik
Copy link
Member

bwiernik commented Jan 6, 2022

If you are writing with CSL styles (eg, with Zotero or Markdown), you want to store your data in CSL JSON or CSL YAML, not BibTeX or BibLaTeX. This is what Zotero uses in the Word plugin and what you should export to if using Markdown. Markdown/pandoc needs to convert .bib back to CSL anyway, and as adamsmith notes, this is a lossy conversion (because .bib is less concretely specified than CSL).

In Zotero, you can specify the article number for a journal article by entering Number: 123 in Extra.

The APA CSL style does print the article number if there are no page numbers, in accordance with the APA manual.

@bwiernik bwiernik closed this as completed Jan 6, 2022
@adam3smith
Copy link
Member

I think the main context here is JabRef, which is bib(la)Tex native and supports CSL, which is great, of course.
But the way to troubleshoot is indeed by checking how a CSL style performs with CSL metadata, and if it does correctly with that, check the . bib to CSL conversion.

@ThiloteE
Copy link
Author

ThiloteE commented Jan 8, 2022

Thank you all for the fast replies :-) I was feeling a little overwhelmed as both you at CSL and Michel from citeproc both claimed that the code should be alright. Yes, indeed the context is mainly Jabref, which is bib(la)Tex native so i was not sure how to troubleshoot with original CSL metadata. Your comments were very helpful though. Turns out, me and all the others in the discussion at Jabref were not aware of this:

the style does this right: it prints the issue whenever it is in the data and the number when no page range is present, entirely independent of the issue number.

I did some more testing and found that the following is Jabref's current behaviour relative to including and excluding page-ranges:

@Article{foo..in,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  title   = {issue + number + no-pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + number + no-pages. Bib(La)TeX Journal, 9issue, Article 3number.

@Article{foo..n,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  title   = {number + no-pages},
}

= Foo, B. (n.d.). number + no-pages. Bib(La)TeX Journal, Article 3number.

@Article{foo..i,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  title   = {issue + no-pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + no-pages. Bib(La)TeX Journal, 9issue.

@Article{foo..i,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  pages   = {45--67},
  title   = {issue + pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + pages. Bib(La)TeX Journal, 9issue, 45–67.

@Article{foo..n,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  pages   = {45--67},
  title   = {number + pages},
}

Foo, B. (n.d.). number + pages. Bib(La)TeX Journal, 45–67.

@Article{foo..in,
  author  = {Foo, Bar},
  journal = {Bib(La)TeX Journal},
  number  = {3number},
  pages   = {45--67},
  title   = {issue + number + pages},
  issue   = {9issue},
}

= Foo, B. (n.d.). issue + number + pages. Bib(La)TeX Journal, 9issue, 45–67.

Seems alright then!

I don't have the original APA manual of style at hand (the issue was not raised by me), so i can't cross-check, but, if what was mentioned here is correct, then this would conform to APA 7th edition and there are no conversion issues in this regard when using https://github.com/michel-kraemer/citeproc-java.

Great! The problem was no problem, unless proven otherwise.

@adam3smith
Copy link
Member

Yes, those all look right to me, thanks for checking

@ThiloteE
Copy link
Author

ThiloteE commented Aug 11, 2022

So, after a period of learning, discussions and thinking, I was working on a pull-request for JabRef using the following mapping:

BibTeX BibLaTeX CSL proposed logic, conditions and info
volume volume volume
number issue issue For conversion to CSL or BibTeX: BibLaTeX number takes priority and supersedes BibLaTeX issue
number number issue For conversion to CSL or BibTeX: BibLaTeX number takes priority and supersedes BibLaTeX issue
pages eid number Some journals put the article-number (= eid) into the pages field. If BibLaTeX eid exists, map to csl number and provide this to the style. If pages exists, map to csl page. If eid WITHIN the pages field exists, detect the eid and map to csl number. If both eid and pages exists, ideally map to both csl number and csl page respectively and provide this to the style. Ideally the citationstyle should be able to flexibly choose the rendering. If this is not possible then map biblatex eid to CSL page, since this is sufficient to comply with APA 7th edition, but will break other citationstyles (e.g. IEEE)
pages pages page ""

Finally, I came to the conclusion that there are indeed some inconsistencies in the CSL style files.

  • When I map biblatex eid to CSL number, IEEE works as expected, but APA 7th edition will not render this article-number.

    Proof via customized JabRef:

    This entry

     @Article{Fooeic,
       author                     = {Foo, Bar},
       journaltitle               = {Bib(La)TeX Journal},
       title                      = {eid + issue + number},
       eid                        = {Article 6eid},
       issue                      = {9issue},
       number                     = {3number},
    

    Results in

    • IEEE: B. Foo, “eid + issue + number,” Bib(La)TeX Journal, no. 3number, Art. no. Article 6eid.
    • APA 6th edition: Foo, B. (n.d.). eid + issue + number. Bib(La)TeX Journal, (3number).
      (Sorry, could not test with apa 7th, because the style files will only be injected after proper release, but APA7th and APA6th are similar in this regard)
  • When I map biblatex eid to page, APA 7th edition works as expected, but IEEE breaks by detecting a page instead of an article number.

Inspecting and trying to understand CSL style files of APA 7th edition and IEEE, I think I have found the inconsistency:

APA 7th edition (2022-07-26 18:07:54):

  <macro name="container-periodical">
    <group delimiter=". ">
      <group delimiter=", ">
        <text variable="container-title" font-style="italic" text-case="title"/>
        <choose>
          <if variable="volume">
            <group>
              <text variable="volume" font-style="italic"/>
              <text variable="issue" prefix="(" suffix=")"/>
            </group>
          </if>
          <else>
            <text variable="issue" font-style="italic"/>
          </else>
        </choose>
        <choose>
          <if variable="page">
            <text variable="page"/>
          </if>
          <else>
            <!-- Ex. 6: Journal article with article number or eLocator -->
            <!-- This should be localized -->
            <text variable="number" prefix="Article "/>
          </else>
        </choose>

IEEE (2022-02-06 02:19:36):

  <macro name="page">
    <choose>
      <if type="article-journal" variable="number" match="all">
        <group delimiter=" ">
          <text value="Art."/>
          <text term="issue" form="short"/>
          <text variable="number"/>
        </group>
      </if>
      <else>
        <group delimiter=" ">
          <label variable="page" form="short"/>
          <text variable="page"/>
        </group>
      </else>
    </choose>

As far as I understand it, IEEE looks at variable="number" first, then looks at variable="page". APA ONLY looks at variable="page" then tries to detect number within.

@ThiloteE
Copy link
Author

ThiloteE commented Aug 11, 2022

Proposed solution:

Change APA 7th edition to detect CSL number, unless content is detected from CSL page. This would allow me to map biblatex eid to CSL number instead of CSL page.

Maybe roughly something like this?

          <if variable="page">
            <text variable="page"/>
          </if>
          <else>
            <!-- Ex. 6: Journal article with article number or eLocator -->
            <!-- This should be localized -->
            <text variable="number" prefix="Article "/>
          <else>
            <variable="number">
            <text variable="number" prefix="Article "/>

Sorry, my first attempt at coding in CSL :D

@adam3smith
Copy link
Member

Thanks -- we're planning on changing the handling of article numbers in APA anyway, I believe that should take care of your concern -- re-opening this open to track that issue (CC @bwiernik )

@adam3smith adam3smith reopened this Aug 12, 2022
@github-actions github-actions bot added the waiting-for-response-from-contributor The ticket/pull request is awaiting input from the contributor/depositor label Aug 12, 2022
bwiernik added a commit that referenced this issue Oct 2, 2022
@github-actions github-actions bot removed the waiting-for-response-from-contributor The ticket/pull request is awaiting input from the contributor/depositor label Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants