[texhax] Oblique cancellation with plain TeX
David Carlisle
d.p.carlisle at gmail.com
Fri Jan 4 22:28:19 CET 2019
\input picture
\catcode`\@=11
\RequirePackage{cancel}
\let\zzcancel\cancel
\def\cancel#1{{%
\let\line\LaTeX at line
\zzcancel{#1}}}
$\cancel{x^2 + 1}$
$\cancel{a}$
$\cancel{{x^2 + 1 \over b}}$
\bye
On Fri, 4 Jan 2019 at 20:55, Rodolfo Medina <rodolfo.medina at gmail.com> wrote:
>
> James Diamond <jim.diamond at acadiau.ca> writes:
>
> > On Fri, Jan 4, 2019 at 19:14 (+0000), Rodolfo Medina wrote:
> >
> >> Philip Taylor <P.Taylor at Rhul.Ac.Uk> writes:
> >
> >>> Maybe if you were to post a GIF/PNG/JPG/PDF of the effect you are trying to
> >>> create, we non-mathematicians might be better placed to help you ...
> >
> >
> >> The following is a simple example: to be processed with simply `latex file'.
> >> I
> >> want the same but with plain TeX... Thanks,
> >
> >> Rodolfo
> >
> >> \documentclass[preview,border=12pt,varwidth]{standalone}
> >> \usepackage{cancel}
> >> \begin{document}
> >> \abovedisplayskip=0pt
> >> \[
> >> \frac{a\cancel{b}}{\cancel{b}}=a
> >> \]
> >> \end{document}
> >
> > What is wrong with
> >
> > $$ {a\rlap{$b$}/ \over \rlap{$b$}/} = a$$
> >
> > (Aside from the fact that if $b = 0$ then Bad Things are happening?)
> >
> > You could also write
> >
> > \def\cancel#1{\rlap{$#1$}/}
> >
> > somewhere near the beginning of your document and then, when you want
> > to cancel things out, write something like
> >
> > $$ {a\cancel{b} \over \cancel{b}} = a$$
> >
> > or
> >
> > This is $ {a\cancel{b} \over \cancel{b}} = a$ a simple idea.
>
>
> Well, thanks, Jim, but... sorry, it's my fault... I'd better better explain
> myself... It's needed that the argument of \cancel may be variable, and so the
> diagonal line should also vary its length and angle:
>
> \documentclass[preview,border=12pt,varwidth]{standalone}
> \usepackage{cancel}
> \begin{document}
>
> $\cancel{x^2 + 1}$
>
> $\cancel{a}$
>
> $\cancel{{x^2 + 1 \over b}}$
>
> \end{document}
>
>
> Rodolfo
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
More information about the texhax
mailing list