ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* templates
@ 1999-04-25 19:05 Hans Hagen
  1999-04-26  9:58 ` templates Taco Hoekwater
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 1999-04-25 19:05 UTC (permalink / raw)


Hi All,

Sometimes keying in macros can be annoying. For this reason, sometimes
macro packages use | to shorten things, like |word| for verbatim in
macros related to programming source code or manuals. In itself such
macros are not that expressive, but they at least save typing keys. 

Currently in ConTeXt the || is used for compound words and other things
that concern hyphenation (like in this|(|one) where the '(' is to be
taken into account in the break).

The next release will introduce templates, that also use the |. Think
of: 

\definetemplate [b] [style=bold]
\definetemplate [t] [style=type]
\definetemplate [w] [command=\Word]
\definetemplate [c] [style=cap]
\definetemplate [u] [style=type,command=\hyphenatedurl]

something |t:monospaced| and something |b:bold| and
something |w:capitalized| or really |c:cap| but, you||see
the compound words and whatever goes|:|between
and|::|between or|*|between and should hyphenated still
works ok and even colons |t:like here:| come out ok, just
like the next rather fuzzy |u:http://www.pragma-ade.nl|

Maybe it makes sense to predefine some templates, like t (type), e
(emphasys) and b (bold). Maybe even m (math) makes sense. Any ideas are
welcome.  

Furthermore, in a few weeks I will upload context up-to-date 1999-003,
which shows how to do flow charts. (Maybe 1999-004 will  concern math).  
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
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: templates
  1999-04-26  9:58 ` templates Taco Hoekwater
@ 1999-04-26  9:11   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 1999-04-26  9:11 UTC (permalink / raw)


Taco Hoekwater wrote:

> So the name really should be \defineshortcut, IMO. Otherwise, you

Ok. 

> might run into conflicts later when and if Context starts using real
> templates (a 'real' template is like for instance the message
> libraries' -- notation for the extra information).
> 
> For syntax, I am a little unsure about the |. Why not use a syntax
> like <b:bold>? I wouldn't be worried about hacing \catcode`<=13;
> because that char almost never used outside of math.

Sounds reasonable. (I have to look into the \type<<...>> i.e. slanted
verbatim but I don't expect problems there.) \catcode`< is btw always
reset when reading in files. 

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
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: templates
  1999-04-25 19:05 templates Hans Hagen
@ 1999-04-26  9:58 ` Taco Hoekwater
  1999-04-26  9:11   ` templates Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Taco Hoekwater @ 1999-04-26  9:58 UTC (permalink / raw)
  Cc: ntg-context

>>>>> "Hans" == Hans Hagen <pragma@wxs.nl> writes:

    Hans> Hi All, Sometimes keying in macros can be annoying. For this
    Hans> reason, sometimes macro packages use | to shorten things,
    Hans> like |word| for verbatim in macros related to programming
    Hans> source code or manuals. In itself such macros are not that
    Hans> expressive, but they at least save typing keys.

While the idea of shortcuts is nice, I'm not too happy about this
implementation.  These things are really key-shortcuts, not templates.

So the name really should be \defineshortcut, IMO. Otherwise, you
might run into conflicts later when and if Context starts using real
templates (a 'real' template is like for instance the message
libraries' -- notation for the extra information). 

For syntax, I am a little unsure about the |. Why not use a syntax
like <b:bold>? I wouldn't be worried about hacing \catcode`<=13;
because that char almost never used outside of math.

Taco


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-04-26  9:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-04-25 19:05 templates Hans Hagen
1999-04-26  9:58 ` templates Taco Hoekwater
1999-04-26  9:11   ` templates Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).