Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 10-06-2021, 05:33 AM   #1
FrankJH
Member
FrankJH began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+
Calibre and keyboard shortcuts

Dear all,

I'm relatively new to ebook writing, and I'm trying to find the most useful tool for ebook editing .. so I hope my question is not too "stupid", but I have not found an appropriate answer to this after some google research ...

Currently, I'm trying Sigil and Calibre.

Sigil has a css problem which I posted in another thread.

Calibre appears to be more useful for my purposes, but there's one thing I'm not able to figure out .. maybe I'm blind, I don't know

Calibre has preconfigured shortcuts, e. g. Ctrl+1 to insert <h1> ... </h1> ...

I'm able to customize the shortcut itself in the "Preferences" ...

But I'd like to do this ... e. g. I'd like to change this so that

<span class"red"> ... </span>

will be inserted instead of "h1" ...

I'm using version 3.48.0 (not the newest) on OpenSuse Leap 15.3.

What should I do to customize this? Of course, it has not necessarily to be "Ctrl+1", but how can we define our own shortcuts in Calibre?

Is it not possible, or must I install a plugin to achieve my goal?

Best wishes, and thanks in advance, Frank
FrankJH is offline   Reply With Quote
Old 10-06-2021, 06:01 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,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want to press keys and insert custom text, see https://manual.calibre-ebook.com/snippets.html
kovidgoyal is offline   Reply With Quote
Advert
Old 10-06-2021, 06:12 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by FrankJH View Post
I'm using version 3.48.0 (not the newest) on OpenSuse Leap 15.3.
That release is more than 2 years old. I suspect you will find lots of things that work (or exist) now that didn't then.
chaley is offline   Reply With Quote
Old 10-06-2021, 06:23 AM   #4
FrankJH
Member
FrankJH began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+
Yes, I saw that 3.48.0 is rather old, the current version is 5.28 ...

3.48.0 is part of Leap 15.3 ...

I read about snippets too ... we can insert something like "<a", and pressing "Ctrl+J" is going to expand this to a complete a with href and so on ...

But what I'd like to do: mark text in the editor and press a key like "Ctrl+1", and there's going to appear

<span class"red"> text </span>

>> That release is more than 2 years old.

Maybe the best way is to install a newer version, but we cannot be sure that it will work correctly ... dued to some dependencies, I suppose.

Do you think there is no way of customizing the shortcuts the way I prefer in my version 3.48.0?
FrankJH is offline   Reply With Quote
Old 10-06-2021, 07:40 AM   #5
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
That's just a work-around, but it does what you want and will work in calibre 3.xx
Create a regex-function (search box, pulldown "regex-fucntion" button "create") that does this:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    return '<span class"red">{}</span>'.format(match.group(0))
Then, with this regex-function active in your search box, you can select a text, then hit Ctrl-F Ctrl-R, it will do the job (or, same thing, click Search then Replace).
lomkiri is offline   Reply With Quote
Advert
Old 10-06-2021, 09:53 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,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by FrankJH View Post
But what I'd like to do: mark text in the editor and press a key like "Ctrl+1", and there's going to appear

<span class"red"> text </span>
The snippet will do exactly that.
kovidgoyal is offline   Reply With Quote
Old 10-06-2021, 10:18 AM   #7
FrankJH
Member
FrankJH began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+
Thanks for your answers ...

I followed your advice and updated my Calibre version to 5.28.0 ... it seems to work without problems.

I hope you pardon my stupid questions, but I don't know if I am blind or if I misunderstood ...

How can I reach my goal after installing the newest version?

I'm not able to find anything in the editor preferences which points in this direction ... is there a need to install another pugin?
FrankJH is offline   Reply With Quote
Old 10-06-2021, 11:02 AM   #8
FrankJH
Member
FrankJH began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+
I updated to version 5.28.0 in the meantime, but I'm not able any way to modify the Keyboard shortcuts in the editor preferences again ...

Sorry for my stupid questions, I don't know if I'm blind or so ...

@Kovid: I read the section about the snippets, but as far as I understood, I have to type in a trigger, e.g. "<a" and press Ctrl+J" ... but if I mark my text and type in a trigger, my text will be overwritten .. it should work like the shortcut "Ctrl+B" which changes "text" (which I highlighted or selected before) directly into "<b>text</b>" without typing any trigger at all. But unfortunately I'm unable to figure out how the shortcuts can be customized ...
FrankJH is offline   Reply With Quote
Old 10-06-2021, 11:45 AM   #9
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,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It does work like that, read this bit carefully. https://manual.calibre-ebook.com/sni...trary-html-tag
kovidgoyal is offline   Reply With Quote
Old 10-06-2021, 11:49 AM   #10
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,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Or do the following:

select some text, press ctrl+j, type <a, ress ctrl+j again. You will find the selected text has been surrounded with an <a> tag.
kovidgoyal is offline   Reply With Quote
Old 10-07-2021, 04:40 AM   #11
FrankJH
Member
FrankJH began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+


@Kovid: Last evening I saw the info in Calibre: "5.28 created by Kovid Goyal" ... I suppose that must be you My acknowledgement for your work!

I have used Sigil for my ebooks so far, but yesterday, I saw that Calibre offers much more features, the ebook management is better and more intuitive than Sigil.

Snippets work differently in Sigil, but that's a question of familiarity ... going to practice a little

And thank you very much for your patience with my newbie questions

Kind regards, Frank
FrankJH is offline   Reply With Quote
Old 10-07-2021, 06:08 AM   #12
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,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You're welcome!
kovidgoyal is offline   Reply With Quote
Old 10-07-2021, 11:41 AM   #13
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: 46,191
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by FrankJH View Post
I have used Sigil for my ebooks so far, but yesterday, I saw that Calibre offers much more features, the ebook management is better and more intuitive than Sigil.
Sigil has ebook management?
DNSB is offline   Reply With Quote
Old 10-07-2021, 01:09 PM   #14
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DNSB View Post
Sigil has ebook management?
Open Recent?
theducks is online now   Reply With Quote
Old 10-07-2021, 05:07 PM   #15
FrankJH
Member
FrankJH began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+
Quote:
Originally Posted by theducks View Post
Open Recent?


You're right

I'm not a native English speaker, sorry ... "management" was the incorrect term here ...

Sigil is really good as an editor, of course ...

What I meant: Calibre offers a bunch of facilities which are useful for me. among other things the content server.

I'd like to refresh my knowledge in foreign languages ... I read that it is good for learning if
one creates a self-compiled grammar ... and obviously, all the possibilities of CSS and
EBooks are very useful for this.

"Open Recent" is really good ...

Cheers, Frank
FrankJH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Font option keyboard shortcuts DNSB Calibre 8 05-25-2020 06:33 AM
Calibre keyboard shortcuts? Clytie Calibre 29 08-25-2019 03:51 AM
Certain keyboard shortcuts no longer working in Calibre 2.0 (OS X) holymadness Calibre 18 08-29-2014 01:33 PM
Keyboard shortcuts are disabled when Kind Fire is connected to calibre ElMiko Calibre 5 12-26-2011 06:55 PM
calibre internal reader - more keyboard shortcuts ? cybmole Calibre 1 01-06-2011 08:47 AM


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


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