ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Equivalent of LaTeX \cancel? and Thanks!
@ 2008-10-11 19:17 Benjamin R. Haskell
  2008-10-12 14:17 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin R. Haskell @ 2008-10-11 19:17 UTC (permalink / raw)
  To: ConTeXt Users

Hi all,

I recently transitioned from LaTeX to ConTeXt. There was some particular 
thing I needed to do (which escapes me at the moment) that was far, far 
easier to do in ConTeXt than in LaTeX. And, as I've learned, I've found 
that that's quite often the case. So, a huge thank you to everyone 
involved.

A couple hours ago I was annoyed that I couldn't find an equivalent for 
the LaTeX 'cancel' environment/command/style(?)[1]. Now, I'm truly amazed 
that 'cancel' required a whole package.

After discovering that 'underline' and 'strikethrough' were implemented as 
overlays, I quickly coded up the following:

\startuseMPgraphic{MyCancel}
     draw (0,.2*\overlayheight)--(\overlaywidth,\overlayheight);
\stopuseMPgraphic
\defineoverlay[mycancel][\useMPgraphic{MyCancel}]

\def\cancel#1{\framed[background=mycancel,frame=off]{#1}}


Now, I'm sure this is not *quite* the right way to do it. The 'cancel'ed 
items end up being placed too high on the line, and other spacings are 
slightly off. But, taking a cue from underlining, I kept the MyCancel 
graphic and tried:

\definetextbackground
    [cancel]
    [location=text,
     alternative=1,
     background=mycancel]
% plus boilerplate for setting up \startcancel\stopcancel

...But, while composing this email, I found what I wanted, which still 
isn't ``right'' in some sense:

\def\cancel#1{\framed[background=mycancel,frame=off,width=fit,height=fit,strut=no]{#1}}

I found the parameters for \framed. I'm still learning to Read The 
Fantastic Manuals, but sent this anyway since I wanted to say thanks.

Best,
Ben

[1] e.g. http://www.sosmath.com/CBB/viewtopic.php?t=9412
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2008-10-14  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-11 19:17 Equivalent of LaTeX \cancel? and Thanks! Benjamin R. Haskell
2008-10-12 14:17 ` Hans Hagen
2008-10-14  8:10   ` Wolfgang Schuster

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