Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-27-2020, 09:04 AM   #1
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Question How do I change italic <i> shortcut to use <em> instead?

Hi,

I've tried searching this sub-forum but I can't seem to find an answer. I'm using Sigil 1.2.0 and I want to modify the Ctrl + I shortcut to use <em>TEXT</em> instead of <i>TEXT</i> as <i> is not accepted by either Google Play Publish or Itunesconnect for ePub 3 submissions.

Can anyone recommend how I make this change? Do I need to edit a specific file as the Edit > Preferences > Keyboard Shortcuts don't allow me to alter the HTML used by the shortcut.

Many thanks!
TheTechAuthor is offline   Reply With Quote
Old 04-27-2020, 09:25 AM   #2
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: 79,142
Karma: 144284184
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 TheTechAuthor View Post
Hi,

I've tried searching this sub-forum but I can't seem to find an answer. I'm using Sigil 1.2.0 and I want to modify the Ctrl + I shortcut to use <em>TEXT</em> instead of <i>TEXT</i> as <i> is not accepted by either Google Play Publish or Itunesconnect for ePub 3 submissions.

Can anyone recommend how I make this change? Do I need to edit a specific file as the Edit > Preferences > Keyboard Shortcuts don't allow me to alter the HTML used by the shortcut.

Many thanks!
You can use the TagMechanic plugin to do this.

https://www.mobileread.com/forums/sh...d.php?t=270639
JSWolf is offline   Reply With Quote
Advert
Old 04-27-2020, 09:39 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,312
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I don't think there is an option for that... but, you can either use the plugin JSWolf mentioned, or a simple regex to change them all. I saved the regex as a Saved Search group and it changes several things with a single run like (<i> to <em>, <b> to <strong>, etc)

search: <i>(.*?)</i>
replace: <em>\1</em>

Cheers,
Turtle91 is offline   Reply With Quote
Old 04-27-2020, 09:39 AM   #4
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Quote:
Originally Posted by JSWolf View Post
You can use the TagMechanic plugin to do this.

https://www.mobileread.com/forums/sh...d.php?t=270639
Hi, thanks for the swift reply and the link. I've installed the plug-in and given it a try, However, it only seems to allow you to modify existing href tags after the fact (and not rebind them in advance).

Am I using it wrong? Or is that functionality simply not possible in that plug-in?

Thanks.
TheTechAuthor is offline   Reply With Quote
Old 04-27-2020, 09:43 AM   #5
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Quote:
Originally Posted by Turtle91 View Post
I don't think there is an option for that... but, you can either use the plugin JSWolf mentioned, or a simple regex to change them all. I saved the regex as a Saved Search group and it changes several things with a single run like (<i> to <em>, <b> to <strong>, etc)

search: <i>(.*?)</i>
replace: <em>\1</em>

Cheers,
Hi,

This sounds like I'd need to accept the fact that <i> is what to run with for speed, and then remember to add a post-processing task at the end to convert them all to <em> afterwards.

Although, bizarrely, <b> is still accepted as valid, but <i> isn't. If you don't mind me asking, how do you go about creating the regex and running it at the end stage of the Sigil production workflow?

Thanks.
TheTechAuthor is offline   Reply With Quote
Advert
Old 04-27-2020, 09:55 AM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,312
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
You can use the Saved Searches feature (Tools/Saved Searches... or Ctrl-Alt-F) to create a Group of searches.

Then when you want to run one, just highlight the title of the group - or even an individual search within the group to run that particular portion. The link above has all the details...its to the Sigil User Guide and has a section on Saved Searches.

Attached is one of the groups of regex's I use:
Attached Thumbnails
Click image for larger version

Name:	Annotation 2020-04-27 095229.png
Views:	183
Size:	81.1 KB
ID:	178754  
Turtle91 is offline   Reply With Quote
Old 04-27-2020, 10:33 AM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
An "i" tag is valid html5 and therefore valid for epub3. It even has a slightly different semantic than the "em" tag. A forign word, a ship name, etc vs just "emphasis". How on earth can Google Play Publish make such a rule. It is not part of the epub3 spec. Itunes ibooks does allow the use of both the "i" tag and the "em" tag. Sounds like the "thought police" are back in action and this time are reading your mind to determine that the "i" tag is somehow inappropriate.

I would file a bug report with Google Play publish and tell them they are neither the owner of the epub3 spec nor can they read minds to determine how the author meant to use "i" vs "em".

So silly.
KevinH is offline   Reply With Quote
Old 04-27-2020, 10:45 AM   #8
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Quote:
Originally Posted by KevinH View Post
An "i" tag is valid html5 and therefore valid for epub3. It even has a slightly different semantic than the "em" tag. A forign word, a ship name, etc vs just "emphasis". How on earth can Google Play Publish make such a rule. It is not part of the epub3 spec. Itunes ibooks does allow the use of both the "i" tag and the "em" tag. Sounds like the "thought police" are back in action and this time are reading your mind to determine that the "i" tag is somehow inappropriate.

I would file a bug report with Google Play publish and tell them they are neither the owner of the epub3 spec nor can they read minds to determine how the author meant to use "i" vs "em".

