section-bibliographies icon indicating copy to clipboard operation
section-bibliographies copied to clipboard

quarto book, references appear in first chapter only when html is rendered

Open SereDef opened this issue 9 months ago • 7 comments

I am trying to have multiple references sections in my PhD thesis. This works fine in the rendered PDF (as shown in this example https://github.com/ronnyhdez/quarto_references_per_chapter)

Unfortunately, I cannot get it to work in the HTML output. Here is a snippet of the _quarto.yml file (my latest attempt)

format:
  html:
    filters:
      - section-bibliographies.lua
  pdf:
    documentclass: scrreprt
    filters:
      - section-bibliographies.lua

This however only displays the whole reference list under the first chapter, and nothing in the following chapters.

Could you help me getting the same result in html (and docx too ideally)?

SereDef avatar Mar 25 '25 20:03 SereDef

This is surprising, it should work in HTML, too. Is this still an issue, or did you find a way?

And thank you for your patience. It took a while, but now there's time to work on this.

tarleb avatar May 22 '25 08:05 tarleb

I have the same problem - the complete bibliography is rendering at the end of the first top level section...

aspatzier avatar Jun 02 '25 09:06 aspatzier

Things you could try:

  • Changing the level, at which the bibliography is inserted

    metadata:
      section-bibliography:
        level: 2
    
  • Modify the order, in which Quarto and this filter run. E.g.

    filters:
      - section-bibliographies
      - quarto
    

Should none of this work, then please provide a minimal example that could be used for debugging.

tarleb avatar Jun 02 '25 13:06 tarleb

Hey, thanks for the suggestions. I will prepare a repex and try them out in the coming weeks, but in the meantime, one sketchy workaround that solved it for me was just nesting the chapter under a part (docs). I then removed the part entry from the sidebar index "manually" to make it look like a regular chapter (see an example here if interested)

Note that I also had to slightly modify the lua filter to remove the chapter suffixes, which were probably there for a reason but were giving me issues identifying the bibliography entries (the undated filter is also here)

SereDef avatar Jun 04 '25 20:06 SereDef

Thanks for the great work with this extension. Unfortunately, I have also found that the bug persists in the html format. I have also tried with the possible solutions proposed but they are not valid.

Any progress on this? Lots of encouragement. Regards.

agustinggza avatar Jul 05 '25 10:07 agustinggza

@agustinggza please provide a (minimal) example that we can use to debug the issue.

tarleb avatar Jul 05 '25 16:07 tarleb

Sorry for the delay. I attach a compressed file where the HTML, pdf and docx outputs that I have prepared are included in the _book directory. I have also included a personal .lua file necessary to consider the references. My idea is that in each chapter to include the references and in addition, to add the references “not cited” and that are invisible in the text. That is the purpose of the nocitehidden.lua. The result is that in .pdf format it looks good but in .html only the biliography of the first chapter is generated. This error is similar to the one previously reported by Seredef.

Thank you very much for everything. If I can contribute anything else, feel free to contact me. Regards.

quarto_references_per_chapter-main.zip

agustinggza avatar Jul 13 '25 18:07 agustinggza