2

My MWE renders a PDF with two paragraphs with indents and no spacing between paragraphs, which is what I want

\documentclass{memoir}
\usepackage{blindtext}

\begin{document}
\blindtext

\blindtext
\end{document}

However, when I generate an epub with tex4ebook main.tex, I'm getting no indents and spaces between paragraphs on some readers, like this:

enter image description here

I'm using the memoir class, so tried \setlength{\parindent}{2em} but none of my attempts have retained indenting after the tex4ebook conversion to epub.

Looking at the epub file, the html class for the first para is noindent and the second is indent which is what I want, but the css files has the line p.indent{text-indent:0;}. When I change this to p.indent{text-indent:1.5em;} I get the indent that I'm looking for. Also, if I delete the line p + p{margin-top:1em;} from the css, I get rid of the space between paragraphs.

Is there a way to get these css changes by changing my LaTeX code? Or maybe changing my tex4ebook cfg file?

1 Answer 1

2

This one is quite easy, use the p-indent option:

$ make4ht filename.tex "p-indent"

You can read about most of TeX4ht options here, they are the easiest way to change some default values.

This is the result:

enter image description here

3
  • Thanks for the link! Commented Apr 23, 2023 at 15:55
  • Usage with tex4ebook is similarly: tex4ebook filename.tex p-indent
    – clel
    Commented Oct 13, 2023 at 15:40
  • 1
    @clel yes, tex4ebook supports most of options that work for HTML in TeX4ht.
    – michal.h21
    Commented Oct 13, 2023 at 15:50

You must log in to answer this question.

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