|
|
#1 |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Calibre conversion is not using my command
Hey everybody,
I am trying to change the css of an epub with Calibre conversion, but it's not working at all. All I want to do is to change it from this: </span></span></p><p class="calibre_"> to that: </span></span></p><p class="calibre_"><br/> So I just want to add <br/> at the end. It is not working through search and replace and also not in the Look & feel tab. How is it possible to change it without going to edit the ebook and use the search and replace option there? Thank you. |
|
|
|
|
|
#2 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,655
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Code:
</span></span></p><p class="calibre_"> Code:
</span></span></p> <p class="calibre_"> Code:
</span></span></p>\s+<p class="calibre_">
|
|
|
|
|
|
|
#3 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,708
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#4 | |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
Code:
</span></span></p><p class="calibre_"> Is there something I can do about it? |
|
|
|
|
|
|
#5 |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Thanks for your reply.
A code might look like this: <body class="calibre"> <h2 id="calibre_toc_9" class="calibre3">Chapter One</h2> <p class="calibre1">Mike Jorgova watched or like that: [...]height:1em"></p><p class="calibre1"> The problem often is that the first word is indented. If I change from the above code the following part to this: </h2> <p class="calibre1"><br/> or that: height:1em"></p><p class="calibre1"><br/> Then the first word after a chapter is not indented, which is what I would like to accomplish. I just need to go inside the editing tab every time. I don't know why it is not working through the search and replace of a conversion. |
|
|
|
|
|
#6 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,808
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Yea, I think you are going about this all wrong.
If all you are trying to do is remove the indent, then simply adjust the CSS Assuming class="calibre1" is used for all first paragraphs in a chapter, then simply add text-indent: 0; to the calibre1 css code. |
|
|
|
|
|
#7 | |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
I have come across some codes which are often repeated through many ebooks. And they go like this: height:1em">*</p><p class="calibre_"> or </span></p><p class="calibre_1"> or </span></span></p><p class="calibre_1"> Sometimes it is not calibre_1, but calibre3 or calibre_4 etc. So my thinking was to put every possible combination from _ to 9 inside the search and replace rule and let calibre do the conversion. But calibre won't even work if I just look up the right code, put it inside search and replace. It's just the same after the conversion. So I have to add my code manually to every ebook by editing it. And I am just talking about the bad conversions. I wouldn't do that with good ebooks of course. Just trying to save the old ones without too much of a hassle. |
|
|
|
|
|
|
#8 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,808
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
ok, if it were me, I would change the class of that first paragraph to something unique. (actually if it were me, I would recode the entire book)
Search for... </h2> <p class="calibre1"> Replace with... </h2> <p class="calibre724"> In your CSS, copy the calibre1 code and create a new calibre724 code. In that new calibre724 css code, add the text-indent: 0 code. |
|
|
|
|
|
#9 | |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
|
|
|
|
|
|
|
#10 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,708
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
CSS Code:
h2 + p {
text-indent: 0;
}
p {
margin-top: 0;
margin-bottom: 0;
widows: 1;
orphans: 1;
text-indent: 1.2em;
}
Then do a search/replace. Search for Code:
</h2> <p class="calibre1"> Code:
</h2> <p> |
|
|
|
|
|
|
#11 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,808
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
|
|
|
|
|
#12 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,655
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Mostly I and others just detest sloppy coding.
Jon's method is clean. That should be inserted into the CSS someplace AFTER .calibre1 {...} (or whatever the wrong class for the first Paragraph ) A P following a H2 gets no indent. Make a snippet and simply pate it in the proper place. Wam ,Bam done |
|
|
|
|
|
#13 | |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
Take this code for instance. I have copied it right out of an ebook which was not converted by me before: Code:
</head>
<body class="calibre">
<div class="s2">
<p class="calibre2"><span class="none4">The Monster</span></p>
</div>
<div class="s4">
<p class="calibre2"> </p>
<p class="calibre2"> </p>
</div>
<div class="s">
<p class="calibre2"><span class="none">
So you have to edit every ebook to get rid of the first word indents. Actually this is something which the device should handle, no matter how the epub was converted. An option just like: no indent for first word after chapter or space line? => Hell yeah... Last edited by ryder; 03-30-2026 at 04:23 PM. |
|
|
|
|
|
|
#14 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,808
Karma: 9501034
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Calibre is an editor's tool. You are the editor. There are a number of incorporated tools to make your editing journey easier. But it is not a magic "press-a-button-to-fix-all" tool. You need to spend a bit more time understanding the structure and coding of epubs so you can quickly and easily fix those things you choose to fix. |
|
|
|
|
|
|
#15 | |
|
Enthusiast
![]() Posts: 44
Karma: 10
Join Date: May 2024
Device: Clara 2E
|
Quote:
|
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calibre conversion is not using my command | ryder | ePub | 1 | 03-29-2026 01:58 PM |
| Command line after conversion | Tominator | Conversion | 7 | 07-18-2019 11:34 PM |
| Get Conversion Settings Command | BetterRed | Conversion | 0 | 11-02-2012 11:44 PM |
| Command Line Conversion | loo23 | Conversion | 3 | 04-07-2012 03:33 PM |
| Calibre Command Line Conversion | bmwr1200c | Calibre | 1 | 08-10-2011 07:04 PM |