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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-08-2024, 01:47 PM   #1
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Ctrl-click for style not working

I have an epub with the CSS file directly in the OEBPS folder along with the xhtml files rather than in a separate Style folder.

Ctrl-click to open the first matching CSS style is not working - I get "no style rules that match the class xyz were found". The CSS file is linked correctly and everything else works properly (other than Live CSS).

Is this is a bug?

Fixing it in this ebook so that ctrl-click works would seem to require creating a Styles folder, moving the CSS file there and search/replace on all the links in the xhtml files. Or is there another way? Or I could just leave it, since the book can be viewed without issue, just editing is a touch harder.
foosion is offline   Reply With Quote
Old 09-08-2024, 03:07 PM   #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,322
Karma: 6700864
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Sometimes that happens. I've noticed two causes...

1. You have declearations at the top of the css file. Something like the following. For some reason, this interferes with the ctrl-click link which is a know issue in Calibre.
@charset "utf-8";
@namespace h "http://www.w3.org/1999/xhtml";

2. If you run the CheckBook and EpubCheck functions, there will be errors. One of those errors is breaking the ctrl-click link. Once the errors are fixed, it will work again.
Karellen is offline   Reply With Quote
Advert
Old 09-08-2024, 03:25 PM   #3
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by Karellen View Post
Sometimes that happens. I've noticed two causes...

1. You have declearations at the top of the css file. Something like the following. For some reason, this interferes with the ctrl-click link which is a know issue in Calibre.
@charset "utf-8";
@namespace h "http://www.w3.org/1999/xhtml";

2. If you run the CheckBook and EpubCheck functions, there will be errors. One of those errors is breaking the ctrl-click link. Once the errors are fixed, it will work again.
1. The @ character does not appear in the CSS file. The CSS file looks normal to me, but I'm not highly experienced.

2. CheckBook says no problems found. I don't have EpubCheck installed, as it requires Java which I don't want to install.

It sounds like my guess about the CSS file not being in a Styles folder is incorrect.

Last edited by foosion; 09-08-2024 at 03:28 PM.
foosion is offline   Reply With Quote
Old 09-08-2024, 04:14 PM   #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,322
Karma: 6700864
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by foosion View Post
Fixing it in this ebook so that ctrl-click works would seem to require creating a Styles folder, moving the CSS file there and search/replace on all the links in the xhtml files. Or is there another way?
The easiest way is to run "Arrange into folders" in the Tools menu.

Why are you hesitant installing Java?
Karellen is offline   Reply With Quote
Old 09-08-2024, 04:25 PM   #5
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by Karellen View Post
The easiest way is to run "Arrange into folders" in the Tools menu.

Why are you hesitant installing Java?
Alas, using that to put the CSS file into a folder didn't help with ctrl-click.

FWIW, the CSS is Oxford University Press CSS version 1.2.

Java: I have a possibly irrational aversion to cluttering my computer with such files I rarely if ever use. Plus I'm not a fan of a language which forces you to put everything in a class.
foosion is offline   Reply With Quote
Advert
Old 09-08-2024, 06:38 PM   #6
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
I just edited another CSS file. It had @namespace epub "http://www.idpf.org/2007/ops"; at the top, but behaved normally.
foosion is offline   Reply With Quote
Old 09-08-2024, 10:29 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 39,652
Karma: 154147704
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Personally, I was more that happy to install Java to be able to run epubcheck in Sigil and in the calibre ebook-editor. I also check the CSS since it is kind of sad how often the CSS contains errors.
DNSB is offline   Reply With Quote
Old 09-09-2024, 12:29 AM   #8
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: 44,377
Karma: 23764838
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Impossible to say without access to the book in question.
kovidgoyal is online now   Reply With Quote
Old 09-09-2024, 05:55 AM   #9
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by kovidgoyal View Post
Impossible to say without access to the book in question.
Scrambled file attached.
Attached Files
File Type: epub scrambled.epub (528.2 KB, 19 views)
foosion is offline   Reply With Quote
Old 09-09-2024, 06:06 AM   #10
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,322
Karma: 6700864
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
The error is in your <head> tag...

