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

Citing multiple bibliography entries #2196

Open
Omikhleia opened this issue Dec 11, 2024 · 0 comments
Open

Citing multiple bibliography entries #2196

Omikhleia opened this issue Dec 11, 2024 · 0 comments

Comments

@Omikhleia
Copy link
Member

Omikhleia commented Dec 11, 2024

SILE's 0.15.7 CSL support mimicked the csl:cite command on the legacy cite command.
Both thus accept only one key (as content or key parameter). To quote our documentation:

To produce an inline citation, call \csl:cite{⟨key⟩}, which will typeset something like “(Jones 1982)”. If you want to cite a particular page number, use \csl:cite[page=22]{⟨key⟩}. Other “locator” options are available (article, chapter, column, line, note, paragraph, section, volume, etc.) – see the CSL documentation for details. Some frequent abbreviations are also supported (art, chap, col, fig…).

However, the need to cite multiple entries, possibly each with its own locators, exist.
These would need to be in a single call to the CSL engine, as:

  • The style would add whatever delimiters it uses around the whole citation.
  • The style could even reorganize them. (We don't implement entry collapsing yet, but eventually we might get there)

In (Pandoc-flavored) Mardown, for instance, one may have:1

  • See [@doe;@smith] = rendered as, e.g. "See (Doe, 2022; Smith, 2024)"
  • Or with locators, See [@doe page 1; @smith chap 4] = "See (Doe, 2022, p. 1; Smith, 2024, chap. 4)"
  • Or eventually with also collapsing, See [@doe2023;@doe2024] = "See (Doe, 2023, 2024)"

I refrained proposing something in our initial implementation, because as noted above the legacy cite command compatibility was the first thing to get first of all, but also because the API in SIL TeX-like and/or SIL XML might not be straightforward and "natural"...

But it's certainly time to discuss it.

Would this be the "right" way?

\begin{citation}
  \cite[key=doe, ...]
  \cite[key=smith, ....]
`\end{citation}

= \citation{\cite[key=doe, ...]\cite[key=smith, ...]
= <citation><cite key="doe"/><cite key="smith"/></citation>

What do you think? The key issue here is that it introduces a "structured" top-level tag, where other content should likely be rejected (and all spaces ignored) -- We do already have something similar for lists, but the pattern is not that common in SILE's code base.
Also note that in such constructs,

  • the \cite node might even just be an AST command node without underlying command provided.
  • Or the \cite command may exist "outside" of a citation, and become a mere shortcut to it (i.e. \cite[...] at higher level is just processed as \citation{\cite[...]} would be.

Let's decide for a satisfying design first (the coding is easy afterwards).

Footnotes

  1. N.B. (I am not discussing here "author-in-text" @doe and "suppress-author" [-@doe] which would require a separate topic on their own. AFAIK, it's not really covered in CSL 1.0.2 and I don't really understand how this is supposed to "magically" work if ones follows those specifications. Clarifications would be welcome (in an appropriate issue?), if any knowledgeable reader passes by.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant