I want to include a Bibliography in to epub format. With plain text compilation and latex all works well. Endnotes are included in epub format also. But how to include a Bibliography?
Scrivener has no understanding of what a bibliography is, and doesn’t know how to create one. What reference manager are you using?
Maybe for me it gets a litte bit clearer, when i know how epub is compiled in scrivener. With Plain Text and Tex it is clear. TEX handles all the stuff.
Is epub made of Plaintext to TeX to html to epub? Or is it Plaintext to HTML to epub. Or even another method?
I use bibdesk & zotero as a reference manager. in short bibtex.
This is a good question. The compiling to ePub process in Scrivener converts the internal RTF to MultiMarkdown which then processes the text into an ePub.
The problem with that and producing a bibliography is that Zotero or Bookends normally put temporary citations in Scrivener which are converted into full citations and a bibliography on the compiled file (DOCX, RTF, ODT). But the compiling process for ePubs doesn’t result in a scannable file.
My immediate reaction is:
- If the citations and bibliography are not very extensive, do it by hand in Scrivener;
- If they are too extensive for that, compile to RTF, scan that with Zotero, then copy and paste the resulting bibliography into the Scrivener project;
- Perhaps look into setting up your project to use Pandoc → PrinceXML to produce the ePub as that will do the bibliography as part of the process. Last year in a thread, @nontroppo posted a Scrivener project template for producing PDFs via Typst or PrinceXML:
I’m sure PrinceXML would be able to produce ePub, not just PDF!
I had no luck with the pandoc transformation. But i will experiment further.
What works for me now, except the clickable endnotes: Transfer with Plain Text to Tex. Compile externally with tex (for the bibliography) Use tex4ebook to compile the ebook.
P.S. With Pandoc Tex to epub also the bibliography is not build up
Still the endnotes are shown but not clickable. The bibliography is shown and clickable.
Pandoc has native EPub output, and native bibliography output, so it definitely works from Scrivener (you don’t need another intermediate like Typst or PrinceXML). For pandoc you need to specify the BIB file and a CSL file if you want a specific format and enable the citeproc
option.
Thanks for the tipp. Could you clarifiy how to set the bibfile and csl file option in the compile / Project settings? Where to enable the citeproc option?
Here is a scrivener project that compiles to EPUB with a bibliography:
refs.scriv.zip (31.6 KB)
And the EPUB it generates:
refs.epub.zip (9.8 KB)
I am using a Metadata document in the Binder to specify the BIB file:
and then running Pandoc directly from Scrivener using post-processing.
For pandoc you can specify everything as a command if you do this manually:
pandoc --to epub --citeproc --bibliography test.bib myscrivwork.md
Pandoc has quite a bit of custom metadata for EPUB output: Pandoc - Pandoc User’s Guide