Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 04-09-2017, 12:39 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
About Word, letter-spacing and EPUB

Hi

About Word, letter-spacing and EPUB.

Some months ago, I found something unusual - and for me unexplained. Take an odt file made under LO. Save, open the odt with Word 2013. Make some trifle changes. Save as an odt. Everything loooks normal (the style of your titles may have changed).

Now with this odt;, convert to EPUB3 using ODTImport (or writer2xhtml). You'll find in the body of the EPUB stylesheet a letter-spacing property (values of 1px or 1.33px). There is only one explanation: this property has been unilaterally added by Word...

With odt files coming straight from LO, you'll never find this letter-spacing property (except of course if you deliberately put it inside).

Last edited by roger64; 04-09-2017 at 12:44 AM.
roger64 is offline   Reply With Quote
Old 04-10-2017, 01:55 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by roger64 View Post
Hi

About Word, letter-spacing and EPUB.

Some months ago, I found something unusual - and for me unexplained. Take an odt file made under LO. Save, open the odt with Word 2013. Make some trifle changes. Save as an odt. Everything loooks normal (the style of your titles may have changed).

Now with this odt;, convert to EPUB3 using ODTImport (or writer2xhtml). You'll find in the body of the EPUB stylesheet a letter-spacing property (values of 1px or 1.33px). There is only one explanation: this property has been unilaterally added by Word...

With odt files coming straight from LO, you'll never find this letter-spacing property (except of course if you deliberately put it inside).
That must be something that Word uses in its ODT filter then, as I never see this it all.
Toxaris is offline   Reply With Quote
Advert
Old 04-10-2017, 03:46 AM   #3
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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Toxaris View Post
That must be something that Word uses in its ODT filter then, as I never see this it all.
Nor me. I convert several ODTs every week to DOCX via Word 2010 and thence to ePub via calibre's DOCX->EPUB convert, or via Sigil's DOCX plugin (Mammoth). I suppose Word 2013 may use a different ODT filter.

Or maybe the Word template that's being applied has the Font Character Spacing set 'abnormally' in one or more styles. I always explicitly apply one of my own templates.

I just tweaked Font->Advanced->Character spacing to Expanded by .1pt in one of my template's Normal style. Then did a calibre convert, and I got 'letter-spacing' items in the css styles that originate from word styles that are based on the Normal style (which was most of them).

It's easy to screw up a Word template; tick one or two wrong boxes, in the wrong order, forget to set a radio button, and you're likely end up with upside down, mirror image, Katakana text - they're a minefield, full of dragons and hobgoblins

BR
BetterRed is offline   Reply With Quote
Old 04-10-2017, 06:26 AM   #4
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by BetterRed View Post
Nor me. I convert several ODTs every week to DOCX via Word 2010 and thence to ePub via calibre's DOCX->EPUB convert, or via Sigil's DOCX plugin (Mammoth). I suppose Word 2013 may use a different ODT filter.

Or maybe the Word template that's being applied has the Font Character Spacing set 'abnormally' in one or more styles. I always explicitly apply one of my own templates.

I just tweaked Font->Advanced->Character spacing to Expanded by .1pt in one of my template's Normal style. Then did a calibre convert, and I got 'letter-spacing' items in the css styles that originate from word styles that are based on the Normal style (which was most of them).

It's easy to screw up a Word template; tick one or two wrong boxes, in the wrong order, forget to set a radio button, and you're likely end up with upside down, mirror image, Katakana text - they're a minefield, full of dragons and hobgoblins

