View Single Post
Old 09-20-2019, 08:29 AM   #10
deback
Book E d i t o r
deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.deback ought to be getting tired of karma fortunes by now.
 
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
Your solution is one alternative, Reader Bill, but if you use the class "chapter" for every chapter title, and then convert the file, Calibre Convert will automatically place each chapter at the beginning of a new page (without having to enter the "page-break-before" code). You can also use the Generate TOC from Xpath function to create the TOC by pasting the following in the Level 1 TOC line (before opening the Wizard--my macro for the following line is ctrl-alt-T).

//h[re:test(@class, "chapter", "i")] (The beginning of this line should be / / h : p -- or -- / / h : h 1 --without the spaces.)

Here is the coding for chapter titles:

<p class="chapter">Chapter 1</p>

If you learn how to use classes for all the sections in a book and place the codes for each class in the CSS file, it will be much easier for you to configure how you want each section, as compared to using only <p> for everything.

Here's a sample coding for "chapter" in the CSS file:

.chapter {
display: block;
font-size: 1.4em;
font-weight: bold;
text-align: center;
margin-bottom: 2em;
margin-left: 0;
margin-right: 0;
margin-top: 3em;
}

Last edited by deback; 09-20-2019 at 08:40 AM.
deback is offline   Reply With Quote