Hans Hagen writes: > Siep Kroonenberg wrote: > > > - Does Context provide for styles as in Word: a set of typographic > > specifications (font, leading, h&j, space before and after) separate > > from any sectioning hierarchy, or is it necessary to write those from > > scratch as macros? > > Most commands have some before/after (voor/na) hooks. These are normally > used for spacing: voor={\blanko[groot]}, but you can use them for other > things too. Font switches normally take place with the style (letter) > parameter. In some occasions there is 'afstand', 'korps', 'binnen', > 'links', 'rechts', etc. So what would be a natural choice as a basis for defining Word styles (as an environment)? I need to define several variations on ordinary text, not some kind of sectioning command. Can you give me a template, or should I do something like start/stopWhatever from s-map-01.tex? > > > - Is the following syntax safe: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > \some_context_macro > > % comment > > [parameter] > > Yes. Try for instance > > \setuphead > % comment > [chapter] > % comment > [style=bold] > > TeX ignores spaces atthe beginningof the line, so the comment becomes > one space, and the context argument handler takes care of such spaces. Glad to learn this. Some non-reproducible mysterious behaviour must probably be ascribed to other causes. > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > - I am trying to define typography for a header: > > > > \setuphead[subject] > > [before=\blank, > > after=\blank[small], > > style={\switchtobodyfont[sans,16pt]\bf}] > > Use switched around {\blank[small]}. Unfortunately TeX's normal argument > handling capabilities are not able to handle nested things (in this case > nested []). Technically, everything between a pair of [] is picked up, > and in your case > the after small ends the parameter list. This turns out to work in one example but not in another; attached the one where it doesn't work. > > If I try C-style indentation: > > > > \setuphead[subject] > > [before=\blank, > > after=\blank[small], > > style={\switchtobodyfont[sans,16pt]\bf > > } > > ] > > Spaces after the first [ and after commas are gobbled, but everything > between = and the next , or final ] makes up the value. A `%' after `}' fixes it, too. Sanity restored. > Some bonus tips: > > \definealternativestyle [siep] [{\switchtobodyfont[sans,16pt]\bf}] [] > > \defineblank [alsosiep] [2*big] > > \setuphead[chapter][style=siep,before={\blank[alsosiep]}] > > Especially the logical blank's can enforce consistency. > > Hans Ah! More indirection! But I see where I would want to use this. Siep -- Siep Kroonenberg, TeX helpdesk Siep.Kroonenberg@wkap.nl Kluwer Academic Publishers Prepress Department Achterom 119 3311 KB Dordrecht The Netherlands