Answers.Body: <p>I cleaned up the code by deleting the excess id tags (these were added by inDesign when exporting to epub and were unnecessary), and that fixed it. Still no idea why this specific paragraph had issues and not others, which also contained excess id tags. Turns out, inDesign had added some nice little code to the CSS for the class "_idGenParaOverride-1" to ALWAYS page break after. So I guess the only lesson here is beware of the inDesign-created stylesheet...</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-06T05:38:12.970Z
Answers.LastActivityDate: 2018-09-06T05:43:31.803Z
Answers.LastEditDate: 2018-09-06T05:43:31.803Z
Answers.UserDisplayName: b_q
Body: <p>I'm inserting page markers to an epub file to then create a page list to reflect page numbers that mimic the print version of the book, i.e.:</p>
  
  <pre><code>&lt;span epub:type="pagebreak" id="page4" title="4" /&gt;
  </code></pre>
  
  <p>Oddly, sometimes the epub breaks to a new page to start the paragraph <em>following</em> the paragraph which contains the page marker. This is the code for the attached screenshot:</p>
  
  <pre><code>&lt;p class="paragraph _idGenParaOverride-1"&gt;&lt;span class="CharOverride-8"&gt;&lt;a id="_idTextAnchor016"&gt;&lt;/a&gt;Hostility of suffocation&lt;/span&gt;: Cea que nimpero eliqui dit as dendita tesenempos alignatiis evelit quas nos etur? &lt;span epub:type="pagebreak" id="page4" title="4" /&gt;Ehenti omnis rehent, occullo remolla num ea dus eum facit es sit facessed eos sernam dolupta ssequis sam es et qui commod quibust iostiis sus quiant aliquiam, sedi velis exped que ad evelignim laborrum et, quam et et pror apicipitata id que simus, si aborat ut am, sed ea quidige ndesed quas alibus et doloribus evenihit evendam ilictate quatatur?&lt;/p&gt;&lt;p class="paragraph"&gt;&lt;span class="CharOverride-8"&gt;&lt;a id="_idTextAnchor018"&gt;&lt;/a&gt;Religion&lt;/span&gt;: Ehenti omnis rehent, occullo remollanum ea dus eum facit es sit facessed eos sernam dolupta ssequis sam es et qui commod quibust iostiis sus quiant aliquiam, sedi velis exped que ad evelignim laborrum et, quam et et pror apicipitata id que simus, si aborat ut am, sed ea quidige ndesed quas alibus et doloribus evenihit evendam ilictate quatatur?&lt;/p&gt;
  </code></pre>
  
  <p><a href="https://i.sstatic.net/7Zh7a.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7Zh7a.png" alt="ebook screenshot"></a></p>
  
  <p>Obviously, there's plenty of room for the "Religion" paragraph to flow directly under the "Hostility" paragraph, but it keeps getting kicked to the next page. I can't find anything in the code that would do that, and the odd thing is this only happens sometimes. Other places where I have inserted the page marker code, the pages flow normally as expected. </p>
  
Tags: <kindle><epub><mobi><indesign><page-break>
Title: How to avoid sporadic page breaks in epub when using page markers?
UserDisplayName: b_q
ThreadText: # How to avoid sporadic page breaks in epub when using page markers?
  
  (Asked by: username_0 on 2018-09-06)
  
  I'm inserting page markers to an epub file to then create a page list to reflect page numbers that mimic the print version of the book, i.e.:
  
  
  Oddly, sometimes the epub breaks to a new page to start the paragraph following the paragraph which contains the page marker. This is the code for the attached screenshot:
  Hostility of suffocation: Cea que nimpero eliqui dit as dendita tesenempos alignatiis evelit quas nos etur? Ehenti omnis rehent, occullo remolla num ea dus eum facit es sit facessed eos sernam dolupta ssequis sam es et qui commod quibust iostiis sus quiant aliquiam, sedi velis exped que ad evelignim laborrum et, quam et et pror apicipitata id que simus, si aborat ut am, sed ea quidige ndesed quas alibus et doloribus evenihit evendam ilictate quatatur?Religion: Ehenti omnis rehent, occullo remollanum ea dus eum facit es sit facessed eos sernam dolupta ssequis sam es et qui commod quibust iostiis sus quiant aliquiam, sedi velis exped que ad evelignim laborrum et, quam et et pror apicipitata id que simus, si aborat ut am, sed ea quidige ndesed quas alibus et doloribus evenihit evendam ilictate quatatur?
  
  
  Obviously, there's plenty of room for the "Religion" paragraph to flow directly under the "Hostility" paragraph, but it keeps getting kicked to the next page. I can't find anything in the code that would do that, and the odd thing is this only happens sometimes. Other places where I have inserted the page marker code, the pages flow normally as expected.
  
  **Tags:** kindle, epub, mobi, indesign, page-break
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-09-06. Score: 1
  
  I cleaned up the code by deleting the excess id tags (these were added by inDesign when exporting to epub and were unnecessary), and that fixed it. Still no idea why this specific paragraph had issues and not others, which also contained excess id tags. Turns out, inDesign had added some nice little code to the CSS for the class "\_idGenParaOverride-1" to ALWAYS page break after. So I guess the only lesson here is beware of the inDesign-created stylesheet...
  
  
  ---
  
  