Two questions about formatting

J

John Salerno

Hi everyone. I have a couple of (probably simple) questions about how to
format some text in a paragraph.

First up is the easier one to explain: If I have scientific words that I
want italicized, is that best done with <em> or a <span>? (My guess is
span).

Second thing: If I have several lines of text to put into a <p> and I
want to keep the text within a certain number of columns in my text
editor (instead of having the whole paragraph taking up one really
really long line), is it a good idea to manually press ENTER where I
want the text to stop, or does that somehow affect the formatting? One
thing it does affect, I can say, is when you need to go back and change
the text, then you can see where you pressed ENTER. Should I just do a
wordwrap instead?

Thanks!
John
 
J

John Salerno

John said:
Should I just do a
wordwrap instead?

Or maybe not. What happens when I wordwrap is that all lines after the
first go all the way to the left, and I want them to be lined up with
the first line.
 
B

Beauregard T. Shagnasty

John said:
Hi everyone. I have a couple of (probably simple) questions about how
to format some text in a paragraph.

First up is the easier one to explain: If I have scientific words
that I want italicized, is that best done with <em> or a <span>? (My
guess is span).

Depends. <em> is emphasized, not italic, though most browsers will show
it that way. Do you want to "emphasize" the words, or being scientific,
do you want some other type of .. emphasis? If so, then customize a
<span> for them.

<p>The following is a <span class="scientific">special</span> word.</p>

..scientific {
font-style: italic; font-weight: bold;
color: red; background-color: transparent;
}
or whatever trips your trigger.
Second thing: If I have several lines of text to put into a <p> and I
want to keep the text within a certain number of columns in my text
editor (instead of having the whole paragraph taking up one really
really long line), is it a good idea to manually press ENTER where I
want the text to stop, or does that somehow affect the formatting?
One thing it does affect, I can say, is when you need to go back and
change the text, then you can see where you pressed ENTER. Should I
just do a wordwrap instead?

The text in a paragraph element will wrap to fit the available space
when your page is displayed by the browser. You seem to be talking about
how it appears in your source editor. That's your choice. I usually type
about 80 characters and press return so my source is easily readable.
 
J

John Salerno

Beauregard said:
Depends. <em> is emphasized, not italic, though most browsers will show
it that way. Do you want to "emphasize" the words, or being scientific,
do you want some other type of .. emphasis? If so, then customize a
<span> for them.

Yeah, I guess it isn't for emphasis at all. It's the name of a bacterium
that should be italicized. I was just wondering if this was treated
differently than simply italicizing something for style.
The text in a paragraph element will wrap to fit the available space
when your page is displayed by the browser. You seem to be talking about
how it appears in your source editor. That's your choice. I usually type
about 80 characters and press return so my source is easily readable.

The problem with this seems to be if I need to edit that text later, the
line breaks create a bunch of weird space in between the text. I also
copy and pasted the text back into Word, and of course it was really
funky looking.
 
J

John Salerno

John said:
The problem with this seems to be if I need to edit that text later, the
line breaks create a bunch of weird space in between the text. I also
copy and pasted the text back into Word, and of course it was really
funky looking.

Oh silly me...The problem is caused by the tab stops, not the line breaks!

