View Single Post
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: 97
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