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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-27-2011, 06:33 AM   #1
John2011
Enthusiast
John2011 began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Jan 2011
Device: Kobo 1
Italic or Emphasis

Is there any difference between the <i> tag and the <em> tag.

<i>text</i>
and
<em>text</em>

When I use them I can see no difference between the <i></i> text and the <em></em> text. They look the same.

I guess they are interchangeable. Which one is correct?

Peace,
John P
John2011 is offline   Reply With Quote
Advert
Old 06-27-2011, 06:53 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,072
Karma: 9567891
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
<i> is presentational, and would be deprecated if it were not so widely used.
<em> is semantic, and is more in line with the XHTML markup.

At the end of the day, both are equivalent, and anyway, they can be controlled with CSS.
Jellby is offline   Reply With Quote
Old 06-27-2011, 10:57 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,145
Karma: 2150557
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

I can use any of these two tags to map italics style attribute using W2X. Usually, I use <i>. I also heard that <u> (for underline) is deprecated but probably works.

I also map bold style attribute with a <b> tag. And then, something special happen when I try to map a bolditalic style attribute.

I should get something like that: <b><i>bolditalic</i></b>

No way to see this code with two joint tags with Sigil which expels one the two tags but converts correctly the bolditalic. I reported twice the bug upstream to be told that my EPUB was fine and indeed produced the expected result. Only, it seems that I cannot visualize it with Sigil.

Could someone please look at this short epub which use style-mapping for style attributes and check particularly the code output for bolditalic words?

Which free software (out of Sigil) would allow me to read the code?
Attached Files
File Type: epub Lorem Ipsum.epub (74.0 KB, 73 views)

Last edited by roger64; 06-27-2011 at 11:00 AM.
roger64 is offline   Reply With Quote
Old 06-27-2011, 11:51 AM   #4
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 10,730
Karma: 11200000
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2
Quote:
Originally Posted by roger64 View Post
Hi

I can use any of these two tags to map italics style attribute using W2X. Usually, I use <i>. I also heard that <u> (for underline) is deprecated but probably works.

I also map bold style attribute with a <b> tag. And then, something special happen when I try to map a bolditalic style attribute.

I should get something like that: <b><i>bolditalic</i></b>

No way to see this code with two joint tags with Sigil which expels one the two tags but converts correctly the bolditalic. I reported twice the bug upstream to be told that my EPUB was fine and indeed produced the expected result. Only, it seems that I cannot visualize it with Sigil.

Could someone please look at this short epub which use style-mapping for style attributes and check particularly the code output for bolditalic words?

Which free software (out of Sigil) would allow me to read the code?
Sigil has problems in this area and prefers the class and CSS approach which I think is not the best however, <b> is not preferred any longer and should be replaced with <strong> and by rights <i> should be replaced by <em> these days to avoid future problems.

Dale
DaleDe is offline   Reply With Quote
Old 06-27-2011, 12:47 PM   #5
SamL
I mess around with Epubs
SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.SamL once ate a cherry pie in a record 7 seconds.
 
Posts: 82
Karma: 1566
Join Date: Mar 2011
Location: Cambridge, MA
Device: mac, ipad, nook, kindle
I don't know about everyone else, but I haven't had much luck using <i> tags. Instead I make a style in the css for my roman, italics, bold etc.

Quote:
span.roman {
font-weight: normal;
font-style: normal;
}

span.italics {
font-weight: normal;
font-style: italic;
}
span.bold {
font-weight: bold;
font-style: normal;
}
doing it this way, it works on all devices for me.
SamL is offline   Reply With Quote
Advert
Old 06-27-2011, 02:22 PM   #6
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,145
Karma: 2150557
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by DaleDe View Post
Sigil has problems in this area and prefers the class and CSS approach which I think is not the best however, <b> is not preferred any longer and should be replaced with <strong> and by rights <i> should be replaced by <em> these days to avoid future problems.

