typst / hayagriva

Rusty bibliography management.
Apache License 2.0
350 stars 55 forks source link

Consider creating a ```title-short``` reference field for subsequent footnote entries (Hayagriva YAML) #213

Closed ironupiwada closed 1 month ago

ironupiwada commented 2 months ago

Currently, Hayagriva YAML supports only the title reference field. This is adequate for author-date references. However, when transferred from BibLaTeX files, Hayagriva YAML loses the shorttitle fields, whereas many footnote styles actually use them in CSL for subsequent entries. Moreover, there is no shorttitle in the Hayagriva documentation. Therefore, I suggest implementing a kind of this field in Hayagriva.

The code for improved entries would look like:

  type: book
  title: "1968. Czasy nadchodzą nowe"
  title-short: "1968"
  author:
  - Winnicka, Ewa
  - Łazarkiewicz, Cezary
  date: 2018
  publisher: 'Agora'
  location: 'Warszawa'

EDIT: Whereas Hayagriva supports such a code:

title:
      value: "1968. Czasy nadchodzą nowe"
      short: "1968"

CSL treats it as a shorthand, not as a shorttitle. The difference is that the short parameter shortens every footnote AND bibliographic entry, instead of leaving the full title in the first footnote and in the bibliography.

PgBiel commented 1 month ago

I believe this was a bug fixed in #174, can you verify with the hayagriva CLI built from latest main?

In particular, the shorttitle field from BibLaTeX files is now considered, and title: ... short: ... from YAML should also work properly now.

ironupiwada commented 1 month ago

I installed hayagriva (main release) and nothing changed. Consider the following code in Hayagriva:

Winnicka_1968_2018:
  type: book
  title: 
    value: '1968. Czasy nadchodzą nowe'
    short: '1968'
  author:
  - Winnicka, Ewa
  - Łazarkiewicz, Cezary
  date: 2018
  publisher: 'Agora'
  location: 'Warszawa'

and biblatex:

@book{Winnicka_1968_2018,
    author = {Winnicka, Ewa and Łazarkiewicz, Cezary},
    date = {2018},
    language = {pl},
    location = {{Warszawa}},
    publisher = {{Agora}},
        shorttitle = {1968},
    title = {1968. Czasy nadchodzą nowe},
}

Regardless of which bibliography I use (YAML or Bib), with shorttitle in YAML the result is the following:

obraz

And the bibliographic entry shows:

obraz

(note that I use the chicago-fullnote-bibliography-with-ibid style).

The Bib file, in turn, leads to the following outputs:

obraz

and the bibliographic entry shows:

obraz

Here it is clear that Hayagriva either prints only shorttitles as outputs (which is an evident error for chicago-like notes) or does not print shorttitles at all.

ironupiwada commented 1 month ago

OK, after compiling with the latest main release of typst (with Hayagriva 0.6), it works properly (even on custom CSL templates, as attached below). Thanks! obraz

PgBiel commented 1 month ago

Ah, I thought you were using hayagriva main in your previous comment. Note that the hayagriva CLI isn't used by typst, so installing it in your system doesn't change the hayagriva version used by typst (it includes its own copy of hayagriva). I was proposing testing using the hayagriva CLI directly, e.g. hayagriva bib.yml cite --key <name> --style chicago-notes to see what it produces, but I now see that I misunderstood your problem - this is about citing the same key multiple times, so you wouldn't be able to test it just with the CLI. I'm glad it's solved!