Equivalent of the \cancel command with conTeXt
Hi, In an algebraic expression, it is sometimes interesting to cross out terms. With LaTeX, there is the \cancel command from the package cancel. Is there an equivalent with conTeXt ? Thanks Fabrice
Hi Fabrice,
I have this from former exchanges
% Cancel command for use in equations.
\startuniqueMPgraphic{cross out}
picture cross;
cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0););
draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle
scaled .8pt ;
\stopuniqueMPgraphic
\defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}]
\define[1]\cancel{%
\ifmmode
\mframed[background=canceloverlay, frame=off, offset=overlay]{{#1}}%
\else%
\framed[background=canceloverlay, frame=off, offset=overlay]{{#1}}%
\fi%
}
Maybe something else is available nowadays.
A. Christe
Le 22 août 2023 à 12:22 +0200, Fabrice Couvreur
Hi, In an algebraic expression, it is sometimes interesting to cross out terms. With LaTeX, there is the \cancel command from the package cancel. Is there an equivalent with conTeXt ? Thanks Fabrice ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________
Hi Alexander,
Thank you for this suggestion which will do the trick.
Fabrice
Le mar. 22 août 2023 à 10:26, Alexandre Christe
Hi Fabrice,
I have this from former exchanges
% Cancel command for use in equations. \startuniqueMPgraphic{cross out} picture cross; cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0);); draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle scaled .8pt ; \stopuniqueMPgraphic
\defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}]
\define[1]\cancel{% \ifmmode \mframed[background=canceloverlay, frame=off, offset=overlay]{{#1}}% \else% \framed[background=canceloverlay, frame=off, offset=overlay]{{#1}}% \fi% }
Maybe something else is available nowadays.
A. Christe Le 22 août 2023 à 12:22 +0200, Fabrice Couvreur < fabrice1.couvreur@gmail.com>, a écrit :
Hi, In an algebraic expression, it is sometimes interesting to cross out terms. With LaTeX, there is the \cancel command from the package cancel. Is there an equivalent with conTeXt ? Thanks Fabrice
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net
___________________________________________________________________________________
Hi,
On Tue, Aug 22, 2023 at 12:25 PM Fabrice Couvreur
Hi, In an algebraic expression, it is sometimes interesting to cross out terms. With LaTeX, there is the \cancel command from the package cancel. Is there an equivalent with conTeXt ? Thanks Fabrice
I don't know what the cancel package gives, but since December 22 or so, one can do \starttext \setupframed [mathstrikeout] [color=darkgreen, backgroundcolor=darkred, frame=off] \startTEXpage[offset=4dk,align=flushleft] \dm{1+\mathstrikeout[strike:text={what is this?}]{(2x-x)}+2=3+x} \blank \dm{1+\mathstrikeout[strike:math={=x}]{(2x-x)}+2=3+x} \blank \dm{1+\mathstrikeout[strike:math=u,arrow=no]{(2x-x)}+2=3+x} \blank \dm{1+\mathcrossout[strike:math={=x}]{(2x-x)}+2=3+x} \stopTEXpage \stoptext /Mikael
Hi Mikael,
Thank you for this command ; there must be many others that I don't know
how they work.
Fabrice
Le mar. 22 août 2023 à 10:54, Mikael Sundqvist
Hi,
On Tue, Aug 22, 2023 at 12:25 PM Fabrice Couvreur
wrote: Hi, In an algebraic expression, it is sometimes interesting to cross out
terms. With LaTeX, there is the \cancel command from the package cancel. Is there an equivalent with conTeXt ?
Thanks Fabrice
I don't know what the cancel package gives, but since December 22 or so, one can do
\starttext
\setupframed [mathstrikeout] [color=darkgreen, backgroundcolor=darkred, frame=off]
\startTEXpage[offset=4dk,align=flushleft] \dm{1+\mathstrikeout[strike:text={what is this?}]{(2x-x)}+2=3+x} \blank \dm{1+\mathstrikeout[strike:math={=x}]{(2x-x)}+2=3+x} \blank \dm{1+\mathstrikeout[strike:math=u,arrow=no]{(2x-x)}+2=3+x} \blank \dm{1+\mathcrossout[strike:math={=x}]{(2x-x)}+2=3+x} \stopTEXpage
\stoptext
/Mikael
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net
___________________________________________________________________________________
participants (3)
-
Alexandre Christe
-
Fabrice Couvreur
-
Mikael Sundqvist