Dale
No problem with W2X to select <strong> instead of <b> and <em> instead of <i>; as it is just one option to select and validate.

Could you advise me some other software other than Sigil which would allow me to read the code to check it?

@SamL

Yes the use of span.something is convenient too I think. There also could be:
span.underline { text-decoration:underline; }

Last edited by roger64; 06-27-2011 at 02:26 PM.
roger64 is offline   Reply With Quote
Old 06-27-2011, 02:51 PM   #7
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 10,730
Karma: 11200000
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2
Quote:
Originally Posted by roger64 View Post
No problem with W2X to select <strong> instead of <b> and <em> instead of <i>; as it is just one option to select and validate.

Could you advise me some other software other than Sigil which would allow me to read the code to check it?

@SamL

Yes the use of span.something is convenient too I think. There also could be:
span.underline { text-decoration:underline; }
sigils flightcrew will validate this code and for me Sigil editor even let me keep the <strong><em> syntax in the test I just performed using 3.4. I think it was the <b> that gets you in trouble.

Dale
DaleDe is offline   Reply With Quote
Old 06-27-2011, 03:04 PM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,072
Karma: 9567891
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by roger64 View Post
Yes the use of span.something is convenient too I think. There also could be:
span.underline { text-decoration:underline; }
Or you could have:

em.underline { font-style: inherit; text-decoration: underline}

which would help keeping the semantics (assuming you use underline for emphasis, and that there is also italic emphasis in the same document).
Jellby is offline   Reply With Quote
Old 06-27-2011, 03:09 PM   #9
Faster
Connoisseur
Faster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of lightFaster is a glorious beacon of light
 
Posts: 61
Karma: 12096
Join Date: Sep 2010
Location: Tasmania
Device: Sony PRS 650
Quote:
Originally Posted by roger64 View Post
Could you advise me some other software other than Sigil which would allow me to read the code to check it?
Do want a program that checks it, meaning validates it, or just something other than Sigil which lets you view the code and lets you manually check it and if necessary modify it?
If the latter, in Sigil go to Code View, copy everything from '<html ' downwards, paste into notebook Save As myTest.html. Open in your browser and view 'Source'.

BTW, I downloaded your sample and opened it in Sigil. The tagged <b><i>lacinia</i></b> appears correctly in code view and in Book view the word 'lacinia' is in bold-italic.
Faster is offline   Reply With Quote
Old 06-28-2011, 01:40 AM   #10
Adjust
Addict
Adjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel isAdjust really knows where his or her towel is
 
Adjust's Avatar
 
Posts: 351
Karma: 70000
Join Date: Jul 2010
Location: Australia
Device: ADE, iPad
Quote:
Originally Posted by roger64 View Post
Could you advise me some other software other than Sigil which would allow me to read the code to check it?
Adobe, DreamWeaver does this
Adjust is offline   Reply With Quote
Old 06-28-2011, 03:27 AM   #11
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,145
Karma: 2150557
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Sigil and bold-italic

Quote:
Originally Posted by Faster View Post

BTW, I downloaded your sample and opened it in Sigil. The tagged <b><i>lacinia</i></b> appears correctly in code view and in Book view the word 'lacinia' is in bold-italic.
Thanks for confirming my suspicions. This is exactly my problem!!
When I look at the above EPUB with Sigil 0.4 beta Linux, this is how these joint tags got reported (see sreenshot below):

Even if the word lacinia is written correctly in bold-italic in text view , in code view it appears this way: <b class="sgc-2">lacinia</b>

So, it seems clear that Sigil 0.4. beta Linux can't stand, for some reason, joint tags like <b><i>lacinia</i></b>

This is the reason why I reported a W2X bug while in reality, it's a Sigil, say, "peculiarity".
Please, click twice to enlarge it.


@Adjust
Thanks, but for these kind of things I look for free software. I should have said it so. Sorry
roger64 is offline   Reply With Quote
Old 06-28-2011, 06:32 AM   #12
ghostyjack
Guru
ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.ghostyjack ought to be getting tired of karma fortunes by now.
 
