Search code examples
pandocepub

Paragraph indent when generating epub from txt in Pandoc


I generate an epub file from a simple txt file using pandoc. The text file text.txt is

Chapter 1

This is the text of paragraph 1.

This is the text of paragraph 2.

I generate an epub using pandoc -o file.epub text.txt. However, the paragraphs are not indented. Is there a way to tell pandoc to indent all the paragraphs without having to change the txt file ?


Solution

  • You can inject some CSS, either from a file with the --css option or by setting the header-includes variable, for example:

    pandoc -V header-includes='<style>p{ margin-left: 1em }</style>' text.txt -o file.epub