ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Extending the black circled numbers
@ 2006-04-03 22:52 nico
  2006-04-04  9:40 ` Taco Hoekwater
  2006-04-04 12:44 ` Hans Hagen
  0 siblings, 2 replies; 15+ messages in thread
From: nico @ 2006-04-03 22:52 UTC (permalink / raw)


Hello,

For those who know, I'm trying to have the DocBook callout mechanism with  
context. Basically, there are some numbers in lines of verbatim text, and  
below the verbatim text the numbers are used to explain the portion of the  
text (kind of footnote). Typically the numbers are rendered white in black  
circle. I could use the Dingbats numbers, but it is limited to 10, so that  
I emulated them with the following code to be able to go up to 99.

The questions I have:
- Is it the right way to do it in context (do I really need metafont?  
Simpler, smarter method?)
- What should I do to make them as anchors, so that it can be  
cross-referenced (I mean, one can click on a hot spot that jump to the  
number in the verbatim text).

Thanks for any hint,

\newdimen \cowidth

% Maximum size of the circle fits for number 99
\def\evalwidth%
   {\bgroup%
    \setbox0\hbox{\small\bf{\ss 99}}%
    \global\cowidth=1.2\wd0%
    \egroup}

% Background black circle
\startuniqueMPgraphic{CoCircle}
   fill fullcircle scaled \overlaywidth withcolor black ;
\stopuniqueMPgraphic

\defineoverlay[cocircle][\uniqueMPgraphic{CoCircle}]

% Display the black circled number
\def\conum#1%
   {\evalwidth%
    \framed[background=cocircle,strut=no,frame=off,
            width=\the\cowidth,height=\the\cowidth,offset=overlay]
            {\color[white]{\small\bf{\ss #1}}}}

\starttext

\dorecurse{99}{\conum{\recurselevel}, }

\stoptext

Regards,
BG

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

end of thread, other threads:[~2006-04-06  8:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-03 22:52 Extending the black circled numbers nico
2006-04-04  9:40 ` Taco Hoekwater
2006-04-04 18:42   ` nico
2006-04-04 12:44 ` Hans Hagen
2006-04-04 18:56   ` nico
2006-04-04 20:50     ` Hans Hagen
2006-04-04 22:13       ` nico
2006-04-05  7:42         ` Hans Hagen
2006-04-05 19:59           ` nico
2006-04-05 20:42             ` nico
2006-04-05 20:50               ` Hans Hagen
2006-04-05 20:52               ` Hans Hagen
2006-04-05 23:06                 ` nico
2006-04-06  0:20                 ` nico
2006-04-06  8:17                   ` 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).