BR
It happened to me at each try (six times). The way to reproduce it is:
- one full featured odt file (all paragraphs and characters styles are set using a standard LO .ott model.
- open this file with Word 2013. Make some orthographic corrections (I use a nice macro for this). Save as an odt.
- publish this odt file using either writer2xhtml or ODTImport Sigil plugin.
- I get a letter-spacing property in the body of the EPUB3.

Not only this, but thanks to Word 2013, in the EPUB you'll get hundreds, even thousands of 'Policepardfaut" useless (because empty) spans in the text (coming from a new character style added in the odt.

If you or Toxaris wish to send me an odt file of yours by MP, I'll send you back an EPUB3.

PS: Could it be that Word 2013 applies some model I never asked for...? To be honest my Word knowledge is scant... I just wish to keep my odt as it is (styles) and only correct orthograph.

Last edited by roger64; 04-10-2017 at 07:45 AM. Reason: orthograph
roger64 is offline   Reply With Quote
Old 04-10-2017, 07:45 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
I don't use ODT at all. I only work with DocX files, so I wouldn't know. I do know that it does not happen in the DocX files by default (as BR said, you can pester Word easy enough to give strange results), therefore I said that I think it has to do with the filter Word uses to write ODT files.
Toxaris is offline   Reply With Quote
Advert
Old 04-10-2017, 11:14 PM   #6
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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@roger64 - they are not my ODT's, I download them from institutions and academia etc. I have no idea how they are produced. When I import ODT's into Word one the first things I do is apply one of my of existing Word templates. I then set all the paragraphs to the relevant template style.

Rather than me sending you an ODT, why don't you send me a small ODT that has the problems you speak of with Word 2013. I'll have a look in 2010 and then we should know if it's a problem specific to Word 2013, or all recent versions of Word or something else - like the ODT file.

I have to say this: most problems of this sort come from users who don't know how to use Word. I've never seen the 'cruft' that many people complain about (e.g. MSoNormal) when they convert Word documents, including when I was converting Filtered HTML. The major reason for the cruft is that they use inline styling (paragraph, font, text effects etc) rather styles defined in a Word template - which is a corollary to not using linked styles in HTML/CSS. I avoid in-line style, especially paragraph, like the plague.

I wonder if something similar is happening here, if the ODT was created using lots of inline styling rather than OTT styles, then Word is creating lots of the same 'cruft' in the DOCX as it does when someone does all their styling in-line rather than using its native template styles. I've some across people who attach elaborate style sheets, and then do all their styling in line.

But I'm puzzled - what can Word do typographically that can't be done in Writer, or more to the point in the calbre-editor or Sigil.

BR
BetterRed is offline   Reply With Quote
Old 04-11-2017, 07:13 AM   #7
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
I do not use any inline styling (I just map italics and bold.). Only "clean" paragraph or character styles coming from an .ott template.

I wish Word would not mess (interfere?) with any template of its own and just be happy modifying the text of the odt file it received. Maybe I ask too much...

My only reason for using Word is a special "post-OCR" macro (not coming from Microsoft) for French language. I know of no such efficient tool with LO.

But I know how to workaround these problems, using some regex.

Another "simple" problem you can check: take a standard cover image in odt. Give it a relative size (says width 90% height 100%). Import with Word. Stay with odt. When you get back your odt and later convert to EPUB3, your image has a width of 42%. and an empty paragraph has been added just to spoil the display. Absolutely no "work" had been requested to be done on this particular image. Funny, except when you have thirty images...

Last edited by roger64; 04-11-2017 at 07:40 AM.
roger64 is offline   Reply With Quote
Old 04-11-2017, 06:34 PM   #8
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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@roger64 - I don't have, need, or want Writer, so I have no means to do things to an ODT file. I get them from places like Sciences Po and the ECB, open them in Word and Save as DOCX. So, my knowledge of Writer is as scant as yours is of Word, maybe even more so.

I gave up on OOo last century, we (global financial services enterprise) hoped for Office on Steroids. what we got was Office on Mogadons, and absolutely no comprehension of commercial necessities. Made by academics, for academics, was our conclusion.

Why don't you rewrite the Word macro (presumably written in VBA) in one of Writer's preferred language for macros - I've seen mention of Python, Lua and R?

My offer to look at one of your ODTs in Word 2010 is still open, otherwise...

BR

Last edited by BetterRed; 04-12-2017 at 04:27 AM.
BetterRed is offline   Reply With Quote
Old 04-11-2017, 06:43 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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
PS : my memory is saying "Hang on BR, back in the 1900s OOo could import MS Office macros and convert them to OOo macros."

Don't the Libre, Apache versions have that feature.

Surprising there's not a version of the macro for Writer, given that a) it is specific to the French language, and b) the market penetration of OOo and its derivatives in France exceeds MS Office, even in the corporate market, and especially in government institutions.

BR

Last edited by BetterRed; 04-11-2017 at 08:33 PM.
BetterRed is offline   Reply With Quote
Old 04-11-2017, 11:23 PM   #10
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Many things can surprise us indeed.

This -big- macro has been a Word-only thing for some years already, and can't be converted to LO without a lot of work, if not it would have been done a long time ago.

I'll send you soon one odt file.

Edit: DONE

Last edited by roger64; 04-12-2017 at 06:58 AM. Reason: DONE
roger64 is offline   Reply With Quote
Old 04-12-2017, 08:26 PM   #11
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
To follow on this, here is a possible explanation of the image question above about relative size change which may be of interest for some readers. Maybe a better solution could be found with a newer Word version.

From BetterRed (a Word 2010 user)

Quote:
"The suspect the cover size reduction can be fixed by checking the File->Options->Advanced->Image Size and Quality->Do not compress setting. It's unchecked by default and I've never figured out how to set it to checked - permanently. It's a known Word idiosyncrasy. You need to change it before doing any editing, otherwise it won't stick to the document. "
Other points could not be checked, presumably because Word 2010 used by BetterRed can't deal with odt files as easily as Word 2013. I'll let BetterRed comment further on this.

Last edited by roger64; 04-12-2017 at 08:30 PM.
roger64 is offline   Reply With Quote
Old 04-12-2017, 10:33 PM   #12
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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
When I tried to open the ODT Roger sent me, Word 2010 reported it as being corrupt. Word offered to repair it, but I declined because that would have meant I would not have been dealing with what Roger sent - but a modified version.

If I can't open Roger's files, there's no point in me pursuing the issue any further.

I can open other ODT's in Word 2010.

BR

Last edited by BetterRed; 04-12-2017 at 11:42 PM.
BetterRed is offline   Reply With Quote
Old 04-13-2017, 06:47 AM   #13
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
If some Word 2013 user is keen to try, let him be known by PM. I can send him two -big- odt files and one EPUB3 plus some comments.

The first odt file has been produced with LO 5. Once opened with Word 2013 and modified using a macro, it became the second odt file used as a source for the EPUB3. This EPUB3 carries the Word "marks" mentioned further above.

Last edited by roger64; 04-13-2017 at 07:30 AM. Reason: PM
roger64 is offline   Reply With Quote
Old 04-13-2017, 07:14 PM   #14
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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Toxaris' word add in has a Mark feature, it can colour highlight words defined in a list, if I don't remove the highlighting before I save the DOCX and convert to EPUB I get ugly spans sprinkled though my EPUB.

The Dialogue Check feature of the add-in uses a tagging technique - at the end of the dialogue check the 'tags' are removed. This is a commonly used technique in Word macro's and add-ins. I use it directly in Word, Sigil, Notepad++ etc, there's probably a name for it - 'false flag substitution' springs to mind If the 'false flags' are left in place then they'll end up in the saved DOCX and hence in an EPUB created from the DOCX.

If I leave bookmarks in a DOCX, I get ugly spans sprinkled through an EPUB I create from it.

I have a Word macro that runs when a DOCX is opened, and another when its closed. I could include code in those macros that would inject text into the DOCX that would result in ugly spans in a subsequent EPUB.

@Roger - check all the macro's, you'll probably need to enable the Developer tab to see them all, maybe your Word has some dodgy macros installed. I've seen it happen with custom Excel installs in the corporate world. Look for that Policepar... string.

BR
BetterRed is offline   Reply With Quote
Old 04-13-2017, 07:48 PM   #15
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: 20,569
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
PS: also look for any add-ins (Options Add-ins) of doubtful provenance, e.g. not from MS. IIRC in a vanilla install of 2010 all the 'built in' MS add-ins are Inactive, might be different with 2013.

You might want to activate the two MS add-ins that find text marked as hidden and invisible, they are normally inactive, and maybe the one that looks for custom XML.

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB to PDF odd letter spacing Books987 Conversion 5 01-27-2015 05:21 AM
Aura epub, kepub, hyphenation and word-spacing pblasi Kobo Reader 5 08-22-2014 05:13 AM
letter spacing errors JeremyBenson Kindle Formats 24 02-20-2013 07:04 PM
Nook disregarding word-spacing in Epub Indigo121 ePub 3 09-04-2012 11:13 AM


All times are GMT -4. The time now is 07:49 PM.


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