wikiti / pandoc-book-template

A simple Pandoc template to build documents and ebooks.
MIT License
392 stars 89 forks source link

[help wanted] How to create a page break? #15

Closed aahnik closed 3 years ago

aahnik commented 4 years ago

When there is an h1 tag, a new chapter starts. And it always starts from a new page.

But there is certain stuff, which I want to start from a new page.

I read and tried multiple methods, like

  1. This stack overflow answer Pandoc EPUB Page Break
  2. This open issue in Pandoc Page-break in other output formats than LaTeX #1934

Different people have suggested different methods. But nothing seems to be working in markdown --> epub.

I want to create a new page, for certain pages, without using an h1 tag. That means I don't want to make it a chapter. Just a page.

Any help would be much appreciated!

wikiti commented 4 years ago

Hi @aahnik ! I'll try my best to help you.

I've tried to use the following HTML block on a simple MD chapter, and it does work on Okular viewer:

Paragraph before page break.

<div style="page-break-before: always;"></div>

Paragraph after page break.

Perhaps your current ebook viewer does not handle those kind of blocks?

aahnik commented 4 years ago

This technique may work in some epub readers.

But unfortunately did not work in the readers I use

It worked in okular as you said.

Is there any universal way ?