[NTG-context] style questions

Hans Hagen ntg-context@ntg.nl
Sat, 03 Jan 2004 23:00:39 +0100


At 20:49 01/01/2004, you wrote:

>1. I want to mark some words consistently and used the \definesynonyms
>    command for this, although I only use the second form.
>
>    \definesynonyms[glossar][explanation][\infull]
>    \glossar [ZOPE] {\em Zope} {Web Applikationsserver}
>
>    Is there a better way to style words consistently? I find it
>    difficult to distinguish between \ZOPE\ and \ZOPE, especially for
>    the possible later translation from XML.

you can try: {\ZOPE} for both, so between {\ZOPE} and {\ZOPE},

technically a lookahead for space is possible but there are border cases ...

in XML, when you use

between <meaning label="ZOPE"/> and <meaning label="ZOPE"/>, with:

   \defineXMLsingular [meaning] [label=] {\infull{\XMLop{label}}}

there is no space problem (the \ is needed to prevent eating up the space, 
which is a result from the way tex parses \COMMANDS.

>2. In the example there is an indirection for the section definitions.
>
>    \definehead [Topic]   [chapter]
>    \definehead [Nopic]   [title]
>
>    Later on the newly defined headers are styled. But they are used as
>    the only headers throughout the document. So why not style the
>    original ones?

hm, a matter of taste, a topic is not a chapter; imagine a quality 
assurance manual:

   \Procedure \WorkInstruction \Process

is then more meaningfull than chapter section subsection (also, the 
indirectness enables you to reassign levels)

>3. I have defined colored header bars in the following ways.
>
>\setuphead
>   [subject, Subject,section]
>   [command=\mysec,
>    page=no,
>    continue=no,
>    style={\ss\bs},
>    color=black]
>
>\def\mysec#1#2{\framed[width=\textwidth,
>    corner=round,
>    radius=0.05em,
>    background=color,
>    backgroundcolor=HKS5,
>    framecolor=HKS5]{\startnarrower[1*left,1*right] #2 \hfill #1
>\stopnarrower}}
>
>    They are spanning the complete textwidth. What I now want is to
>    have a smaller textwidth, but the bars should remain broader, as
>    broad as the header and footer lines. Any hints?

I don't understand what you want, maybe:

\def\mysec#1#2%
   {\framed
     [width=\textwidth,
      corner=round,
      radius=0.05em,
      background=color,
      backgroundcolor=HKS5,
      align=normal,
      strut=no,
      framecolor=HKS5]
     {\setuptabulate[before=,after=]
      \starttabulate[|p(5cm)|r|]\NC#2\NC#1\NC\NR\stoptabulate}}

or

\def\mysec#1#2%
   {\bTABLE
    \bTR \bTD #2 \eTD \bTD #1 \eTD \eTR
    \eTABLE}

>4. How to deal with metadata, like author, version, last modified and
>    so. Would you recommend to use buffers for this? This information
>    is probably used on the title page and the footer of each page.

\setvariables
   [category]
   [something=whatever]

and then

\getvariable{category}{something}

>Ok, now a real question. I want to style the actual requirements in
>form of a papercard, whith their actual status at the top. This would
>be an new definition with 2 or 3 arguments. But the requirements
>should also be enumerated. How can one build such an environment?
>Derive somehow from \defineenumeration?
>
>---------------------------------------------------------------
>|ReqNbr  | Title                               | status | date|
>---------------------------------------------------------------
>| longer text .... with paragraphs and pagebreaks             |
>---------------------------------------------------------------
>
>Sorry for the ascii-art (cough :-). These cards should be able to span
>more than one page. In the light of this a table with running heads
>would also be an option, right?
>
>Thanks for this great package, it is a lot of fun and full of gems.

something

\long\def\StartMyCard#1#2#3#4#5\StopMyCard
   {\bTABLE
    \bTR \bTD #1 \eTD \bTD #2 \eTD \bTD #3 \eTD \bTD #4 \eTD \eTR
    \bTR \bTD[nc=4] #5 \eTD \eTR
    \eTABLE}

\StartMyCard{Req}{Title}{status}{date} text .... \StopMyCard

or:

\long\def\StartMyCard[#1]#2\StopMyCard
   {\getvariables[card][nr=,title=,status=,date=,#2]
    \bTABLE
    \bTR \bTD \getvariable{card}{nr} \eTD .... \eTR
    \bTR \bTD[nc=4] #2 \eTD \eTR
    \eTABLE}

\StartMyCard[nr=10,title=whatever]
some text
\StopMyCard

etc etc

Hans