Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-02-2020, 10:31 AM   #1
andy9279
Member
andy9279 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2013
Device: none
Problem adding extra lines in text

I am trying to edit an epub in Sigil before I use Calibre to remove spaces between paragraphs. Normally I don't have a problem doing this, but either Calibre adds space between paragraphs I do not want, or it removes the space between scenes inside of paragraphs I would like to maintain.

I would like to add something like this ***** between scene breaks inside of chapters where there's currently a space, or add multiple spaces, or something. But when I try to edit it in Sigil I see this command, not at the END of the paragraph where the scene break is, but at the start of the paragraph that will have the break at the end of it...

<p class="Normal-space-after">

Is there some way to search and replace all of these into something like, just as an example...

<p class="Normal-*****-after">

I know I cannot do this of course, but I think you get the idea.


Thank you for any help,
Andy
andy9279 is offline   Reply With Quote
Old 07-02-2020, 12:44 PM   #2
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 4,430
Karma: 2706854
Join Date: Nov 2009
Device: many
This really has nothing to do with Sigil or Calibre. Please ask your question in the Epub forum instead since it has to do with basic css.
KevinH is offline   Reply With Quote
Advert
Old 07-02-2020, 12:44 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 2,114
Karma: 13046358
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
dang it - Ninja'd again...


There are a lot of things that Calibre can do, but you certainly don't need to switch to it for simple spaces between lines.

One thing I think you may be getting confused about... Sigil can 'clean up' the display of your code so that it looks nice on the screen. This has zero effect on your epub. ePub readers/apps ignore blank space between the html tags like <p></p><p> etc. The tidying up that Sigil does just makes it easier to see your code and work on it. If you really don't like it doing this, you can go into Sigil's preferences and turn off the feature. I'm pretty sure it is default to run on open and on save. I personally have both of them turned off and then just right click on a file when I want to use this feature.

As a matter of style - it really makes book makers shudder if there are any blank/empty paragraphs just to create space between paragraphs like this:
Code:
<p>This is a normal paragraph.</p>
<p></p>
<p>This is a normal paragraph with space before and after.</p>
<p></p>
<p>This is a normal paragraph.</p>
It is much better to put your desired spacing in the css file.

eg.
Code:
.spacing {margin:2em 0}

<p>This is a normal paragraph.</p>
<p class="spacing">This is a normal paragraph with space before and after.</p>
<p>This is a normal paragraph.</p>
-- and don't forget to link your css file to your html files...

In your case, where you want to add asterisks to make a scene break, I would just put the asterisks in its own <div> and use css to style it however you want.

Code:
.SceneBreak {margin:2em auto; text-align:center; letter-spacing:1.5em}

<p>This is a normal paragraph.</p>
<div class="SceneBreak">*****</div>
<p>This is a normal paragraph after a scene break.</p>
<p>This is a normal paragraph.</p>
Be aware, also, that there is another discussion going on, in this thread, about the accessibility standards recommend using an <hr class="SceneBreak" /> to make your ePub more compliant.

As for a way to search and replace you can try the following regex. Caution: make a backup of your file, and don't use 'replace all' until you are sure the pattern is working for you.

find: <p class="Normal-space-after">(.*?)</p>
replace: <p>\1</p>\n<div class="SceneBreak">*****</div>

Cheers!

Last edited by Turtle91; 07-02-2020 at 12:50 PM.
Turtle91 is offline   Reply With Quote
Old 07-02-2020, 01:59 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 22,658
Karma: 126568186
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Prettify in Sigil has been a manual, opt-in-only process for quite a while now. You can turn off Mend on open/save, but there's no prettifying being done unless you right-click in Code View and manually do it.
DiapDealer is online now   Reply With Quote
Old 07-02-2020, 02:08 PM   #5
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 2,114
Karma: 13046358
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2 & Air/Surface Pro/Kindle PW
hmmm....I thought they were both combined. Maybe I'm thinking that they did both 'cuz when you right click in Code View it does both??
Turtle91 is offline   Reply With Quote
Advert
Old 07-02-2020, 02:24 PM   #6
andy9279
Member
andy9279 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2013
Device: none
Thank you Turtle91! Using those commands and finding the right tags to replace I was able to figure it out.

It was a little confusing because in some epubs the paragraph BEFORE the scene break has the tag signifying a break, and in others it is the paragraph following it, but by changing around the Regex commands around it has worked with all the files I've needed to edit.

Thanks!
andy9279 is offline   Reply With Quote
Old 07-02-2020, 03:32 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 22,658
Karma: 126568186
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Turtle91 View Post
hmmm....I thought they were both combined. Maybe I'm thinking that they did both 'cuz when you right click in Code View it does both??
You have the choice of "Mend", or "Mend and Prettify" when right-clicking in Code View (both for the current file or for all files). But the Mend on Open/Save preference settings are just that: Mend only. Prettify only happens when you manually do it.

