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 Today, 03:23 AM   #1
ryder
Enthusiast
ryder began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2024
Device: Clara 2E
Calibre not using my indent command

Hello everybody,

I use this css styling for my epub conversions:

p {
p:first-of-type {
text-indent: 0 !important;
}
p {
margin: 0 !important;
padding: 0;
widows: 1;
orphans: 1;
text-indent: 1em !important;
}

Unfortunately calibre indents with more than 1em for the other paragraphs except the first one. How can I combine the two p commands in one, so that the text indent will be 1em?

My goal is that the first indent after chapter or space break is 0 and the normal indent after paragraph should be 1em.

Thank you in advance
ryder is offline   Reply With Quote
Old Today, 03:29 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,701
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by ryder View Post
p {
p:first-of-type {
text-indent: 0 !important;
}
You have one too many opening curly brackets.
Karellen is offline   Reply With Quote
Old Today, 04:26 AM   #3
ryder
Enthusiast
ryder began at the beginning.
 
Posts: 25
Karma: 10
Join Date: May 2024
Device: Clara 2E
The thing is I have tinkered around with the curly brackets and it either indented after every paragraph with 1em even after chapter or the first one was not indented but every other had like 2.5em.

Is it ok to have two p commands or does just the first one count and the second one will be of no use to calibre?

Also tried this with no luck:

p {
p:first-of-type {
text-indent: 0 !important;}
margin: 0 !important;
padding: 0;
widows: 1;
orphans: 1;
text-indent: 1em !important;
}
ryder is offline   Reply With Quote
Old Today, 05:12 AM   #4
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,701
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
You can't nest CSS rules as far as I am aware. So your double sets of curly brackets won't work.

Sometimes it is easier to just use basic coding, so I wouldn't be trying to combine rules
https://www.w3schools.com/css/css_combinators.asp

I would use two separate rules...

For all your standard paragraphs, use this for your 1em indent
p {
display: block;
margin-top: 0;
margin-bottom: 0;
text-indent: 1em;
}

Then for your first para after scene break, use the following. It will give you spacing above for the scene break. And yes, you will have to modify all the scene break p tags to include the class. <p class="scene">Blah blah.</p>
.scene {
padding-bottom: 0;
padding-top: 2em;
text-indent: 0;
}

If you want to use pseudo elements, they will need to be two separate rules anyway, and not all ereader software will understand it.
https://www.w3schools.com/css/css_pseudo_elements.asp
Karellen is offline   Reply With Quote
Old Today, 05:18 AM   #5
readx
Connoisseur
readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.readx 's ceiling is 100% spider-free.
 
Posts: 96
Karma: 118402
Join Date: Jul 2009
Device: Cybook Gen3
For me the use of p + p would be the easier solution

Code:
p {
text-indent: 0 !important;
}
p + p {
margin: 0 !important;
padding: 0;
widows: 1;
orphans: 1;
text-indent: 1em !important;
}
readx is offline   Reply With Quote
Old Today, 06:29 AM   #6
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: 81,042
Karma: 150250725
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 readx View Post
For me the use of p + p would be the easier solution

Code:
p {
text-indent: 0 !important;
}
p + p {
margin: 0 !important;
padding: 0;
widows: 1;
orphans: 1;
text-indent: 1em !important;
}
You don't need !important. Nothing is going to override your p that you cannot fix.
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line, Adding books also picks up metadata not in command used droodled Library Management 2 11-26-2025 10:30 AM
Is there a way to execute a non-root command without access to command line Galunid Kindle Developer's Corner 4 05-15-2018 08:50 PM
Aldiko & Calibre Indent Woe. Themus Calibre 1 05-19-2012 05:37 PM
Calibre Indent Issue When Removing Blank Lines (Converting From HTML to MOBI or EPUB) David Derrico Calibre 5 08-04-2010 01:13 AM
calibre command line utilities and calibre defaults astrodad Calibre 2 08-07-2008 04:27 PM


All times are GMT -4. The time now is 07:00 AM.


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