<link href="OUP_Styles.css" rel="styleSheet" type="text/css"/>

"styleSheet" should be lowercase - "stylesheet"

Relink the pages to the stylesheet and it should be fixed.

Also, your <span class="chaptertitle">. There is no class for "chaptertitle" in the stylesheet.
Karellen is offline   Reply With Quote
Old 09-09-2024, 06:39 AM   #11
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
Quote:
Originally Posted by Karellen View Post
The error is in your <head> tag...

<link href="OUP_Styles.css" rel="styleSheet" type="text/css"/>

"styleSheet" should be lowercase - "stylesheet"

Relink the pages to the stylesheet and it should be fixed.

Also, your <span class="chaptertitle">. There is no class for "chaptertitle" in the stylesheet.
That worked.

I'm surprised the CSS affected the text give the error in the link. Or, if viewers are forgiving, that the editor is not similarly forgiving (or noted the error).

foosion is offline   Reply With Quote
Old 09-09-2024, 07:50 AM   #12
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: 75,964
Karma: 134368292
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 foosion View Post
1. The @ character does not appear in the CSS file. The CSS file looks normal to me, but I'm not highly experienced.

2. CheckBook says no problems found. I don't have EpubCheck installed, as it requires Java which I don't want to install.

It sounds like my guess about the CSS file not being in a Styles folder is incorrect.
You do need to install epubcheck and Javascript because calibre's error checker ignores some errors that epubcheck will catch. Either you install or you may have errors.
JSWolf is online now   Reply With Quote
Old 09-09-2024, 07:51 AM   #13
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: 75,964
Karma: 134368292
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 foosion View Post
Alas, using that to put the CSS file into a folder didn't help with ctrl-click.

FWIW, the CSS is Oxford University Press CSS version 1.2.

Java: I have a possibly irrational aversion to cluttering my computer with such files I rarely if ever use. Plus I'm not a fan of a language which forces you to put everything in a class.
But you won't be rarely using Javascript because you'll be using it with epubcheck.
JSWolf is online now   Reply With Quote
Old 09-09-2024, 07:52 AM   #14
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: 75,964
Karma: 134368292
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 Karellen View Post
The error is in your <head> tag...

<link href="OUP_Styles.css" rel="styleSheet" type="text/css"/>

"styleSheet" should be lowercase - "stylesheet"

Relink the pages to the stylesheet and it should be fixed.

Also, your <span class="chaptertitle">. There is no class for "chaptertitle" in the stylesheet.
I always do a fresh link to the CSS as a lot of the time, the cover and titlepage HTML are not linked. So it's just easier to do it and not have to look.
JSWolf is online now   Reply With Quote
Old 09-09-2024, 08:23 AM   #15
foosion
Addict
foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.foosion is an enigma wrapped up in a mystery.
 
Posts: 381
Karma: 41524
Join Date: Sep 2011
Device: Kobo Libra 2 & Clara BW
There's a script reference in the navigation.xhtml file:
Code:
<script xmlns="http://www.w3.org/1999/xhtml" type="text/javascript"></script>
Why would that be there?
foosion 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
Bug: CSS Ctrl+Click Not Matching Foozle Editor 10 07-21-2023 07:59 AM
[Feature request] - Ctrl+Click on classes thiago.eec Editor 20 05-20-2021 07:41 AM
new feature 5.11 ctrl-click class behavior rjwse@aol.com Editor 1 02-13-2021 11:58 AM
Ctrl-R not working? mbovenka Calibre 70 10-20-2020 08:34 AM
Calibre 0.7.22 Ctrl D not working as well as 0.7.21 logs Calibre 2 10-08-2010 01:33 PM


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


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