![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Calibre rules out shifting ordered lists to the right
Hello, I have a problem with the ordered lists in the epub to kepub conversion (also epub to epub).
I want to shift the lists a bit to the right, so that the item numbers are aligned with the text-indent of the normal p (by default, the item text is what is aligned with p's text-indent). I achieve this in epub with: Code:
p { margin:.2em 0; text-align:justify; text-indent:9%; } ul, ol { display: block; margin:1em 0 1em 9%; /* aligns item text with p indent */ padding-left:1em; /* shift to align the item number */ } The problem is that although this looks fine in epub, Calibre discards it when converting to both kepub (which I need) and epub (which I do to test). The result is: Code:
<ol class="calibre3"> <li class="calibre4">... Code:
.calibre3 { display: block; list-style-type: decimal; margin-bottom: 1em; margin-right: 0; margin-top: 1em; } .calibre4 { display: list-item; text-align: justify; } So how could I achieve what I want, i.e. shift the lists a certain amount to the right? Thank you very much in advance. I really appreciate your work. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
turn off the fake margin removal setting in structure detection.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
I already had it turned off (unchecked).
Calibre 6.16, Windows 10. Last edited by repilo; 04-26-2023 at 07:35 AM. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
1. The file you are trying to convert: attached test_list.epub
2. The conversion log from calibre: I can't get it, too fast. There is not any error message. 3. The output file: attached output.epub 4. Description: see the first post. In short: I want to shift the lists a bit to the right, so that the item numbers are aligned with the text-indent of the normal p (by default, the item text is what is aligned with p's text-indent). I write the necessary code to achieve this and it looks fine in epub format, but when Calibre does the conversion from epub to kepub, or even to epub, the shifting to the right disappears. There is no allusion to the left margin anymore. Although my intention is to send the epub to my Kobo, converting it automatically into kepub, the problem also occurs in the epub to epub conversion (the result of which I have attached). |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes, padding and margin on lists cause rendering problems in some renderers so they are deliberately removed when converting to EPUB.
https://github.com/kovidgoyal/calibr...output.py#L514 |
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 96
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
If anyone is interested in this, I've come up with a workaround by enclosing the list in a div with padding-left.
Code:
ul, ol { display: block; margin: 1em 0 1em 0; padding-left: 9%; } div.ol1d { padding-left:1.16em; } /* for 1 digit list */ div.ol2d { padding-left:1.6em; } /* for 2 digits list */ Code:
<div class="ol1d"> <ol> <li>Item number is aligned with text-indent of p.</li> <li>Item.</li> <li>Item.</li> </ol> </div> |
![]() |
![]() |
![]() |
#8 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,771
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
Tags |
ordered list |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using ordered lists | lwalper | Workshop | 7 | 07-31-2014 01:33 PM |
ADE not reading my validated epub Ordered Lists | Dia435 | ePub | 2 | 10-13-2012 03:21 PM |
Nested Ordered Lists | andyd273 | Conversion | 9 | 11-17-2011 12:05 PM |
Ordered lists on the NOOK Color and Kindle | sgirsberger | ePub | 8 | 09-15-2011 08:31 AM |
Ordered lists and ADE | dynabook | Sigil | 3 | 01-27-2011 04:53 AM |