So silly.
Indeed it is silly. Sadly, it just kept spitting up errors (along with Itunesconnect) when I used the <i> tag. I'm not convinced that such a request would be high in their current list of priorities though. Same with Apple.

Apple's own documentation points to this web page: https://www.w3.org/TR/html401/struct/text.html and it was from here I got the idea for using <em> instead (and that just works).
TheTechAuthor is offline   Reply With Quote
Old 04-27-2020, 11:58 AM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by TheTechAuthor View Post
I've tried searching this sub-forum but I can't seem to find an answer. I'm using Sigil 1.2.0 and I want to modify the Ctrl + I shortcut to use <em>TEXT</em> instead of <i>TEXT</i> as <i> is not accepted by either Google Play Publish or Itunesconnect for ePub 3 submissions.
Try the following:

1. Right-click the toolbar and check Clip Bar, if it isn't already checked.
2. Select Tools > Clip Editor.
3. Highlight the topmost entry and click Add Entry.
4. Enter <em> in the Name field and <em>\1</em> in the Text field.
5. Click the up arrow button to move the new clip to the top.
6. Click Save.

You should see an <em> button in the Clip Bar that allows you to wrap text in <em>...</em>.
Doitsu is offline   Reply With Quote
Old 04-27-2020, 03:04 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,478
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by TheTechAuthor View Post
Apple's own documentation points to this web page: https://www.w3.org/TR/html401/struct/text.html and it was from here I got the idea for using <em> instead (and that just works).
That is actually a very very old html 4.01 spec that is not part of epub3 which actually calls for the xhtml serialization of html5 not 4.

You should be using an html5 based validator and not that old spec. It actually violates the epub3 spec in more than a few places.
KevinH is offline   Reply With Quote
Old 04-27-2020, 03:10 PM   #11
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Quote:
Originally Posted by Doitsu View Post
Try the following:

1. Right-click the toolbar and check Clip Bar, if it isn't already checked.
2. Select Tools > Clip Editor.
3. Highlight the topmost entry and click Add Entry.
4. Enter <em> in the Name field and <em>\1</em> in the Text field.
5. Click the up arrow button to move the new clip to the top.
6. Click Save.

You should see an <em> button in the Clip Bar that allows you to wrap text in <em>...</em>.


I'd never used clips before in Sigil, so that's my TIL for today. I'm just having a poke around now so I can edit the clip keyboard shortcuts for the new <em> clip. CTRL + ALT + 2 doesn't seem to do anything.

But at least I can now just click on it from the 'Clips' menu on the left-hand side.
TheTechAuthor is offline   Reply With Quote
Old 04-27-2020, 03:12 PM   #12
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Quote:
Originally Posted by KevinH View Post
That is actually a very very old html 4.01 spec that is not part of epub3 which actually calls for the xhtml serialization of html5 not 4.

You should be using an html5 based validator and not that old spec. It actually violates the epub3 spec in more than a few places.
I only used it for the italics/emphasis issue. Otherwise, I've got by using plain-old regular html and CSS tags/classes.

Hopefully Apple will one day update their documentation links to something more beneficial.
TheTechAuthor is offline   Reply With Quote
Old 04-27-2020, 04:06 PM   #13
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,518
Karma: 987654
Join Date: Dec 2012
Device: Kindle
I don't know about "Google Play publish", but all my ebooks are available on Google Play, and all of them use <i> tags for italics. They are epub2.
Notjohn is offline   Reply With Quote
Old 04-27-2020, 08:21 PM   #14
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by TheTechAuthor View Post
Although, bizarrely, <b> is still accepted as valid, but <i> isn't.
Like KevinH said, <i> is valid HTML5.

If you want more detailed discussion, see the 2017 thread "Extended <head> chapter: NOT necessary?" (especially my post #43 plus surrounding posts discussing differences between <i> vs. <em>).

Last edited by Tex2002ans; 04-27-2020 at 08:27 PM.
Tex2002ans is offline   Reply With Quote
Old 04-28-2020, 03:03 AM   #15
TheTechAuthor
Member
TheTechAuthor began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2020
Device: None
Quote:
Originally Posted by Tex2002ans View Post
Like KevinH said, <i> is valid HTML5.

If you want more detailed discussion, see the 2017 thread "Extended <head> chapter: NOT necessary?" (especially my post #43 plus surrounding posts discussing differences between <i> vs. <em>).
That was an interesting read. Thank you.

However, my main concern is getting a workflow that "just works" across KDP, Google Play Books, and iTunesConnect. Right now, from a speed perspective at least, <em> for emphasising words and <b> for bolding words is the quickest - for me.

I need to work within the currently accepted rules of whatever digital eBook store I want to sell on. And, as it currently stands, as valid as <I> is, it's not accepted in ePub 3 by every eBook retailer. Sadly.
TheTechAuthor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change italic font to regular? butterbeer Editor 2 12-24-2019 07:03 PM
Shortcut to change the frontlight level ploum KOReader 1 10-23-2017 08:50 AM
Best way to do italic and bold bookman156 ePub 166 04-09-2016 03:43 PM
Italic or Emphasis John2011 ePub 18 08-18-2011 12:14 PM
Making Shortcut to Quickly Change Save Preferences Marcy Calibre 0 06-07-2010 01:51 AM


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


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