Bug Reports? #bibliography() function

UPDATE:
The repeated book title is a known issue.
The ,. formatting error is one I can consistently reproduce, so I have created on issue on Github.

–––ORIGINAL POST –––
I was unsure where to post this. It’s not quite a question for the forum, but when I checked GitHub I couldn’t see a way to report bugs without starting the process of making a PR, etc., and my coding skills aren’t really up to that.

I searched high and low, but I couldn’t find any other discussion of what I think I’ve found is a definite bugs in the #bibliography() function.

  1. For “book section” entries, Typst repeats the book title. That is, if my entry is “ThisChapter” in ThatBook, the Typst entry will be: “ThisChapter.” In ThatBook edited by These People, ThatBook.
  2. For certain types of entries (Document, Conference Presentation, Web Page), Typst is messing up the punctuation – usually with extra commas or periods.

I’m generating either BibLaTeX .bib or hayagriva .yaml files from zotero. And I’m comparing Typst to either direct bibliography creation in Zotero, or processing from Pandoc.

Hello @fronesis,

Welcome to the Forum,

Could you please share a minimum working example (MWE) that shows what the problem is and perhaps the expectation?

That way if we get some code that compiles, you are more likely to get some help. Otherwise it puts the burden on the forum users to try to figure out how to reproduce your problem.

An example of a MWE that you could copy and adjust to your liking:

#bibliography(bytes(
```
@incollection{chap1,
  author    = {Smith, Jane},
  title     = {A Chapter Title},
  booktitle = {The Book Title},
  editor    = {Jones, Bob},
  pages     = {10--25},
  year      = {2024},
  publisher = {Some Press},
}

@unpublished{ms1,
  author = {Brown, Alice},
  title  = {An Unpublished Manuscript},
  note   = {Unpublished manuscript},
  year   = {2024},
}
```.text
), style: "apa")

Test @chap1 and also @ms1

You can always report bugs as new issues on GitHub by clicking New Issue

2 Likes

Thanks @vmartel08. I’m going to follow up with more details. The closer I look at the ,. issue, the more confused I get.

But I wanted to respond quickly to say this: your test code above clearly reveals the main issue I’m talking about. I’m a new user so I cannot upload a PDF, but Typst will render your code with a repetition of the book title for the first entry.

3 Likes

If your bibliography uses incollection for the entry, it is a known issue with how Hayagriva (the bibliography management library used by Typst) maps the key to the CSL type, see #309. For now, you can use @inbook instead of @incollection as a workaround.

1 Like

Thanks, @flokl ! I had totally missed that in trying to see if this was a known bug.

One question: when you say"

For now, you can use @inbook instead of @incollection as a workaround.

  1. Do you mean just do a find and replace inside the data file itself?
  2. Or is there a way to export from Zotero and force something other than incollection. (I see that if there’s a bookAuthor field it will do inbook by default, but my entries do not have a book author.)

EDIT: I deleted my second question: that was MY mistake. I was using a plugin for zotero that allows you to export directly to YAML, and the ,. bug originated there.

1 Like

Unfortunately this, search and replace in the exported .bib file.

Updates:

  1. As @flokl helpfully pointed out, this is a known bug.
  2. But I do think I’ve found other, minor issues. For a number of different zotero types, there are punctuation issues. I’ve confirmed them for: Document Conference Paper and Web Page.

Here’s an example:

@inproceedings{cp1,
  title = {My {{Brilliant Paper}}},
  booktitle = {Boondoggle {{Conference}}},
  author = {Jones, Bob},
  date = {2024},
  location = {New York}
}

This will compile as:
Boondoggle Conference (New York),.

Similar issues crop up for the other types I listed – duplicate periods, or periods and commas next to one another.

I have used the same .bib files in Pandoc and the results are flawless.

UPDATE: I have now tested and confirmed period or comma issues with all three zotero types named above, which correspond to the following .bib types:

  • @inproceedings
  • @online
  • @misc

Any entry generated from one of those document types, or with one of those keys, will not display correctly: for all 3 there are either extra commas or extra periods.

After a lot more testing, I can consistently reproduce a formatting error – ,. – for various hayagriva types.

I have created on issue on Github.

1 Like