ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: overarc
Date: Thu, 5 Mar 2009 15:09:54 +0100	[thread overview]
Message-ID: <9F69970E-ADAF-4D34-9B98-70D31E093CCA@uni-bonn.de> (raw)
In-Reply-To: <alpine.LNX.2.00.0903050825100.2205@ybpnyubfg.ybpnyqbznva>


On Mar 5, 2009, at 2:39 PM, Aditya Mahajan wrote:

> Currently, there is no such feature. Are you looking at the  
> functionality of the arcs package of latex? If so, it will be easy  
> to add it to ConTeXt. The main trouble is that the glyph for  
> \overarc is missing from the fonts. Arcs.sty takes the glyphs for  
> \frown and \smile, and scales them appropriately. An ugly solution,  
> but it looks ok if you are just placing it over one or two letters.

I had a similar wish a while ago and hacked something with a  
MPpositiongraphic. It is certainly not very elegant, but IMHO better  
than the LaTeX code you posted (scaling a glyph like that will look  
ugly when you want to span more than just two letters). Wolfgang  
Schuster supplied the neat trick with the counter. It is quite fast  
when run with mkiv, but I suspect would be slow with mkii (and leave  
quite a few .mp files behind). Maybe this can help:

\newcount\arcnumber

\startMPpositiongraphic{placeoverarc}
      StartPage ;
      begingroup ;
      initialize_box(\MPpos{\MPvar{self}}) ;
      numeric c ; c = ExHeight/6 ;
      z1 = llxy ;
      z2 = lrxy ;
      z7 = 1/2[z1,z2] ;
      z4 = ((x1 + 2*c), (y1 + 2*c)) ;
      z5 = (x7, (y7 + 4*c)) ;
      z6 = ((x2 - 2*c), (y2 + 2*c)) ;
      path syn ; syn := z4 .. z5 .. z6 ;
      pickup pencircle scaled (0.75*c) ;
      draw syn ;
      anchor_box(\MPanchor{\MPvar{self}}) ;
      endgroup ;
      save c ;
      StopPage ;
\stopMPpositiongraphic%

\define[1]\overarc
{\advance\arcnumber\plusone%
  \setMPpositiongraphic{POS-\number\arcnumber}{placeoverarc}%
  \hpos{POS-\number\arcnumber}{#1}}

Maybe that can be the starting point for some better code...

Thomas

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2009-03-05 14:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05  5:22 overarc David Arnold
2009-03-05 13:39 ` overarc Aditya Mahajan
2009-03-05 14:09   ` Thomas A. Schmitz [this message]
2009-03-05 18:36 ` overarc Hans Hagen

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=9F69970E-ADAF-4D34-9B98-70D31E093CCA@uni-bonn.de \
    --to=thomas.schmitz@uni-bonn.de \
    --cc=ntg-context@ntg.nl \
    /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).