![]() |
#1 |
Member
![]() Posts: 13
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 |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
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> 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> 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> 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. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
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.
|
![]() |
![]() |
![]() |
#5 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
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??
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 13
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! |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,981
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
If my padding-top: 2em fails, then the program in used is not just garbage, but a garbage dump.
|
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
So helpful, Jon.
![]() |
![]() |
![]() |
![]() |
#11 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,981
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
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.
|
![]() |
![]() |
![]() |
#12 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
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! |
![]() |
![]() |
![]() |
#13 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78,981
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#14 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,543
Karma: 19001583
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.
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719646
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.
![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |