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 05-16-2024, 12:57 AM   #1
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
DOCX > EPUB Conversion - Change list indent

When I convert my Word (DOCX) documents into EPUBs, the lists (numbered or bullet) have an excessive indent (36 pt). See example below:
Click image for larger version

Name:	List indent A.jpg
Views:	169
Size:	56.5 KB
ID:	208306

I know how to manually edit the stylesheet.css in Calibre, to modify this indent.

But I wonder if there's a way to permanently set the lists' indent the way I want it (e.g. 6 pt).
- I checked the "Look and Feel" prefs in the Convert window, but it doesn't seem to have such option.
- Is there maybe a config or ini file in the Calibre software (either on Mac or Windows), that I can edit to set this indent?
Crescendo63 is offline   Reply With Quote
Old 05-16-2024, 01:03 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The indent comes from the input document, so change it in your word document. See th esample word file at https://manual.calibre-ebook.com/conversion.html for an example.
kovidgoyal is offline   Reply With Quote
Advert
Old 05-16-2024, 04:51 AM   #3
Quoth
the rook, bossing Never.
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: 12,368
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
I create my own paragraph styles in MS Word or LO Writer rather than using built-in list styles.
Quoth is offline   Reply With Quote
Old 05-16-2024, 06:08 PM   #4
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
Quote:
Originally Posted by Quoth View Post
I create my own paragraph styles in MS Word or LO Writer rather than using built-in list styles.
Yup, I always do the same as well.
My job is actually graphic design, so I format my styles exactly the way I want them.
Crescendo63 is offline   Reply With Quote
Old 05-16-2024, 06:52 PM   #5
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
The indent comes from the input document, so change it in your word document.
I'm sorry, but it doesn't seem to work in my case.

The input (Word) document has an indent of 0,4 cm for the List style.
The indent in the resulting EPUB is about 36 points (1,27 cm).

I even tried editing the style (in Word) and removing the "Style based on: Normal" setting (putting it as "No style" instead); just in case the "Normal" style had anything to do with it. Same result.

As I said in my reply above, all the styles in my Words docs are manually crafted by me, exactly the way I want them (it's part of my job, BTW ).

Looks like somewhere my indent setting is ignored and a "default" setting of 36 points is used instead - for Lists at least.
This has happened since I began doing these conversions (in 2015), and still happens both in Calibre 3.48 (Mac) and Calibre 7.10 (Windows).

Checking the stylesheet.css in Calibre (Edit book), I see several ".block_# {" items with "margin-left" values going from "29.4 pt" to 34.1 or 40.7 (depending on the file I'm working on). If I manually set them all to "6 pt", the lists in my EPUB become the way I want.
There are no such big margins in my Word docs (at least in the styles I'm using), so one wonders where those margins come from. That's why I thought Calibre uses some "default" margin or indent. Maybe they're coming from my Word docs, but from which setting? (surely not from my styles).
Crescendo63 is offline   Reply With Quote
Advert
Old 05-16-2024, 08:32 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: 21,005
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@Crescendo63 - I suggest you create a simple DOCX that attaches the template that has the Styles you want to use for lists and post it here or at https://bugs.launchpad.net/calibre so that Kovid can take a look at it.

FWIW - for highly structured documents, such as yours appears to be, I sometimes use the Mammoth DOCX->EPUB converter which requires creating a reusable mapping of the DOCX Styles to an EPUB stylesheet. I use it via a Sigil plugin (wrapper) called DOCX Input.

BR
BetterRed is offline   Reply With Quote
Old 05-16-2024, 11:53 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,559
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://www.mobileread.com/forums/sh...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 05-17-2024, 06:27 AM   #8
Quoth
the rook, bossing Never.
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: 12,368
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Are you using actual "List" settings in the paragraph style or just indents. I never use "list", simply regular body text and all the desired indents and spacings. I add the list prefix letters/numbers/roman/bullets, if needed, manually as the auto list HTML can fail on some ereaders.

So all my paragraph styles are text, except any that should be in a TOC, they get a heading level. The lists look like lists and I have no indent errors.

Also I use pt for docs to be an epub, but change the editor to use cm when editing a doc to be exported as a PDF. I can save the version for epub with a new name, then overwrite the styles with a template import, add headers, footers, page numbers and change some pages to be front matter, contents, chapter start, end matter, appendix etc.
For the editing for epub conversion I use a small page size with small margins (both of which are ignored by conversion to epub) to have an idea of issues with images, lists, special styles etc.
Quoth is offline   Reply With Quote
Old 05-17-2024, 06:35 AM   #9
Quoth
the rook, bossing Never.
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: 12,368
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by BetterRed View Post
DOCX->EPUB converter which requires creating a reusable mapping of the DOCX Styles to an EPUB stylesheet. I use it via a Sigil plugin (wrapper) called DOCX Input.
I looked at that. But it seemed harder work. The Save As saving of the odt as an extra docx (never ever opened in LO Writer as that converts it!),and calibre conversion to epub2 is visually perfect. I then use the Edit Spans & Divs to change the <p to <h2 just for the class that are TOC headings, because I never use built in Heading1 etc styles and Calibre puts all the heading levels as <p class="some heading style" etc.
I can't use the built in heading levels as I may have different styles of headlng at the same level, and mysteriously sometimes conversion of built-in heading levels gives list HTML.

The other thing I have to do is manually edit the CSS for images, because LO Writer or MS Word image handling is designed only for paper/pdfs. The ebooks don't even work quite the same as webpages.

I stopped using actual MS Word a few years ago. LO 7.x and it's been good enough since version 5.x and I have two panels at the side. One is styles (All applied styles and current highlighted, or change to one double clicked) and the other is Outline/Navigator, which has all headings, links, images, bookmarks, etc and current one selected and allows jump to one double clicked.

My formatting tool bar only has: paragraph style, clear format, remove format, bold, italic, subscript, superscript (as these do little different from a character style when only used for a word or part of paragraph), UPPER CASE, lower case, Language direction. All indents, lists, etc are paragraph body styles.

Last edited by Quoth; 05-17-2024 at 06:43 AM.
Quoth is offline   Reply With Quote
Old 05-20-2024, 09:06 PM   #10
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
Thank you all for the inputs.
I'll check them out as soon as possible, and then I will report the results.
Crescendo63 is offline   Reply With Quote
Old 05-24-2024, 01:03 AM   #11
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
Quote:
Originally Posted by Quoth View Post
Are you using actual "List" settings in the paragraph style or just indents. I never use "list", simply regular body text and all the desired indents and spacings. I add the list prefix letters/numbers/roman/bullets, if needed, manually as the auto list HTML can fail on some ereaders.
Interesting.

I did try to use regular text with indent (no Word's List attribute) and, on conversion, this didn't produce the excessive indent, nor the several added styles in the stylesheet.css.
So my issue might stem from using Word's List attribute (but why does Calibre mismanage that?).

Alas, this way the indent resulted misaligned (see image below).

Click image for larger version

Name:	List indent Prova Ax.jpg
Views:	127
Size:	89.7 KB
ID:	208456

I could fix that editing the stylesheet.css, but I'm looking to avoid manual corrections. I hope to find a solution that works without editing the EPUB.
Crescendo63 is offline   Reply With Quote
Old 05-24-2024, 01:31 AM   #12
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
Thanks Kovid. This might be the best way to solve this indent issue.

Following the instructions you linked, here are the files:
1. The original Word doc: Capire gli altri CUT-XPORT.docx
2. The Calibre log: Calibre job log.txt
3. The resulting EPUB: Capire gli altri CUT-XPORT.epub

The problem: as you can see from the image below, in the EPUB both lists (numbered and dotted) have a much bigger indent than the original Word doc:

Click image for larger version

Name:	List indent CUT-XPORT.jpg
Views:	152
Size:	116.6 KB
ID:	208460

The following are the options I used during the conversion:
- DOCX Input: Do not try to autodetect... = ON
- EPUB Output: Do not split... = ON; No default cover = ON; No SVG cover = ON; Put inserted TOC... = ON

Hope this helps. Let me know if you need anything else for troubleshooting.
Thanks again
Crescendo63 is offline   Reply With Quote
Old 05-24-2024, 05:01 AM   #13
Quoth
the rook, bossing Never.
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: 12,368
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Crescendo63 View Post
I did try to use regular text with indent (no Word's List attribute) and, on conversion, this didn't produce the excessive indent, nor the several added styles in the stylesheet.css.
So my issue might stem from using Word's List attribute (but why does Calibre mismanage that?).

Alas, this way the indent resulted misaligned (see image below).
Just fix the paragraph style. The main indent is the list paragraph wrapping and first line indent is relative to that so for a list will be negative.

I only ever need to edit image CSS, no other CSS ever needs edited.

The MS Word (and LO Writer) more advanced list features don't even work on many ereaders. You can only start from 1, A, etc. Auto list numbering and bullets doesn't even work well on HTML export. It only works 100% on direct print or PDF direct export.
So for years I create a paragraph style using body text and first line indent is negative usually. Numbers / letters / bullets are manually added. It 100% works for epub. Also mobi, azw3 and KFX made from epub by Calibre or Amazon.

Last edited by Quoth; 05-24-2024 at 05:10 AM.
Quoth is offline   Reply With Quote
Old 05-27-2024, 11:16 PM   #14
Crescendo63
Member
Crescendo63 began at the beginning.
 
Crescendo63's Avatar
 
Posts: 22
Karma: 10
Join Date: Oct 2013
Location: Torino, Italy
Device: Kobo Aura
Quote:
Originally Posted by Quoth View Post
Auto list numbering and bullets doesn't even work well on HTML export. It only works 100% on direct print or PDF direct export.
Ah, I didn't know that. Although numbered and bulleted lists are part of HTML code, so I thought a converter would just translate the Word attribute with the corresponding HTML code.

Anyway, I experimented with "non-List" indented paragraph, the way you use them, and I found a set of parameters that work ok.

I'm still waiting for a reply from Kovid, though, in case he finds a solution on the Calibre side.
I'd like to avoid re-formatting and revising manually all the many lists in my dozen of long docs...
Crescendo63 is offline   Reply With Quote
Old 05-28-2024, 07:06 AM   #15
Quoth
the rook, bossing Never.
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: 12,368
Karma: 92073397
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Quote:
Originally Posted by Crescendo63 View Post
Ah, I didn't know that. Although numbered and bulleted lists are part of HTML code, so I thought a converter would just translate the Word attribute with the corresponding HTML code.
But ebooks are a subset of the HTML and CSS that works on a web site. Certainly even when auto numbered lists do work, they can only start at 1, i, I, a A etc. In Word/LO you might have an aside / comment or whatever in a paragraph after the third list item and start the the next list at 4, iv, IV, d, D etc, and that works on PDF and maybe some web browsers. It won't work on most ereaders.

It's only a typing convenience like typing ' or " and getting ‘and’ or “and”, but even that goes wrong with '90s (gives ‘90s and it’s ’90s) feet, inches, minutes, seconds give 4’ 6” instead of 4′ 6″ (subtle use prime and double prime, not closing quotes). Now that I'm used to not have auto-list (for nearly 10 years), I don't miss it. I edited my keyboard on Windows so that alt-gr did more than áéíóú etc, but now I use Linux and alt-gr v b V B gives “ ” ‘ ’ for when auto "smart quotes" fail. Also Caps-Lock is now compose and I added Greek, prime, double prime and minus to it.

The only thing I'd like extra is custom paragraph style names with levels (i.e. not body text) recognised as I never use Heading1, Heading2 etc, but I added h1, h2, h3 to the "Edit Spans & Divs" tool and simply use it to swap any <p id= and matching </p> to h2 or whatever with original properties. Calibre ignores the heading level and puts all customed named headings as <p, i.e. body.

I'd like LO and Word to have more CSS orientated image properties, but I'm not using many images so I check the CSS. Most are changed to auto for height and a percent for width.
Quoth is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In Docx to ePub Conversion window, wanna add Kobo Forma in the "Output Profile" list droopy Conversion 3 04-08-2020 06:37 PM
Convert EPUB to DOCX [Change Default Margins] Lassox Conversion 3 04-12-2017 11:03 PM
Epub to Docx conversion? Hattie Conversion 14 09-13-2014 05:12 AM
Paragraph spaces in ePub to Mobi conversion disrupts indent formatting markpearl Conversion 34 09-21-2011 03:42 PM
HTML to EPUB: list indent disappears dmapr Calibre 8 04-30-2010 07:31 PM


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


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