I have released Alexandria 0.2.1, which updates Hayagriva to 0.8.1 (long overdue – it came out in February…) and thus fixes some bugs. Thanks to @Ujjwal_Jyoti_Goswami for making me aware of this.
You mentioned that show rules on bibliography do not work on the Alexandria generated ones, is there a way around this for making the font size of the bibliography entries smaller? Another place where I would normally want to use show rules is to interpret markup, like you suggested in this post How to interpret Hayagriva data as content instead of strings? - #3 by SillyFreak
In theory I could change Alexandria to use elembic for enabling show rules, but that’s not how it works right now.
The best thing for now is to use your own wrapper function:
#let bibliographyx(..args) = {
set ...
alexandria.bibliographyx(..args)
}
as long as you don’t have dozens of bibliographies all over the place, making that change is probably not too much work.
I get what you mean (I think), but If I were to, for example, set the text to 0.8em in the wrapper the heading size would also change, right? Specifically, I am using this Alexandria API to render different bibliographies for Web and Literature sources
heading(level: 1, "Bibliography")
set heading(numbering: none, offset: 1)
context {
let (references, ..rest) = get-bibliography("x-")
let is-internet-source(x) = {
return (
x.details.type in ("web", "blog")
or if "parent" in x.details.keys() {
x.details.parent.type in ("web", "blog")
} else { false }
)
}
render-bibliography(title: [Scientific Literature], (
references: references.filter(x => not is-internet-source(x)),
..rest,
))
render-bibliography(title: [Internet Sources], (
references: references.filter(x => is-internet-source(x)),
..rest,
))
}
That’s correct, but that’s also how vanilla Typst behaves:
#show bibliography: set text(0.8em)
#bibliography(...) // title is smaller
for the example you showed, you could add the following rules between your bibliographies:
set text(0.8em)
show heading: set text(1em / 0.8) // or 1.25em
… but really, I’d pull the title out:
[= Internet Sources]
set text(0.8em)
render-bibliography(title: none, ...)
That makes sense, thanks!
The 0.2.2 release of Alexandria is currently pending: alexandria:0.2.2 by SillyFreak · Pull Request #3641 · typst/packages · GitHub
It should be compatible with 0.2.1 and thus I only increased the patch version, but it has some nice new features ![]()
- Alexandria now uses Hayagriva 0.9, bringing it on par with Typst 0.14 and incorporating bugfixes such as for `ibid-with-locator` becomes `ibid` although the supplement differs · Issue #280 · typst/hayagriva · GitHub
- (Math) markup contained in references is now rendered correctly
- Alexandria now also supports footnote citation styles
- Bibliography parsing errors now contain linen number information, like Typst’s own error messages do
- Thanks to a contribution, the manual is now hopefully clearer on a few of Alexandria’s core features
Alexandria 0.2.2 will probably be merged on Monday. I hope you will enjoy the extra capabilities ![]()