ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	Kip Warner <kip@thevertigo.com>
Cc: seyal zavira <seyal.zavira@gmail.com>
Subject: [NTG-context] Re: Number in a circle
Date: Mon, 27 May 2024 19:44:12 +0200	[thread overview]
Message-ID: <2caf39d3-3687-0c93-88db-1a54cd6be2f9@gmail.com> (raw)
In-Reply-To: <719dd29d3b2dc33fb331fd9b5c8080d0546ba8b4.camel@thevertigo.com>

Kip Warner schrieb am 27.05.2024 um 19:23:
> On Mon, 2024-05-27 at 05:43 -0400, seyal zavira wrote:
>> if you don't want to use metapost you can also use svg for background
>> for example:
>>
>> \startuniqueMPgraphic{centered_svg}
>>    draw lmt_svg [
>>      filename = "badge.svg",
>>      width  = OverlayWidth,
>>      y      = OverlayHeight/2,  ] ;
>> \stopuniqueMPgraphic
>>
>> \defineoverlay
>>    [svgback]
>>    [\useMPgraphic{centered_svg}]
>>
>> \defineframed[Sback][location=low,background=svgback,frame=off,offset=8pt]
>>
>> \starttext
>> this is a sample \Sback{1} text
>> \stoptext
> 
> Hello Seyal,
> 
> This does work but it's a bit annoying that I have to create an SVG of
> just a circle and store it somewhere. I'm fine with using MetaPost,
> especially if it makes this easier, but I just don't know how.

You can use the \framed solution and modify it to use a metapost graphic 
as background, it also easy to replace the circle with a hexagon etc.

\startuseMPgraphic{textcircle}
     draw fullcircle
         xscaled OverlayWidth
         yscaled OverlayWidth
         withcolor OverlayLineColor ;
\stopuseMPgraphic

\defineoverlay[textcircle][\useMPgraphic{textcircle}]

\defineframed
   [textcircled]
   [      width=1.5em,
         height=1.5em,
         frame=off,
    background=textcircle,
      location=low,
        offset=none]

\starttext
\dostepwiserecurse{0}{9}{1}{#1 = \textcircled{#1}\blank}
\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2024-05-27 17:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27  4:14 [NTG-context] " Kip Warner
2024-05-27  5:09 ` [NTG-context] " Ryszard Kubiak
2024-05-27 17:20   ` Kip Warner
2024-05-28  6:17     ` Henning Hraban Ramm
2024-05-28 21:49       ` Kip Warner
2024-05-30 15:26         ` Henning Hraban Ramm
2024-05-30 21:18           ` Kip Warner
2024-05-27  9:43 ` seyal zavira
2024-05-27 17:23   ` Kip Warner
2024-05-27 17:44     ` Wolfgang Schuster [this message]
2024-05-28  4:29       ` Kip Warner
2024-05-28 15:38         ` Wolfgang Schuster
2024-05-28 22:02           ` Kip Warner
2024-05-29  4:52             ` Kip Warner
2024-05-27 14:51 ` Wolfgang Schuster
2024-05-27 17:10   ` Kip Warner
2024-05-27 17:28     ` Wolfgang Schuster
2024-05-27 17:33       ` Kip Warner
2024-05-27 18:15       ` vm via ntg-context
2024-05-28 21:37         ` Kip Warner
2024-05-28 15:47     ` Pablo Rodriguez via ntg-context
2024-05-28 15:50       ` Pablo Rodriguez via ntg-context
2024-05-28 21:50       ` Kip Warner
2024-05-30 15:22         ` Henning Hraban Ramm
2024-05-30 16:18           ` Kip Warner
2024-05-30 16:26             ` Thomas A. Schmitz
2024-05-30 17:25               ` Kip Warner
2024-05-30 20:19                 ` Henning Hraban Ramm
2024-05-30 22:20                   ` Bruce Horrocks
2024-05-30 23:05                     ` Kip Warner
2024-06-01  0:48                       ` Bruce Horrocks
2024-06-04 17:19                         ` Bruce Horrocks
2024-06-04 18:00                           ` Kip Warner
2024-06-04 20:44                             ` Bruce Horrocks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2caf39d3-3687-0c93-88db-1a54cd6be2f9@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=kip@thevertigo.com \
    --cc=ntg-context@ntg.nl \
    --cc=seyal.zavira@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).