Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2023, 06:15 AM   #1
repilo
Connoisseur
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
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 */
}
where with padding-left:1em I get the additional offset I need for 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">...
Where:
Code:
.calibre3 {
  display: block;
  list-style-type: decimal;
  margin-bottom: 1em;
  margin-right: 0;
  margin-top: 1em;
}
.calibre4 {
  display: list-item;
  text-align: justify;
}
There is no allusion to the left margin anymore.
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.
repilo is offline   Reply With Quote
Old 04-26-2023, 06:41 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: 45,364
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
turn off the fake margin removal setting in structure detection.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-26-2023, 07:32 AM   #3
repilo
Connoisseur
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
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.
repilo is offline   Reply With Quote
Old 04-26-2023, 07:35 AM   #4
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: 45,364
Karma: 27230406
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 04-26-2023, 09:17 AM   #5
repilo
Connoisseur
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
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).
Attached Files
File Type: epub test_list.epub (3.2 KB, 84 views)
File Type: epub output.epub (210.9 KB, 78 views)
repilo is offline   Reply With Quote
Advert
Old 04-26-2023, 10:37 AM   #6
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: 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
kovidgoyal is offline   Reply With Quote
Old 04-26-2023, 04:19 PM   #7
repilo
Connoisseur
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
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>
repilo is offline   Reply With Quote
Old 04-26-2023, 05:42 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: 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:
Originally Posted by kovidgoyal View Post
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
Can they be no longer deleted or made an option with off as the default?
JSWolf is offline   Reply With Quote
Reply

Tags
ordered list

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 06:10 PM.


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