ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Tip: PlaceRegisterInline
@ 2007-02-12 22:17 Mike Bird
  0 siblings, 0 replies; only message in thread
From: Mike Bird @ 2007-02-12 22:17 UTC (permalink / raw)
  To: ntg-context

In Context one can use registers for powerful sorting with single
or multiple keys.  However, it's a little tricky if you want the
result to appear other than one element per line.

Here's a macro that does the job:

\def\PlaceRegisterInline[#1,#2,#3]{%  Register Before After
  \bgroup
  \let\par=\empty
  \let\endgraf=\empty
  \edef\goodbreak{#2}%
  \let\doregistercharactera=\doregistercharacterb
  \placeregister[#1][%
    after=,%
    before=,%
    distance={0em{#3}},%
    indicator=no,%
    n=1,%
    symbol=none]%
  \egroup}

For example, to place elements of register R in brackets one
can use \PlaceInlineRegister[R,{[},{]}] and achieve something
like [A][B][C].

--Mike Bird

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-12 22:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-12 22:17 Tip: PlaceRegisterInline Mike Bird

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