Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2021, 04:58 PM   #1
camdenmaine
Member
camdenmaine began at the beginning.
 
Posts: 13
Karma: 10
Join Date: May 2010
Device: iPad, Kidle
Justified paragraph becomes unjustified

This year I've been using Calibre as a conversion engine to take in a word file and put out epub. I then use Sigil to tweak. Recently I've noticed some justified paragraphs that mid-way through become left aligned, then sometimes even switching back to justifed. So the middle of a paragraph, for example, might be left aligned.
When I look at the code I see something like this:

<p>It is fairly apparent that high performing organizations have favorable <span class="calibre4">cultural profiles. </span> In addition . . .

Where calibre4 is defined as white space: pre-wrap; and pre-wrap messes up justification.

The odd thing is that there is nothing in the word document to occasion any special treatment of those two words. They are just in the middle of a paragraph.

One of my documents has hundreds of these seemingly random spans. I redefined the class as white space: normal; and everything went back to proper justification. Any idea what might be going on? Anyway, if you do conversion with Calibre, keep an eye on paragraph justification.
camdenmaine is offline   Reply With Quote
Old 02-17-2021, 05:26 PM   #2
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: 79,758
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
The solution is to install Diaps Editing Toolbag editor plugin and use that to remove all of those spans. It's better to get rid of the spans then it is to change the CSS and leave them. Plus, the code is a lot neater. And it reduces the size of the eBook.
JSWolf is offline   Reply With Quote
Advert
Old 02-17-2021, 06:08 PM   #3
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,072
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
In HTML multiple white space characters (spaces, tabs, etc.) are rendered as a single space, but in Word multiple white space characters are meant to all be significant.

I took a look at the code calibre uses to convert DOCX format and it appears that it uses white-space:pre-wrap in places where the Word document contains text that has extra white space.

In your case the sentence has two spaces after the period. The extra markup is being generated to assure that both spaces are rendered in the resulting EPUB.
jhowell is offline   Reply With Quote
Old 02-18-2021, 05:48 AM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jhowell View Post
In HTML multiple white space characters (spaces, tabs, etc.) are rendered as a single space, but in Word multiple white space characters are meant to all be significant.

I took a look at the code calibre uses to convert DOCX format and it appears that it uses white-space:pre-wrap in places where the Word document contains text that has extra white space.

In your case the sentence has two spaces after the period. The extra markup is being generated to assure that both spaces are rendered in the resulting EPUB.
↑ ↑ ↑ ✔

I would fix it in the DOCX.

BR
BetterRed is offline   Reply With Quote
Old 02-18-2021, 07:46 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: 79,758
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
So the old fashioned two spaces after a period is no longer valid.
JSWolf is offline   Reply With Quote
Advert
Old 02-18-2021, 10:33 AM   #6
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: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
So the old fashioned two spaces after a period is no longer valid.
I think that practice was developed FOR Mono spaced fonts (rickety old typewriters ) back in the darker ages. AFAIK HTML never rendered duplicate spaces, interpreting white space as a CODE readability effect.
theducks is offline   Reply With Quote
Old 02-18-2021, 05:08 PM   #7
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Pretty sure there are threads in the ePub and/or Workshop forums about getting a wider space between sentences.

There is a thinspace character, but, afaik, there's no wide/thick/fatspace character - why's that I've often wondered?

BR
BetterRed is offline   Reply With Quote
Old 02-18-2021, 07:59 PM   #8
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: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by BetterRed View Post
Pretty sure there are threads in the ePub and/or Workshop forums about getting a wider space between sentences.

There is a thinspace character, but, afaik, there's no wide/thick/fatspace character - why's that I've often wondered?

BR
There are 4 spaces on the editors character tool (top line)
I think emsp is your fat space
theducks is offline   Reply With Quote
Old 02-18-2021, 10:48 PM   #9
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Doh - there must have been a time when I knew that, for I just discovered I already have a custom shortcut for it in Word

BR
BetterRed is offline   Reply With Quote
Old 02-19-2021, 11:01 AM   #10
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,045
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
I search for multiple spaces (replace with one), lines starting or ending in space (delete space) and empty lines (delete) all as the LAST thing after all other edits. Then I save as in native and then docx for Calibre.

I only use non-standard width spaces for paper versions (like between a number and the unit abbreviation). I'd rarely use a non breaking space (either ctrl or alt space, I forget). I do sometimes have an non-paragraph return, but NEVER EVER on fully justified text.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Isolated unjustified lines in hardware readers randich Amazon Kindle 32 09-19-2015 04:27 PM
Full Justified or Left Justified? JSWolf General Discussions 96 02-04-2013 06:57 PM
Left-justified text in a right-justified box Skeezix Conversion 4 11-15-2011 08:44 PM
Justified word paragraph not wrapping in mobi wlloydw Conversion 0 03-05-2011 03:03 PM
html2lrf Unjustified Text Albertane Sony Reader 1 08-11-2007 06:54 PM


All times are GMT -4. The time now is 05:47 PM.


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