![]() |
#1 |
Member
![]() 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 |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#4 |
Member
![]() 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? |
![]() |
![]() |
![]() |
#5 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)) |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#7 |
Member
![]() 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? |
![]() |
![]() |
![]() |
#8 |
Member
![]() 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 ... |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#11 |
Member
![]() 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 ![]() 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 |
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,349
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You're welcome!
|
![]() |
![]() |
![]() |
#13 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,191
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
![]() |
![]() |
![]() |
#14 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
![]() |
![]() |
#15 |
Member
![]() Posts: 22
Karma: 10
Join Date: Oct 2021
Location: Stuttgart, Germany
Device: Galaxy Tab S7+
|
![]() ![]() 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 |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |