From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/415 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: syntax Date: Mon, 17 May 1999 23:59:23 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <3740913B.99C62109@wxs.nl> References: <14142.48095.1988.765986@bitmuis.thuis.nl> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035391276 23861 80.91.224.250 (23 Oct 2002 16:41:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:41:16 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: siepo@cybercomm.nl Xref: main.gmane.org gmane.comp.tex.context:415 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:415 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. > - 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. > %%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > - 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 only seems to compile if I replace `after' with `\c!after', and > even then I get a full instead of half a blank line. I suppose you run the english context. \c!after is illegal (at least untill context is english low level), but \c!na should work, that is, when the set up commands are surrounded by \unprotect \protect (makes ! ? @ letter). But such rather low level dirty settings (c! and v!) are only needed for international setups. > 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. % context style indentation: -) \setuphead [subject] [before=\blank, after={\blank[small]}, style={\switchtobodyfont[sans,16pt]\bf}] > then the style parameter seems to be ignored. 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 ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl -----------------------------------------------------------------