typst / hayagriva

Rusty bibliography management.
Apache License 2.0
289 stars 44 forks source link

Fix not using short titles #174

Open pjtsearch opened 1 month ago

pjtsearch commented 1 month ago

This PR is to address issue #173, which was that hayagriva did not use the BibTex shorttitle field for short titles in CSL. In order to fix this issue, I made two changes:

  1. In interop.rs, I added functionality for detecting if the BibTex shorttitle exists and adding it to the FormatString if it does.
  2. In taxonomy.rs, I fixed the code for StandardVariable::Title and StandardVariable::TitleShort being switched around. Previously, hayagriva would always select the short title for StandardVariable::Title, but would choose between the short title and long title for StandardVariable::TitleShort, which is obviously incorrect behavior. It appears that the behavior for StandardVariable::TitleShort was mistakenly placed in StandardVariable::Title. I fixed this issue by simply switching the code around.