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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-22-2014, 06:40 AM   #1
Bigo2
Connoisseur
Bigo2 began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Oct 2010
Device: Kindle3
Spaces between paragraphs

Hi

When converting from epub to mobi I often remove spaces between paragraphs using the feature "Remove spacing between paragraphs" in "Look & Feel".

However, in some cases this does not work.

When touching the "Remove spacing between paragraphs" there is this message "Spacing removal will not work if the source does not use paragraphs <p> or <div> tags" - which is probably the reason.

So, what is the solution to this? Could you help please?
Bigo2 is offline   Reply With Quote
Old 06-22-2014, 10:40 AM   #2
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,124
Karma: 5721184
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Ubuntu Linux, Cybook Opus, Motorola Xoom with Mantano Premium
Look at the source epub book and figure out how the spacing is done. Change it to <p> or <div> tags or remove whatever it is that takes extra space. Possibly using search and replace.
Adoby is offline   Reply With Quote
Old 06-22-2014, 11:45 AM   #3
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: 38,474
Karma: 19300555
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2), Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
Quote:
Originally Posted by Adoby View Post
Look at the source epub book and figure out how the spacing is done. Change it to <p> or <div> tags or remove whatever it is that takes extra space. Possibly using search and replace.
It could be some class like <p class="tx"> where tx is what would need to be fixed.
JSWolf is offline   Reply With Quote
Old 06-23-2014, 04:59 AM   #4
Bigo2
Connoisseur
Bigo2 began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Oct 2010
Device: Kindle3
Hi Adoby and JSWolf - thanks for your suggestions...
I know I can change the epub. Often I would convert it to html, edit whatever in Word, open it in Sigil and save it again as epub.

Recently I was asking how to convert an epub book which was completely in a bold font to mobi so the font would become normal.

Kovidgoyal suggested to use the Filter Style Information in the conversion dialog and filter out font-weight. And it works nicely!

For removing the spaces I thought that there would be some similar simple solution in the Look & Feel, perhaps putting something in Extra CSS or Filter Style Information…

Regards
Bigo2 is offline   Reply With Quote
Old 06-23-2014, 05:11 AM   #5
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: 38,474
Karma: 19300555
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2), Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
Quote:
Originally Posted by Bigo2 View Post
Hi Adoby and JSWolf - thanks for your suggestions...
I know I can change the epub. Often I would convert it to html, edit whatever in Word, open it in Sigil and save it again as epub.

Recently I was asking how to convert an epub book which was completely in a bold font to mobi so the font would become normal.

Kovidgoyal suggested to use the Filter Style Information in the conversion dialog and filter out font-weight. And it works nicely!

For removing the spaces I thought that there would be some similar simple solution in the Look & Feel, perhaps putting something in Extra CSS or Filter Style Information…

Regards
What is seems that you are doing is taking these eBooks and making them harder to edit. There is no reason to convert ePub to HTML just to crap them up with Word. Leave them in ePub and use Sigil to fix what's wrong. Using Calibre to convert to fix things that are easily fixable with Sigil also also a bad idea. All you do is (very possibly) make the code that much harder to deal with.
JSWolf is offline   Reply With Quote
Old 06-23-2014, 05:40 AM   #6
Bigo2
Connoisseur
Bigo2 began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Oct 2010
Device: Kindle3
Quote:
Originally Posted by JSWolf View Post
What is seems that you are doing is taking these eBooks and making them harder to edit. There is no reason to convert ePub to HTML just to crap them up with Word. Leave them in ePub and use Sigil to fix what's wrong. Using Calibre to convert to fix things that are easily fixable with Sigil also also a bad idea. All you do is (very possibly) make the code that much harder to deal with.
Thanks JSWolf - I believe you - I would prefer to use Sigil to remove the spaces between the paragraphs (in this case there are empty lines) but I don't know how to change the entire book easily. However, I know how to do it in Word, that's why I'm using it. In Word I am saving it as a Web Page, Filtered and then go to Sigil to be able to save it as epub...

Last edited by Bigo2; 06-23-2014 at 06:02 AM.
Bigo2 is offline   Reply With Quote
Old 06-23-2014, 01:00 PM   #7
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: 38,474
Karma: 19300555
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2), Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
What you are doing is adding layers of code and other junk that you don't need or even want.

