4

The following code in my tex4ebook config file

\Css{
.newpage{page-break-before:always;} 
/* chapter heading */ 
h2.likechapterHead {
        font-family:"Montserrat", "Helvetica", sans-serif;
        font-size:1.7em;
        font-weight:normal;
        margin: 15% 0 0 0;
        page-break-after:avoid;
        text-align:center;
        text-indent:0;
}
}

Adds this to my epub css file:

.newpage{page-break-before:always;} /* chapter heading */ h2.likechapterHead { font-family:"Montserrat", "Helvetica", sans-serif; font-size:1.7em; font-weight:normal; margin: 15page-break-after:avoid; text-align:center; text-indent:0; } h2.chapterHead { font-family:"Montserrat", "Helvetica", sans-serif; font-size:1.7em; font-weight:normal; margin: 15page-break-after:avoid; text-align:center; text-indent:0; } /* end chapter heading */

Is there a way to add newlines to make the css file more readable?

1 Answer 1

4

No, the \Css command always joins the lines. If you want to write multiple CSS rules, you need to use multiple \Css, or save them to a separate CSS file, which can be then included using the \Configure{AddCss} command:

\Preamble{xhtml}
\Configure{AddCss}{mycss.css}
\begin{document}
\EndPreamble

I would prefer this way, it is much easier to include a big number of CSS rules this way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .