Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 09-19-2020, 05:29 PM   #1
artbum
Junior Member
artbum began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2020
Device: Pages, Calibre
Calibre Editor: return not to make new paragraph?

Sorry for the clunky title. What I was trying to say:

In the Editor, I hit Beautify so I can see the code of course. Epub file generated from Apple Pages.

But now it adds paragraphs every time there's a return. It's taking me forever to delete all of those unwanted blank paragraphs and I have to do it to 2 more books. Yes, I added a blank paragraph in Pages to separate the paragraphs with white space.

So is there a setting in the Calibre Editor preferences or something that says "Return makes new paragraphs" that I can turn off?
artbum is offline   Reply With Quote
Old 09-19-2020, 07:43 PM   #2
theducks
Well trained by Cats
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: 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
Blank lines in Code view are not 'Paragraphs'. (They just make it easier to read code. The render engines ignore those because a Paragraph is always between a tag pair. Another thing render engines tend to ignore is repeated spaces (there were 5 between those words)
theducks is offline   Reply With Quote
Advert
Old 09-19-2020, 07:59 PM   #3
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,082
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by artbum View Post
Sorry for the clunky title. What I was trying to say:

In the Editor, I hit Beautify so I can see the code of course. Epub file generated from Apple Pages.

But now it adds paragraphs every time there's a return. It's taking me forever to delete all of those unwanted blank paragraphs and I have to do it to 2 more books. Yes, I added a blank paragraph in Pages to separate the paragraphs with white space.

So is there a setting in the Calibre Editor preferences or something that says "Return makes new paragraphs" that I can turn off?
If you want to get rid of the extra line feeds that Beautify adds then this regex search and replace will do it in a couple of seconds.

search:
Code:
\n\n  <(.*?) class=
replace:
Code:
\n<\1 class=
Set mode to Regex--All text Filles
Them press Replace All

bernie

P.S.
The return does not add a paragraph it adds a line feed.
Code:
\n
gbm is offline   Reply With Quote
Old 09-19-2020, 09:43 PM   #4
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 387
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
Quote:
Originally Posted by artbum View Post
Yes, I added a blank paragraph in Pages to separate the paragraphs with white space.
So are you seeing the blank paragraphs as something like <p class="whatever"></p> ? In other words, real but empty paragraphs, not just blank lines, in code view?

If that is the case, just search for the <p class="whatever"></p> string and replace with nothing. Use replace all, all text files, to do it in a second.

The downside might be, if you also used simple, multiple returns to make scene breaks, it will clobber those as well. If that is the case, find the scene breaks first and put something else there, like <p class="whatever">***</p>
retiredbiker is offline   Reply With Quote
Old 09-19-2020, 10:37 PM   #5
artbum
Junior Member
artbum began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2020
Device: Pages, Calibre
ok yeah, they are not technically paragraphs but more like extra white space between actual paragraph tags. I did a combination of brute force delete and using the find/replace. thanks
artbum is offline   Reply With Quote
Advert
Old 09-22-2020, 03:52 AM   #6
artbum
Junior Member
artbum began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2020
Device: Pages, Calibre
Ok solved it.

Extra line spaces between paragraphs. Changed white-space:normal instead of “pre-wrap” as it was before in every xhtml page. Then class margin-top to 1.5em.

Now no matter how many times I hit return, it won't add breaks (and white space) between paragraphs in the preview and more importantly, in Google Play Books. (looked fine in Apple iBooks).

btw I had said that "I added a blank paragraph in Pages to separate the paragraphs with white space." But that was an early file, the latest I was using had no extra returns. I had done it the right way: Space after paragraph. And it was still adding white space. But now I know why.
artbum is offline   Reply With Quote
Old 09-22-2020, 04:20 AM   #7
artbum
Junior Member
artbum began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2020
Device: Pages, Calibre
oh. Just realized I can just triple-click to delete the whole line:

<div class="body" style="white-spacere-wrap; line-break:strict;">


I guess it was added by Pages.
artbum is offline   Reply With Quote
Old 09-27-2020, 08:26 PM   #8
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: 73,974
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by artbum View Post
oh. Just realized I can just triple-click to delete the whole line:

Code:
<div class="body" style="white-space:pre-wrap; line-break:strict;">

I guess it was added by Pages.
One very important note. Pages is garbage, Don't use it.
JSWolf is online now   Reply With Quote
Reply

Tags
paragraphs


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Should I return the Onyx Note Pro? Did I make a mistake passing up the Note? qwert Onyx Boox 4 06-19-2019 07:34 AM
Calibre paragraph spacing ebookscovers Conversion 4 02-01-2018 09:37 PM
Use Editor to Make AZW Periodicals? jesse s Editor 7 09-08-2016 10:23 AM
Preference: Paragraph indent or a little paragraph spacing? 1611mac General Discussions 48 11-11-2011 12:43 AM


All times are GMT -4. The time now is 06:50 AM.


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