![]() |
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 |
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.
|
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>eg. Code:
.spacing {margin:2em 0}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}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! |
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.
|
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??
|
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! |
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! :D |
Quote:
|
If my padding-top: 2em fails, then the program in used is not just garbage, but a garbage dump.
|
So helpful, Jon. :rolleyes:
|
Quote:
|
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! |
Quote:
|
I'm not talking about reliable spacing, but about reliably replacing the spacing with asterisms when at a page border.
|
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. ;)
|
| All times are GMT -4. The time now is 10:50 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.