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

More CSL features: multiple citations and paragraph format #2230

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Omikhleia
Copy link
Member

@Omikhleia Omikhleia commented Feb 16, 2025

Currently based on #2228 - to rebase accordingly

Objectives

  • Properly grouped mutiple citations
  • Handling of the CSL indentation rules (hanging-indent, second-field-align) in order to support more styles effectively (stretch goal: with IEEE as main target).
  • I think it will then also be the right time to switch to csl mode by default, while still keeping the legacy stuff for now.

Changes

  • Some code refactors
  • Some fixes and improvements
  • \nocite command for marking an entry as cited with out actually citing it (= force its inclusion in the list of cited works, as with LaTeX)
  • \cites command for grouped (multiple) citatations

Other notes

On the way, I tested a few more styles, now guaranteed not to crash 🤣 and produce something at least decent 🐰

  • IEEE (for the indentation rules) w/ and w/o URL.
  • ISO690 (author-date) and ISO690 (numeric), both English and French styles (I was told this one is often used in French papers, so heh)... And there was a bug in our locale logic (fix: Apply default locale on locale overrides without xml:lang). Doh.
  • APA, as several French styles are APA-derivatives (... and I thought APA was for Psychology-related journals, but apparently is used in many other contexts, incl. Humanities).
  • ACS

Closes #2196

Closes #2023

@Omikhleia Omikhleia added enhancement Software improvement or feature request packages:bibliography labels Feb 16, 2025
@Omikhleia Omikhleia self-assigned this Feb 16, 2025
@Omikhleia Omikhleia requested a review from alerque as a code owner February 16, 2025 20:26
@Omikhleia Omikhleia marked this pull request as draft February 16, 2025 20:26
@Omikhleia Omikhleia changed the title More CSL features More CSL features: multiple citations and paragraph format Feb 16, 2025
@Omikhleia Omikhleia force-pushed the csl-february-2025-feat branch from 0d4777f to 9d4c419 Compare February 17, 2025 19:01
@Omikhleia
Copy link
Member Author

Stretch goal achieved:

image

@Omikhleia
Copy link
Member Author

Omikhleia commented Feb 17, 2025

Bonus point achieved:1

image

Footnotes

  1. Current implementation does not honor display (left-margin, right-inline etc.) but at least doesn't crash and looks "decent" 😹 -- One small thing (highlighted) not investigated yet.

@Omikhleia Omikhleia added this to the v0.15.10 milestone Feb 17, 2025
@Omikhleia
Copy link
Member Author

Omikhleia commented Feb 17, 2025

One small thing (highlighted) not investigated yet ... but at least doesn't crash ...

Asouqi's Online Bibtex Converter gets it right:
image

Interesting, "choose/if" blocks should probably inherit the upper group delimiter:

  <macro name="issue">
    <group delimiter=", ">
      <text variable="volume" prefix="Vol.&#160;"/>
      <choose>
        <if variable="volume">
          <text variable="issue" prefix="no.&#160;"/>
          <text variable="page" prefix="p.&#160;"/>
        </if>
        <else-if variable="issue">
          <text variable="issue" prefix="No.&#160;"/>
          <text variable="page" prefix="p.&#160;"/>
        </else-if>
        <else>
          <text variable="page" prefix="P.&#160;"/>
        </else>
      </choose>
    </group>
  </macro>

I'll see if I can get it on this row of changes, or open a dedicated issue if time runs too short (as I am close to my "max allocated time" for the quarter 😄 )

EDIT: I should write a booklet "SILE and the web of citation styles. A critical assessment" in the same vein as my booklet on maths. This de facto CSL standard is slightly better than MathML (that is, as with so many standards in our doomed world, is quite bad, but at least this is an understandable shit here). 🤣

EDIT2: Aha! CSL "Delimiters from the nearest delimiters from the nearest ancestor delimiting element are applied within the output of cs:choose (i.e., the output of the matching cs:if, cs:else-if, or cs:else; see delimiters)" ... and I had left a FIXME for that exact mention. Now I understand where it's used and why 🤣

@Omikhleia
Copy link
Member Author

  • ISO 690 is now good (also with uppercase authors)
  • IEEE is better (correct name ordering, and abbreviation of given names)
    For the record the following issue is not ours:
    image
    It was introduced in the CSL style between late 2021 (what Asouqi's online translator uses for its predefined toggle) and 2024 (confirmed by using the latest CSL in that same tool; I haven't tried to bissect the commit). This is what happens with too complex standards and no proper regression tests...

@Omikhleia
Copy link
Member Author

  • APA looks better too (consistent superscripts across entries).

I think I am done with the things I wanted to see here.

(Well, we don't support yet citing multiple keys in our package,
but the formatting would have been wrong.)
Marking an entry for inclusion in the bibliography of cited works
even if not actually cited.
Some citation styles are for a given language (default-locale)
and contain locale overrides without xml:lang.
This is for instance the case for iso690-author-date-en.
If you really want the older legacy implementation, set bibtex.style to
"chicago" (or any othe custom style you might have implemented).
Note that the legacy implementation will however be removed at some
point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Software improvement or feature request packages:bibliography
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Citing multiple bibliography entries Chicago-style bibliography ignores the volume and subtitle
1 participant