11-29-2010, 11:19 AM | #1 |
Groupie
Posts: 171
Karma: 400
Join Date: Jun 2009
Device: Sony PRS-700, Nook Color
|
Odd formatting needs correction and TOC
Hi...I am brand new to Sigil and have some questions. I have some epubs that had been converted from pdf documents, and after the conversion there was a hard return after every 2 or 3 lines of text (effectively splitting up whole paragraphs). How can I remove these hard returns in Sigil in bulk so that I have a complete paragraph instead of groups of 2-3 lines without having to go line by line for each and every chapter and delete each hard return manually?
Also, the TOC for these pdf files did not convert properly. I deleted these erroneous files and used the TOC editor to check the chapters I want in the TOC, but how do I get Sigil to actually build the TOC file and add it to the book so that I have a working TOC? I am a real newbie at this program so any help would be appreciated. |
11-30-2010, 02:24 PM | #2 | |
Jr. - Junior Member
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
|
Quote:
To get rid of hard breaks go to "code view" under View and use the search/replace function ( a good one). A hard break will show up as <br /> in the code view. To create a TOC in Sigil you need to be in "Book View". Type in a TOC entry such as "Chapter 1" and highlight it. In a little box next to the blue "A" you will find a down arrow - click it and select "header 1-6. The lower the number the higher the priority and the larger the font size. You can go to the Tool tab and click TOC editor to see what Sigil did. Moving header text around can give strange results so check the TOC editor often. I hope I have been of some help. Regards - John I |
|
Advert | |
|
12-01-2010, 08:32 AM | #3 |
Groupie
Posts: 171
Karma: 400
Join Date: Jun 2009
Device: Sony PRS-700, Nook Color
|
Thanks. I checked the headers and they are there as you mentioned (listed as Header-1 in the drop-down box).
However, as far as the paragraph wrapping/spacing goes, there is no <br /> in the line codes. Each line is shown as being surrounded by paragraph codes like this: <p class="calibre1">Her husband, enclosed in his own protective bubble, had drawn his sidearm, and violence glittered in his</p> <p class="calibre1">eyes. "And you have no right to touch another man's wife!”</p> So far, I have been using Find/Replace to get rid of the </p> codes in Code view, and then going back to Book view to eliminate the extra white space this leaves between lines that are WITHIN a paragraph to get each paragraph to show up AS a whole paragraph. This seems to work, but it is a lengthy process. Is there a better way to do this "in bulk" instead of line by line so I get whole paragraphs and not separate "paragraphs" consisting of fragments of lines? |
12-01-2010, 09:53 AM | #4 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
One way I do a similar thing is with a bulk s&r (minimal match, regex and match case).
Search for Code:
</p>(.)(.) <p>([a-z]) Replace with Code:
\3 This will re-flow the lines that begin with lower case letters only. Edit: spelling |
12-01-2010, 09:59 AM | #5 |
Groupie
Posts: 171
Karma: 400
Join Date: Jun 2009
Device: Sony PRS-700, Nook Color
|
Forgive me for being such a newbie, but maybe I am not understanding what to do here? I opened up the Search/Replace function, and put </p>(.)(.) <p>([a-z]) into the "Find" box, and then \3 into the Replace box, but when I clicked "Replace All" I got the error "The search term was replaced 0 times". Do you know what I am doing wrong?
|
Advert | |
|
12-01-2010, 10:31 AM | #6 | |
Jr. - Junior Member
Posts: 586
Karma: 2000358
Join Date: Aug 2010
Location: Alabama
Device: Archos, Asus, HP, Lenovo, Nexus and Samsung tablets in 7,8 and 10"
|
Quote:
Regards - John |
|
12-01-2010, 10:45 AM | #7 |
Groupie
Posts: 171
Karma: 400
Join Date: Jun 2009
Device: Sony PRS-700, Nook Color
|
Yes, same result. This is what a section of my code looks like under Code view, so you can see what I am dealing with. These sentences should be all run together in the same paragraph:
<p class="calibre1">adding another runnel of blood to the countless wet trails already there. The man who had once been</p> <p class="calibre1">named Lord Death barely flinched. Over the years, pain had become a familiar friend. If Vadim Maur</p> <p class="calibre1">flayed the very skin from his bones, Shan doubted he would do more than groan even while his body</p> <p class="calibre1">writhed. Except for Elfeya. It was agony for her to watch his punishment, and her agony wounded Shan</p> <p class="calibre1">in ways the High Mage's worst blows never could. When he would have slipped forever into the hazy,</p> |
12-01-2010, 11:04 AM | #8 | |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
It should us what you have in that location Code:
<p class="calibre1"> TEST with a few "Replace"'s for unwanted side effects |
|
12-01-2010, 11:43 AM | #9 |
Groupie
Posts: 171
Karma: 400
Join Date: Jun 2009
Device: Sony PRS-700, Nook Color
|
OK, that worked better, but now instead of putting a blank space it does this, actually putting the "/3" into the text. Do you know what is causing that?:
\3Vadim Maur backed away from his two Fey captives. The cold sweat of terror—something he'd\3not felt in centuries—trickled down his spine.\3The v'En Celay matepair lay motionless on the dirty stone floor of their cage. The sudden blaze of\3light that had enveloped them was gone, and the broken shards of what had been sel'dor manacles and |
12-01-2010, 12:03 PM | #10 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Using you example texts
Search for Code:
</p>(.)(.) <p class="calibre1">([a-z]) Code:
\3 which will be the lowercase letter at the beginning of the new paragraph. (The reason I also store the two newlines is that I have a very similar one, and use this to differentiate between my two search values and then have a different replace value.) |
12-01-2010, 12:47 PM | #11 |
Groupie
Posts: 171
Karma: 400
Join Date: Jun 2009
Device: Sony PRS-700, Nook Color
|
That worked a lot better, Thank you. I still had to go through the chapter and tweak a number of paragraph breaks that didn't wrap properly for some reason, but it did work a lot better overall.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unutterably Silly When Automatic Spelling Correction Goes Wrong | RickyMaveety | Lounge | 11 | 10-01-2010 09:40 AM |
Possible Bug: Odd Glitches in Formatting .lit to .lrf | RJ_Cruze_Jr | Calibre | 7 | 08-02-2009 11:25 AM |
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working | Magitek | LRF | 0 | 05-06-2009 01:25 PM |
Amazon for Blackberry Now App Available! Correction. | daffy4u | News | 3 | 04-14-2009 09:30 AM |
Sony PRS505 for potentially $140 [Correction: Auction is for PRS-500U] | MidknytOwl | Deals and Resources (No Self-Promotion or Affiliate Links) | 24 | 10-15-2008 09:43 PM |