View Full Version : Italic or Emphasis


John2011
06-27-2011, 06:33 AM
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

Jellby
06-27-2011, 06:53 AM
<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.

roger64
06-27-2011, 10:57 AM
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?

DaleDe
06-27-2011, 11:51 AM
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

SamL
06-27-2011, 12:47 PM
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.

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.

roger64
06-27-2011, 02:22 PM
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; }

DaleDe
06-27-2011, 02:51 PM
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

Jellby
06-27-2011, 03:04 PM
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).

Faster
06-27-2011, 03:09 PM
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.

Adjust
06-28-2011, 01:40 AM
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

roger64
06-28-2011, 03:27 AM
Sigil and bold-italic



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". :p
Please, click twice to enlarge it.
http://pix.toile-libre.org/upload/thumb/1309245091.png (http://pix.toile-libre.org/?img=1309245091.png)

@Adjust
Thanks, but for these kind of things I look for free software. I should have said it so. Sorry :)

ghostyjack
06-28-2011, 06:32 AM
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.

roger64
06-28-2011, 10:21 AM
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."

http://pix.toile-libre.org/upload/thumb/1309273357.png (http://pix.toile-libre.org/?img=1309273357.png)

Thanks for your help and patience. :thanks:

Zeypxi
06-28-2011, 12:49 PM
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.

roger64
06-28-2011, 03:45 PM
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... :)

Zeypxi
06-28-2011, 04:50 PM
In LiibO when you're done with your document search by attributes (in your case: bold, italic) and apply your style in just one click. You don't need to call each time f11 stylist. You may even record a macro for this task but I think recording a macro is still deactivated in LibO's current stable version.
As for Tidy, it's a long time since it hasn't been updated, I won't comment on the result you get with <strong><em>.

roger64
06-28-2011, 04:59 PM
There are probably many ways to do it. Research by attribute in LibreOffice can be one if it works for you. Macros are a bit cumbersome though.

Once the options are set (I really means once), I forgot to say style-mapping is fully automatic. It works for me.

sjkramer
08-18-2011, 10:51 AM
Here is an thoughtful article (http://blog.mbreo.com/2010/12/emphases-missing-the-point/) on whether <i> is truly deprecated. If we care about retaining nuance in style (meaning that we can have both italic text and emphasized text, and that they don't mean the same thing necessarily), then perhaps we should not be so quick to can the <i>.

HarryT
08-18-2011, 12:14 PM
If you want to reproduce the appearance of a printed book, I see no issue with <i>, since it's the visual appearance you're after, rather than the semantic content. I agree that <em> makes more sense when it's the meaning that you want to emphasise (no pun intended).