![]() |
#16 | |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Quote:
have just tried, but alas id didn't work. What it did do, was to stop the headlines to be split between two pages, so, that's something, but I still have "textless" headings. |
|
![]() |
![]() |
![]() |
#17 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
I have added also
page-break-after: avoid; but no joy ![]() If that wasn't enough, I have created a new style attached to the first paragraph after a heading with page-break-before: avoid; but that didn't work either. I wonder if something like widow/orphan would work, but couldn't find an example of how they work in this context. any ideas/advice/suggestions? TIA |
![]() |
![]() |
![]() |
#18 |
Dead account. Bye
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
I'm no expert but I think the correct CSS is page-break-after: avoid over the heading title.
I mean if you have: Code:
<h2 class="title">My heading</h2> <p>The paragraph I want to keep in the same page than "My title".</p> Code:
.title { ... ; ... whatever other settings it already has... ; ... ; page-break-after: avoid; } And take in mind that .block_ doesn't match ANYTHING. You must type it complete (.block_17 or whatever) |
![]() |
![]() |
![]() |
#19 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Hi arspr,
"block_" is just a short hand version of "block_some-number", so no problem there. At the moment this is the style for h2: Code:
.block_17 { display: block; font-family: "Liberation Sans", sans-serif; font-size: 1.66667em; font-weight: bold; line-height: 1.2; text-align: left; text-indent: 0; padding: 0; page-break-inside: avoid; page-break-after: avoid; margin: 68.6pt 0 34.3pt } ![]() This is what comes AFTER the heading: Code:
... </ol> <h2 id="id_RefHeading__5349_1529499100" class="block_17">Heading with no text</h2> <ol class="list_1"> <li class="block_100" value="338">yadda yadda yadda</li> ... ![]() Last edited by Arkadian; 09-12-2014 at 05:19 PM. |
![]() |
![]() |
![]() |
#20 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Right... I have tried to convert a small text sample.
If in the docx I select "keep with paragraph" in the "text flow" pane, when I change the file into an epub I see nothing... there is no trace of it. If instead I click on orphan and widow as well I get this: Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it"> <head> <title>Sconosciuto</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link href="stylesheet.css" rel="stylesheet" type="text/css"/> <link href="page_styles.css" rel="stylesheet" type="text/css"/> </head> <body class="calibre"> <h2 class="block_" id="toc_id_1">Headline goes here</h2> <ol class="list_"> <li class="block_1">yadda yadda yadda</li> </ol> </body></html> ________________ Oh... toc = Table of contents, so nothing there either. So, to sum up, from LO docx files to epub there is no control over the way text is split between pages, therefore I have to live with headings with no text ![]() Last edited by Arkadian; 09-12-2014 at 06:55 PM. |
![]() |
![]() |
![]() |
#21 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,741
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Arkadian Hmmm, is there anything in Conversion->Look and Feel->Extra CSS or Filter Style Information - if there is, take a note of what's there and rip it out
If you want to zip up your test DOCX, and the template (DOTX) it uses... ¿does Writer have DOTX's... and the resultant EPUB, and post it here then I'll have a look at it. I find it hard to believe that LO is not writing a valid DOCX, mainly because I think Kovid did his DOCX_Input PI testing on LO Writer created DOCX's. And I can say with near absolute certainty that my Keep with Next ticks in Word always translate into CSS styles that include the 'page-break-inside: avoid;' artefact ![]() BR |
![]() |
![]() |
![]() |
#22 | |
Dead account. Bye
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
|
Quote:
Possibly your renderer is trying to put <h2> and THE WHOLE <ol> in the same page. It is maybe impossible and then it just splits after <h2>... If the start numbering of the <ol> lists can be altered (I've never used this tag) you could try something like that: Code:
<h2 class="do_not_break_after_me">Your Title</h2> <ol class="just_the_first_item"> <li>First item</li> </ol> <ol class="continue_numbering_with_whichever_trick"> <li>Whatever goes after it.</li> ... </ol> |
|
![]() |
![]() |
![]() |
#23 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 691
Karma: 3026110
Join Date: Dec 2008
Location: Lancashire, U.K.
Device: BeBook 1, BeBook Pure, Kobo Glo, (and HD),Energy Sistem EReader Pro +
|
At the risk of not answering the original question, have you considered using one of the LO extensions to simply export your original document as an EPUB rather than convert with Calibre ?
I have found these can create css styling that is closer to the original source document and easier to understand. There are two main contenders : Luke's Writer2Epub add-on and Export to EPUB, part of the Writer2xhtml export filter extension from http://writer2latex.sourceforge.net/ (though this needs a tweaked version to run with the current LO). This creates css styles with the same name as the styles used in the original LO document. BobC |
![]() |
![]() |
![]() |
#24 | ||
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Quote:
Quote:
HOWEVER... the point of the matter is that my h2 style does comprise page-break-after: avoid; but it is not doing anything. The fact that LO does not produce it is neither here nor there at this moment in time. @arspr, why the <ol> tag is being used throughout I cannot say... There are lists in my doc, but even normal text is wrapped in these tags. So, if I get your suggestion right, you are saying I can try to separate the first sentence or whatever right after the h2 to see whether that helps... Although, now that I think about it, elsewhere I don't seem to have any problem splitting longer chunks of text between pages; even lists are being split halfway through (and of that I am not too fond of...) |
||
![]() |
![]() |
![]() |
#25 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,741
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Arkadian - well, well, well
When I open your DOCX in Word I see the Keep with Next checked. I dumped your test DOCX into calibre and converted using my 'everyday DOCX->EPUB' settings - guess what no - page-break-after: avoid; Zo, I attached my 'everyday Word Template' to your document, and converted it - guess what - the page-break-after: avoid; is there. As recently wrote elsewhere Quote:
We'll get there - even if it too late to catch the bus :lol: BR |
|
![]() |
![]() |
![]() |
#26 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Thanks BR, and good night (it is lunch time here...)
![]() What I forgot to say is that I am on a Mac, in case it does make a difference. I am running Mavericks and the latest versions of LO and Calibre. However, I stress again that IN MY CASE it is not so important to understand why I don't get that string in, because even when the string is indeed in... it doesn't work. Obviously these are two separate issues. |
![]() |
![]() |
![]() |
#27 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,374
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The DOCX plugin only supports keeping the contents of a single paragrpah on the same page, not multiple paragraphs. If you want to keep a set of paragrpahs together in EPUB you need to wrap them in div tags like this
<div style="page-break-inside:avoid"> <p> <p> ... </div> |
![]() |
![]() |
![]() |
#28 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,741
Karma: 30237526
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
On your MAC? If so in what viewer? On a device? If so what device and in what viewer (if is phone, or tablet)? Here's the style sheet I got from calibre when I applied my 'everyday' Word Template to your LO test document. Spoiler:
As we say down here, have a nice Satdee arvo BR |
||
![]() |
![]() |
![]() |
#29 | |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
Quote:
thanks for that. What I would like to accomplish, rather than keeping a whole paragraph together with the headline, is to keep at least a portion of it, as a whole paragraph may be too long. Anyway, must I do it what you suggest on every headline throughout the book or is there a shorter way? |
|
![]() |
![]() |
![]() |
#30 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: none
|
I am currently testing on my iPad using ibooks (I can't use the one on my iMac because iBooks doesn't seem to work properly (not just on my ebook, but on some test ones I was trying out as well)
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Left border for text within paragraph | democrite | ePub | 7 | 09-19-2013 03:26 AM |
Preventing Page Title from Being Inserted into Article Text | buffaloseven | Recipes | 0 | 07-25-2013 11:39 PM |
Paragraph text alignment in Fixed-Layout EPUB | Raja1205 | ePub | 0 | 05-11-2013 02:55 AM |
Continuous text with no paragraph breaks | midlifec | Calibre | 1 | 12-26-2010 04:09 PM |
Text Analysis & Paragraph Detection | ahi | Workshop | 15 | 09-14-2009 11:28 PM |