groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Eric Raymond on groff and TeX


From: Ted Harding
Subject: Re: [Groff] Eric Raymond on groff and TeX
Date: Thu, 03 May 2012 23:13:32 +0100 (BST)

To go back to Anton's original posting, where he quoted
Eric Raymond:

    As an example: In a presentation-markup lan-
    guage,  if you want to emphasize a word, you
    might instruct the formatter to  set  it  in
    boldface.  In  troff(1) this would look like
    so:

        All your base
        .B are
        belong to us!

    In a structural-markup language,  you  would
    tell the formatter to emphasize the word:

        All your base <emphasis>are</emphasis> belong to us!

    The  "<emphasis>" and </emphasis>in the line
    above are called markup tags, or  just  tags
    for short. They are the instructions to your
    formatter.

    In a structural-markup language, the  physi-
    cal  appearance  of the final document would
    be controlled by a stylesheet .  It  is  the
    stylesheet  that  would  tell  the formatter
    "render emphasis as a font change  to  bold-
    face".  One  advantage  of structural-markup
    languages is that by changing  a  stylesheet
    you  can globally change the presentation of
    the document (to use  different  fonts,  for
    example)  without having to hack all the the
    individual instances of (say) .B in the doc-
    ument itself.

On the lines that others have since pointed out, one can
emulate the "<emphasis>are</emphasis>" (with definitions
in a "stylesheet") straightforwardly in groff:

.\"Stylesheet definitions:
.ds emph \fB
.ds /emph \fP
.\"..........................

All your base \*[emph]are\*[/emph] belong to us!

You could define \*[emph] as \fI (plain italic), or as \f[BI]
(bold italic), etc.

On that basis, I think (though I may have misunderstood the
distinction Eric Raymond want to make between presentation-markup
and structural-markup) that it comes to much the same thing!

However, in certain contexts one may wish to underline instead,
which gets more complicated in groff (and would be defined in
macros rather than in strings). Then its implementation would
look different, though it stills seems to be to come to the
same thing.

Best wishes to all,
Ted.

-------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 03-May-2012  Time: 23:13:25
This message was sent by XFMail
-------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]