RE: Whose problem is a strange French typesetting habit...

Thanks for all the specifics--extremely helpful! I figured much of that was probably possible, and I'm really glad to see it is. Thanks too for mentioning the TEI analogue.

This further bolsters my hope that we are not facing "the doom of <q>"! Now we just need to get publishers to _use_ <q>. . . .

-----Original Message-----
From: Bert Bos [mailto:bert@w3.org] 
Sent: Sunday, October 27, 2013 11:07 AM
To: W3C Digital Publishing IG
Subject: Re: Whose problem is a strange French typesetting habit...


On Oct 26, 2013, at 23:02, Bill Kasdorf wrote:

> I hate to see the phrase "the doom of <q>" ;-) though otherwise I was going to contribute much of what Liam just did. (BTW the most famous example of a writer in English using the dash rather than quotation marks is James Joyce. He hated quotation marks because he thought it made the content look "tentative": c.f. the use of "air quotes" for "so-called." No coincidence that he spent a lot of his life in Paris.)
> 
> The reason <q> has begun to look so attractive to me is that in my work with the EU Publications Office--who must publish many of their publications in many or all EU languages--the fact that quotation marks are actually different Unicode characters in different languages is an obvious burden. (One of many.) Could CSS be smart enough to associate an @xml:lang with a <q> and apply the proper Unicode characters? _And_ handle the usage (mainly spacing) variants Ivan called attention to in the first place? If not, then I may have to accept "the doom of <q>." Frankly, very few publishers actually use <q> anyhow in my experience; the quotation marks are literal text 99+% of the time.

Yes, CSS can handle language-dependent quotation marks for the <q> element for this type of usage, including the spacing.

[Warning: CSS code examples ahead!]

Say you want a style that works for both English and French: In English with ‘’ by default and “” for nested quotes; in French with respectively «+[space]+» and ‛’. The CSS rules for the <q> element would then look like this:

    /* Specify pairs of quotes for two levels in two languages */
    q:lang(en) { quotes: "‘" "’" "“" "”" }
    q:lang(fr) { quotes: "«\202F" "\202F»" "‛" "’" }
    /* Add more rules here if you have more languages */

    /* Insert quotes before and after Q element content */
    /* (Can be omitted. This is already the HTML default.) */
    q:before { content: open-quote }
    q:after  { content: close-quote }

The \202F is the Unicode number for the narrow non-break space. The rules of the French Imprimerie Nationale say that it should be a non-break space (\A0), but the book that gives those rules itself actually uses a narrow space. I prefer the narrow one...

(Before Unicode added the narrow no-break space, I used to recommend adding a 0.1667 em CSS margin, but that's no longer needed.)

Depending on how you want to use quotation marks in mixed-language texts, you may want to write the first two selectors like this instead:

    /* Specify pairs of quotes for two levels in two languages */
    :lang(en) > q { quotes: "‘" "’" "“" "”" }
    :lang(fr) > q { quotes: "«\202F" "\202F»" "‛" "’" }

This causes the <q> element to use the quotes for the language of the _surrounding_ text, not the quotes for the language of the element itself. E.g., writing

    <q>House</q> is spelled <q xml:lang="fr">maison</q>

would then give

    ‘House’ is spelled ‘maison’

rather than

    ‘House’ is spelled « maison »


Some brainstorming about saving <q> from doom:

The problems Liam and I mentioned have first of all to do with the inability of HTML's <q> element to express anything more than simple, uninterrupted quotations. The TEI format, e.g., has a richer <q> element[1] and because of its richer mark-up you can provide smarter CSS rules.

[1] http://www.tei-c.org/release/doc/tei-p5-exemplars/html/tei_lite.doc.html#z635


But, HTML has a class attribute to make it extensible, so you could ask your authors to use classes to distinguish simple quotations

    <p>We wrote about the <q>invaders.</q></p>

from multi-part quotations:

    <p>He wrote: <q class="first">Exactly 25 years ago, we
      bought this house.</q></p>
    <p><q class="cont">There weren't that many people in the
      area then. It was cheap.</q></p>
    <p><q class="last">But now it's worth a fortune. And the
      tax man thinks we're rich.</q></p>

I arbitrarily invented class=first, class=cont and class=last to indicate a <q> that has two or more parts. Now the mark-up is rich enough to tell CSS where you need only opening quotation marks and where you need both opening and closing marks.

This also allows to express the French style for a "dialogue," i.e., a section of a chapter with a rapid succession of quotations, spanning several paragraphs:

    <p>... dominait tout le paysage.
    <p><q class=first>Ça, c'est Garlaban. Aubagne est de
      l'autre coté, juste au pied.</q>
    <p><q class=cont>Moi</q>, dis-je <q class=cont>je suis né
      à Aubagne.</q>
    <p><q class=cont>Alors</q>, dit le paysan, <q class=last>tu
      es d'ici.</q>
    <p>Je regardai...

Which should be rendered with guillemets at the start & end, and en-dashes in the middle:

    ...
    dominait tout le paysage.
      « Ça, c'est Garlaban. Aubagne est de l'autre coté,
    juste au pied.
      -- Moi, dis-je je suis né à Aubagne.
      -- Alors, dit le paysan, tu es d'ici. »
      Je regardai...

(from Marcel Pagnol, La gloire de mon père.)

The CSS rules aren't obvious, but not too bad:

    q {quotes: "« " " »"}                      /* Simple case */
    q.first {quotes: "« " ""}                  /* Start only */
    q.last {quotes: "" " »"}                   /* End only */
    q.cont {quotes: "" ""}                     /* No marks */
    q.cont:first-child {quotes: "\2013\A0" ""} /* En dash + nbsp */

(To keep the rules short, I omitted the alternative quotation marks for nested quotes, not necessary for this particular example.)

The question remains if you can convince your authors that all this extra mark-up is worth it...


Yet another issue is whether to include all punctuation inside the element: "<q>invaders<q>." vs "<q>invaders.</q>". Semantically, it often doesn't belong there, but some style guides require it to be inside the quotation marks for esthetic purposes. The normal French style wants them outside, some American styles put them inside, especially if you render citations with italics instead of quotation marks...



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/

  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Sunday, 27 October 2013 16:23:52 UTC