Post a sample of your XML files and your CSS and maybe someone can help.
JSWolf is offline   Reply With Quote
Old 06-23-2014, 06:25 PM   #8
Bigo2
Connoisseur
Bigo2 began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Oct 2010
Device: Kindle3
Thanks JSWolf - I am going to find out how to edit it in Sigil or Calibre Edit Book so I don't have to use the Word...
Bigo2 is offline   Reply With Quote
Old 06-24-2014, 05:24 AM   #9
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Bigo2 View Post
For removing the spaces I thought that there would be some similar simple solution in the Look & Feel, perhaps putting something in Extra CSS or Filter Style Information…
When converting try the Delete blank lines between paragraphs option under Heuristic processing.

Attached Thumbnails
Click image for larger version

Name:	heuristic.jpg
Views:	29
Size:	206.1 KB
ID:	124570  
DoctorOhh is offline   Reply With Quote
Old 06-24-2014, 07:30 AM   #10
Bigo2
Connoisseur
Bigo2 began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Oct 2010
Device: Kindle3
Hi DoctorOhh - it does not work...

When checking this epub in Sigil, I have found that after every paragraph instead </p>, there is </p><br class="calibre1" />

So I used find and replace and after some time I was able to fix it all. I know I could've use Repace All, but I wanted to make sure not loosing something I did not want.

Thanks
Bigo2 is offline   Reply With Quote
Old 06-24-2014, 07:57 AM   #11
Bigo2
Connoisseur
Bigo2 began at the beginning.
 
Posts: 64
Karma: 10
Join Date: Oct 2010
Device: Kindle3
One more question:

When converting to mobi I like to indent the first line of the paragraph. I am setting the Indent size (about 0.2) in Look and Feel, but it is only available together with the Remove spacing between paragraphs. But this removes all the spacing, even between the sections...
So, is there some other way how to set the Ident?

Last edited by Bigo2; 06-24-2014 at 08:01 AM.
Bigo2 is offline   Reply With Quote
Old 06-24-2014, 10:00 AM   #12
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Bigo2 View Post
Hi DoctorOhh - it does not work...
It doesn't work on <br> but as the tool tip explains it does work when the space between paragraphs is created by blank paragraphs.

Quote:
Originally Posted by Bigo2 View Post
So, is there some other way how to set the Ident?
I don't know if this can be done automatically. If needed I usually edit the css in the editor to accomplish the change in indent.
DoctorOhh is offline   Reply With Quote
Old 06-24-2014, 11:29 AM   #13
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 15,244
Karma: 6020307
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Bigo2 View Post
Hi DoctorOhh - it does not work...

When checking this epub in Sigil, I have found that after every paragraph instead </p>, there is </p><br class="calibre1" />

So I used find and replace and after some time I was able to fix it all. I know I could've use Repace All, but I wanted to make sure not loosing something I did not want.

Thanks
That construct is a forced break (after a paragraph ends . I thought BR's had to be inside a block element?)

Code:
search: </p>\s*<br class="calibre1" />\s+(<p class="value_here">)

replace: </p> \1
You might get away with just removing just a BR if it follows a </p>
(?</p>\s*)<br class="calibre1" />
theducks is offline   Reply With Quote
Old 06-24-2014, 12:30 PM   #14
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: 38,474
Karma: 19300555
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2), Sony PRS-650, Sony PRS-T1, nook STR, iPad 1, iPhone 5
Quote:
Originally Posted by DoctorOhh View Post
When converting try the Delete blank lines between paragraphs option under Heuristic processing.
That sometimes removes section breaks as well. Better off doing it via the code/CSS.
JSWolf is offline   Reply With Quote
Old 06-24-2014, 03:49 PM   #15
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,124
Karma: 5721184
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Ubuntu Linux, Cybook Opus, Motorola Xoom with Mantano Premium
Quote:
Originally Posted by Bigo2 View Post
Hi DoctorOhh - it does not work...

When checking this epub in Sigil, I have found that after every paragraph instead </p>, there is </p><br class="calibre1" />

So I used find and replace and after some time I was able to fix it all. I know I could've use Repace All, but I wanted to make sure not loosing something I did not want.

Thanks
Well done!
Adoby is offline   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
CSS to indent paragraphs and remove spaces Alda Sigil 7 06-20-2014 06:36 AM
Removing spaces between paragraphs Skydog Calibre 12 02-20-2013 09:52 PM
Spaces between Paragraphs in FBReader? luqmaninbmore PocketBook 2 03-10-2010 10:09 AM
Huge Spaces Between Paragraphs diremommy Calibre 0 12-29-2009 07:30 PM
Mobi -> LRF, huge spaces between paragraphs Djehuty Calibre 3 04-22-2009 01:06 PM


All times are GMT -4. The time now is 05:04 AM.


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