(And I can't believe I just said 'silly me'.)
 
A

Alan J. Flavell

Hi everyone. I have a couple of (probably simple) questions about
how to format some text in a paragraph.

Hint: it's poor usenet strategy to ask two unrelated questions
together. You just get one contorted thread. And the original
subject line is useless too, to anyone who's looking to see if their
question has been discussed before. I've taken the liberty of
addressing one question, and setting the Subject line accordingly.
First up is the easier one to explain: If I have scientific words
that I want italicized, is that best done with <em> or a <span>? (My
guess is span).

Just what do you mean by "scientific words"?

If it's species, for example, then by widely agreed convention they
are presented in italics; but mention of them isn't in itself
"emphasis", so <em> markup would be perverse.

Speaking for myself, in that case I'd go for <i class="species">

Then you get (as far as the client agent can manage it) the widely
agreed typographic convention, even when CSS is disabled; you don't
mislead anyone into believing that it's <em>phasized; and you've got a
class name which, if you wish, could be used for hanging some CSS
onto, or indeed for other purposes such as counting the number of
references to species in a body of work (provided you stick to your
own conventions, of course).

As far as HTML and CSS are concerned, the choice of a class name is of
course arbitrary: class="species" means nothing to them, it might just
as well be class="k42" for all that they care. The choice is purely
for human convenience.

In their appropriate places, don't overlook the other semantic markups
such as <var>, <cite>, etc., some of which happen to default to italic
presentation; but one should never choose a semantic markup just
because one happens to like the default appearance in one's own
browser - use them honestly.

Alternatively, of course, you could define your own rich markup
language, or use one of the existing rich markup languages, for your
internal working, with purpose-designed tags such as <species>, and
then down-convert those into regular HTML, as above, for serving out
to the web. XML-based processing is said to be good for that (I'm not
really into it myself, admitted).
 
J

John Salerno

Alan said:
Hint: it's poor usenet strategy to ask two unrelated questions
together. You just get one contorted thread. And the original
subject line is useless too, to anyone who's looking to see if their
question has been discussed before. I've taken the liberty of
addressing one question, and setting the Subject line accordingly.

Thanks for telling me this. I actually thought maybe it was rude to make
multiple posts in a row asking questions, but I can see how one thread
would get convoluted.
Just what do you mean by "scientific words"?

In this case it is "Pseudomonas fluorescens," which is a class of bacteria.
In their appropriate places, don't overlook the other semantic markups
such as <var>, <cite>, etc.

Yes, this is what I was curious about. I didn't know if there was a tag
that was close to what I want, sort of like <code> is there for code,
etc. I didn't know if there was something for genus and species, for
example, or anything else like that. <span> was my first choice, but
it's not very specific.
 
F

Frank Olieu

_John Salerno_ skrev | wrote | écrivit (01-02-2006 02:06):
Yes, this is what I was curious about. I didn't know if there was a tag
that was close to what I want, sort of like <code> is there for code,
etc. I didn't know if there was something for genus and species, for
example, or anything else like that. <span> was my first choice, but
it's not very specific.

Maybe <dfn> (definition term) could be a close match... (with an appropriate class).
 
J

John Salerno

Frank said:
_John Salerno_ skrev | wrote | écrivit (01-02-2006 02:06):


Maybe <dfn> (definition term) could be a close match... (with an appropriate class).

That's a possibility. Seems like my choices are:
<em> Renders as emphasized text
<strong> Renders as strong emphasized text
<dfn> Defines a definition term
<code> Defines computer code text
<samp> Defines sample computer code
<kbd> Defines keyboard text
<var> Defines a variable
<cite> Defines a citation


Or to just use <span>....
 
F

Frank Olieu

_John Salerno_ skrev | wrote | écrivit (01-02-2006 03:19):
That's a possibility. Seems like my choices are:
<em> Renders as emphasized text
<strong> Renders as strong emphasized text
<dfn> Defines a definition term
<code> Defines computer code text
<samp> Defines sample computer code
<kbd> Defines keyboard text
<var> Defines a variable
<cite> Defines a citation


Or to just use <span>....

Sure they are! But most of them would be plain silly, wouldn't they? ;-)
BTW, <dfn> is usually rendered as italic.
 
M

Mark Parnell

Deciding to do something for the good of humanity, John Salerno
That's a possibility. Seems like my choices are:
<snip>

You forgot <i>, as Alan suggested. That would be my choice, too.
 
J

John Salerno

Frank said:
_John Salerno_ skrev | wrote | écrivit (01-02-2006 03:19):


Sure they are! But most of them would be plain silly, wouldn't they? ;-)
BTW, <dfn> is usually rendered as italic.

Yeah, I think they are all pretty silly for what I want. Ah well, at
least now I know the general method, and I can probably do something
similar to a span.
 
J

John Salerno

Mark said:
Deciding to do something for the good of humanity, John Salerno

<snip>

You forgot <i>, as Alan suggested. That would be my choice, too.

Really? I thought tags like <i> and <b> weren't recommended anymore
because of CSS?
 
L

Leonard Blaisdell

John Salerno said:
Really? I thought tags like <i> and <b> weren't recommended anymore
because of CSS?

I'll wait for anyone here to give a rational explanation of why the
names of bacteria should be italicized other than by convention. This
convention doesn't logically convey style or structure IMO. Neither <i>
or <b> are deprecated, possibly because of stuff like this.
Perhaps a further iteration of HTML will give us a linnaean element.

leo
 
J

John Salerno

Leonard said:
Neither <i>
or <b> are deprecated, possibly because of stuff like this.

I think it's funny how you and Mark said almost the exact same thing. I
didn't realize they weren't deprecated, but it still seems unholy to use
them anymore. :) It's like I physically can't type those tags, because
I've only recently learned HTML, and it's been drilled into my head not
to use style tags!
 
J

Jukka K. Korpela

Leonard Blaisdell said:
I'll wait for anyone here to give a rational explanation of why the
names of bacteria should be italicized other than by convention.

The convention is sufficient here. It is a long-standing convention in
biology. Since you know you want the name to appear in italics if
possible at all, there is no reason to mess around with markup other
than <i>, since any other element that _might_ be rendered in italics
Perhaps a further iteration of HTML will give us a linnaean
element.

Hardly. It seems that there will be no further iteration - just
stagnation or replacement, sadly enough. But if there were an element
for scientific names of species, it would need to be rather more
detailed. For example, in the _full_ scientific name "Pseudomonas
fluorescens Migula 1895", only the first two words shall appear in
italics. Thus, either the element should have some inner markup, or a
user agent would have know how to process its content, instead of
blindly rendering all of it in italics.
 
A

Andy Dingley

Really? I thought tags like <i> and <b> weren't recommended anymore
because of CSS?

Only when they're used for "random decoration". Italicising of latin in
scientific terms (not just taxon names) has such an established
precedent that they have adequate implied semantics to justify their
use. But put the class on there too.

They're also (unlike <font>) merely "not recommended", rather than
formally deprecated. They're part of HTML 4.01 Strict and tehy always
will be - they might not survive into HTML 5+, but we're writing 4.01
today, not 5+. If you also annotate them with the class then any future
port to a different representation can be easy and automatic.
 
J

Jukka K. Korpela

Andy Dingley said:
<i lang="la-sci" class="taxonomy-species-linnean"

Using an unregistered subcode (in "la-sci") is pointless and
potentially harmful. If you ever encounter some software that does
something useful with the information that the content of some element
is Latin, it might have simplistic parsing of language codes,
recognizing "la" only, or advanced processing that properly recognizes
that "la-sci" is a version of Latin but, not knowing what that version
is, ignores the entire attribute.

I am _not_ protesting against labelling scientific names as being
Latin, but some people might. After all, "Pseudomonas" is just Greek
written in Latin letters. But we might consider it as Latinized Greek
and therefore adequately labeled as Latin, just as we would label
"pseudotheory" as English.

This is of course rather theoretical, since lang attributes are mostly
ignored or misused by user agents.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top