crowbook icon indicating copy to clipboard operation
crowbook copied to clipboard

Chapter names are not respected by rendered EPUB.

Open risograph opened this issue 1 year ago • 5 comments

Hello. I am converting old books into EPUBs and many of them use Roman numerals to number their chapters. I want to respect this decision, so when creating multiple files for multiple chapters, I precede them with a chapter title (ex. # VIII #). It seems to work fine, but when it renders, crowbook automatically adds a "Chapter [number]" before the Roman number. How can I disable this behavior?

risograph avatar Nov 01 '24 20:11 risograph

You can set an option in your .book file, either:

rendering.chapter.template: "{{chapter_title}}"

to disable automatic numbering entirely and do it manually, or

rendering.chapter.roman_numerals: true

To use automatic numbering with roman numbers.

Hope this helps!

crowdagger avatar Nov 18 '24 20:11 crowdagger

Thank you for the support! This issue is still happening with your changes, though. I'll be more specific.

This is my first chapter's source file:

# I #
---

In my younger and more vulnerable years...

and with your change in my config file:

# ...

rendering.chapter.template: "{{{chapter_title}}}"

- src/1-Preface.md
+ src/2-I.md
+ src/3-II.md

# ...

the rendered epub appears like this:

Screenshot 2024-11-20 at 8 59 13 AM

When removing my source header altogether, the chapter simply disappears. I'm sure there is some way around this behavior but this change isn't working for me. After playing around, it seems like rendering.chapter.template simply changes how the chapter's name appears in the table of contents, and not the page itself. For example, setting the value to "FOOBAR" gives me this result:

Screenshot 2024-11-20 at 9 03 34 AM

Is there another template setting I can add that might remove the auto-generated chapter title?

risograph avatar Nov 20 '24 17:11 risograph

# #
---

In my younger and more vulnerable years

Removing the text within the title does the trick for now.

risograph avatar Nov 20 '24 17:11 risograph

I got it.

rendering.chapter.roman_numerals: true
rendering.chapter: " "

and

# #
---

In my younger and more vulnerable years...

did the trick.

Screenshot 2024-11-20 at 9 24 57 AM

risograph avatar Nov 20 '24 17:11 risograph

It's nice that you got it to worked but it's not exactly how it's supposed to work, so it makes more sense to reopen it :sweat_smile:

crowdagger avatar Dec 03 '24 08:12 crowdagger