ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [ANN] Macros for displaying unicode vectors
@ 2005-06-09 17:48 Nikolai Weibull
  0 siblings, 0 replies; only message in thread
From: Nikolai Weibull @ 2005-06-09 17:48 UTC (permalink / raw)


Here's a nice way to display the contents of a unicode vector, as
rendered by ConTeXt:

\def\unicodevectortablerow#1#2%
  {\NC
   \ss\ix\uchexnumber{\numexpr(#2-1)\relax}
   \VL
   \dorecurse{16}
     {\newcount\u \u=\numexpr(#1*256+(#2-1)+(\recurselevel-1)*16)\relax
      \utfunihash\u \VL}%
   \AR}
% TODO: *{17}{c|} in format doesn't work
\def\unicodevectortable#1%
  {\bgroup
   \Expand
   \placetable
     []
     []
     {Unicode Vector #1}
     \starttable[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|]
     \NC\VL[3]
       \dorecurse{15}{\ss\ix\uchexnumbers{#1}\uchexnumber{\recurselevel}\NC}
       \ss\ix\uchexnumbers{#1}F\VL[3]\AR
     \HL[3]
     \dorecurse{15}
       {\glet\row\recurselevel
        \unicodevectortablerow{#1}{\row}
        \HL}
     \unicodevectortablerow{#1}{16}
     \HL[3]
     \stoptable
   \egroup}

And then

\starttext
\unicodevectortable{34}
\stoptext

The \glet\row\recurselevel is terrible, but I couldn't come up with a
better solution.  Also, even though thrd-tab.tex suggests that one may
write *{N}{FORMAT} in the template, that doesn't seem to work.
Suggestions?,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

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

only message in thread, other threads:[~2005-06-09 17:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-09 17:48 [ANN] Macros for displaying unicode vectors Nikolai Weibull

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