[NTG-context] setup for paragraph styles

mf massifr at fastwebnet.it
Fri Mar 13 00:43:32 CET 2015


Hello,
I'd like to kwnow the commands I should use in ConTeXt to define styles
for paragraphs of text that are not headers/titles nor normal text.
With titles I know I must use:
\definehead[MyTitle][title]
\setuphead[MyTitle][...]

What should I use for texts like subtitles, dates of letters,
signatures? They are "paragraphs" often made by a few words, with a
different alignment, margins, style and vertical space above and below.
For a long quote I've seen that I can use:
\definedelimitedtext[MySpecialText]
\setupdelimitedtext[MySpecialText]

Are those the right commands for my purpose in ConTeXt?

In particular, I'm typesetting XHTML, where all those elements are <p
class="subtitle">, <p class="letter-date">, <p class="signature"> and so
on.
An example taken from my xml environment:

...
\startxmlsetups xml:myenv
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{html|body|h3|p|i}{xml:*}
  ...
  \xmlsetsetup{\xmldocument}{p[@class='letter-date']}{xml:p:letter-date}
  ...
\stopxmlsetups
...
\startxmlsetups xml:p:letter-date
  \page[no]\rightaligned{\noindent\xmlflush{#1}}\par\page[no]
\stopxmlsetups
...

Is that the right way or is it better to define and setup a style like
this?
\define_???_[LetterDate]
\setup_???_[LetterDate][
  before=...,
  after=...,
  ...,
]

and use it like this:
\startxmlsetups xml:p:letter-date
  \startLetterDate \xmlflush{#1} \stopLetterDate
\stopxmlsetups

And if it's better like that, what should I write instead of _???_ ?

Thanks,
Massi



More information about the ntg-context mailing list