ghostyjack's Avatar
 
Posts: 718
Karma: 1085610
Join Date: Mar 2009
Location: Bristol, England
Device: PRS-T1, 1825PT, Galaxy Tab, One X, TF700T, Aura HD, Nexus 7
I don't realy see why they are trying to get rid of <i>. I currently use both.

If I explicitly what something in italics, I use <i>. If I'm going to place some emphasis on some text I use <em>.

For me this seems like a sensible choice as it allows me to then set in the CSS the behaviour of the tags, and with them using two different tags I have better control of my formatting.

I'd rather not have to start using span tags as this just appears to make the code look messy.
ghostyjack is offline   Reply With Quote
Old 06-28-2011, 10:21 AM   #13
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,145
Karma: 2150557
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
To conclude for me, to get consistent results with Sigil 0.4. Beta, I followed DaleDe hint (I think it was the <b> that gets you in trouble.) and selected on a permanent basis the following tags in W2X which now work quite well with Sigil, even for bold-italics:

Bold: <strong>
Italics: <em>
Superscript: <sup>
Overstrike: <del>

I chose not to implement anymore Underline as they say in W3Schools.com "It is not recommended to underline text that is not a link, as this often confuses users."



Thanks for your help and patience.

Last edited by roger64; 06-28-2011 at 11:11 AM. Reason: screenshot
roger64 is offline   Reply With Quote
Old 06-28-2011, 12:49 PM   #14
Zeypxi
Member
Zeypxi began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Apr 2011
Device: none
Well Roger, we both speak French but in this section I'll answer in English of course . By looking at the screenshot I can see that Tidy is activated (little broom icon) and that's why Sigil creates a specific class for bold and italic (sgc-x, x standing for a digit). So, not really a bug, it's just cleaning.

That said, that type of coding seems strange to me but that doesn't mean you shouldn't code this way. I also use style mapping with W2x but contrary to you in Writer I usually create a specific style for bold italic text (both in Character styles and Paragraph styles). If you must report a bug or a feature request, you should ask LibreOffice developers to add a style by default for bold-italic text.
Zeypxi is offline   Reply With Quote
Old 06-28-2011, 03:45 PM   #15
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,145
Karma: 2150557
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

Thank you for giving me the opportunity to comment on style-mapping.

1. In the last screenshot above, you can see that the only sgc remaining tag relates to the formatiing of the floating image. All the other tags of this kind have been cleared.

2. Usefulness of style-mapping

Using styles throughout the text is essential, and a bold-italic style will of course be very useful. It should better be used every time when a sentence, a paragraph or more has to be transcribed this way.

However the style-mapping of style attributes should be used to tag elements of much smaller size than a sentence (words, letters and so on). It should be seen as a way to give more comfort to the author. It could be inconvenient to call the F11 window (Styles and formatting) just for one single word, sometimes even for only some letters. With style-formatting, W2X will pick them up later. There is no particular problem to join two tags to map bold-italic, you just have to pick the good ones.

As I wrote it, I use it for bold, italics, bold-italics, superscript and overstrike.

This way you still can use hard formatting style attributes in OpenOffice but you manage to get rid of all of them later with W2X style-mapping. You get somewhat the best of both worlds...

Last edited by roger64; 06-28-2011 at 03:52 PM.
roger64 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
Markdown Query : Using Emphasis Agama Conversion 10 09-20-2011 03:12 PM
HTML/CSS for (German) s p a c e d o u t emphasis frabjous Workshop 21 05-16-2011 04:52 PM
Emphasis or Italic for Language ghostyjack Workshop 3 11-02-2010 10:46 AM
Calibre loses all forms of Emphasis spa Calibre 8 11-01-2010 06:06 AM
Emphasis Line and Emphasis Dot mcortez Sony Reader 6 01-19-2008 07:19 PM


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


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