Mend only attempts to fix malformed xhtml. I myself haven't found a good reason to NOT leave both Mend on Open and Mend on Save enabled for a long, long time now. *shrug*

Too much more of this, and I'll have to move the thread back to the Sigil forum!

Last edited by DiapDealer; 07-02-2020 at 03:34 PM.
DiapDealer is online now   Reply With Quote
Old 07-02-2020, 05:15 PM   #8
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 1,613
Karma: 7401109
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Turtle91 View Post
Be aware, also, that there is another discussion going on, in this thread, about the accessibility standards recommend using an <hr class="SceneBreak" /> to make your ePub more compliant.
For scene breaks, best to just Keep It Simple Stupid (KISS) with centered asterisks. See my 2019 post in "Why is it so hard to preserve blank lines?"
Tex2002ans is offline   Reply With Quote
Old 07-02-2020, 06:31 PM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 58,606
Karma: 53778739
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
If my padding-top: 2em fails, then the program in used is not just garbage, but a garbage dump.
JSWolf is offline   Reply With Quote
Old 07-02-2020, 06:35 PM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 22,658
Karma: 126568186
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
So helpful, Jon.
DiapDealer is online now   Reply With Quote
Old 07-03-2020, 05:47 AM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 58,606
Karma: 53778739
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by DiapDealer View Post
So helpful, Jon.
It is being suggested to use something like asterisks instead of blank space. In case the program doesn't render the blank space correctly. If the program won't render the blank space correctly, then the program is not worth using and it's time to find one that will work.
JSWolf is offline   Reply With Quote
Old 07-03-2020, 06:20 AM   #12
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,220
Karma: 11044355
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Just to add to the confusion: some print books use spacing as "scene break", but if the scene break happens to fall at a page boundary, it is marked with an asterism of some sort. This makes the reader aware that there is a scene break, something that would be easily missed if it was only marked with spacing/indent.

1. Has this been successfully done in ePub books?

2. Since I believe it cannot be reliably done, I prefer to always use asterisms. Sure, extra spacing can be enforced, but it's easy to miss at the top/bottom of a page.

3. Unfortunately, it makes too many ebook conversions to "exactly" match the print version and have two kinds of scene breaks: with spacing and with asterism. It looks like they have different meanings, but they have not!
Jellby is online now   Reply With Quote
Old 07-03-2020, 06:41 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 58,606
Karma: 53778739
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
Quote:
Originally Posted by Jellby View Post
Just to add to the confusion: some print books use spacing as "scene break", but if the scene break happens to fall at a page boundary, it is marked with an asterism of some sort. This makes the reader aware that there is a scene break, something that would be easily missed if it was only marked with spacing/indent.

1. Has this been successfully done in ePub books?

2. Since I believe it cannot be reliably done, I prefer to always use asterisms. Sure, extra spacing can be enforced, but it's easy to miss at the top/bottom of a page.

3. Unfortunately, it makes too many ebook conversions to "exactly" match the print version and have two kinds of scene breaks: with spacing and with asterism. It looks like they have different meanings, but they have not!
2. Empty space can be reliably done. I use padding-top: 2em and that works even if the section/scene break falls at the bottom/top of the screen. Plus, you should have the first paragraph of the new section be non-indented. Using margin-top: 2em is not reliable and doesn't work for the bottom/top of the page.
JSWolf is offline   Reply With Quote
Old 07-03-2020, 08:13 AM   #14
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,220
Karma: 11044355
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
I'm not talking about reliable spacing, but about reliably replacing the spacing with asterisms when at a page border.
Jellby is online now   Reply With Quote
Old 07-03-2020, 08:18 AM   #15
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 22,658
Karma: 126568186
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Jon's stuck on the failure of margin-top to be reliably honored by all rendering engines for the time being. So he'll be incapable of discussing anything else.
DiapDealer is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please stop adding extra paragraphs?? wjBLqf-_9 Calibre 31 03-26-2020 04:40 PM
Adding date as extra tag ghudod Recipes 3 01-07-2013 11:54 PM
PDF to EPUB adds extra blank lines ?? Rojofo Conversion 3 06-01-2012 06:20 PM
Touch Dark lines between lines of text taming Kobo Reader 12 06-13-2011 07:20 PM
Extra space between some lines JDługosz Calibre 9 07-23-2010 09:04 PM


All times are GMT -4. The time now is 09:18 AM.


MobileRead.com is a privately owned, operated and funded community.