/usr/share/perl5/LaTeXML/Package/cancel.sty.ltxml is in latexml 0.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | # -*- mode: Perl -*-
# /=====================================================================\ #
# | cancel | #
# | Implementation for LaTeXML | #
# |=====================================================================| #
# | Part of LaTeXML: | #
# | Public domain software, produced as part of work done by the | #
# | United States Government & not subject to copyright in the US. | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov> #_# | #
# | http://dlmf.nist.gov/LaTeXML/ (o o) | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;
#======================================================================
# Ignore them all, for the moment.
foreach my $option (qw(samesize smaller Smaller makeroom overlap thicklines)) {
DeclareOption($option, undef); }
#======================================================================
# The really annoying thing with \CancelColor is to
# get the strike-through done in that color,
# but have the contents be "normal" color!
# \def\CancelColor{\black} ??
DefMacro('\CancelColor', '');
sub cancelColorProperties {
my %props = (innerfont => LookupValue('font'));
$STATE->getStomach->bgroup;
if (Digest(T_CS('\CancelColor'))) {
$props{cancelfont} = LookupValue('font');
$props{forcefont} = 'true'; }
$STATE->getStomach->egroup;
return %props; }
#======================================================================
# Basic macros
# \cancel{expression} Cancels with /
DefMacro('\cancel{}',
'\ifmmode\@@math@cancel{#1}\else\@@text@cancel{#1}\fi');
# \bcancel{expression} Cancels with \
DefMacro('\bcancel{}',
'\ifmmode\@@math@bcancel{#1}\else\@@text@bcancel{#1}\fi');
# \xcancel{expression} Cancels with X
DefMacro('\xcancel{}',
'\ifmmode\@@math@xcancel{#1}\else\@@text@xcancel{#1}\fi');
#======================================================================
# Math mode
DefConstructor('\@@math@cancel{}',
"<ltx:XMApp>"
. "<ltx:XMTok role='ENCLOSE' enclose='updiagonalstrike' meaning='cancel'"
. " _force_font='#forcefont' _font='#cancelfont'/>"
. "<ltx:XMWrap>#1</ltx:XMWrap>"
. "</ltx:XMApp>",
alias => '\cancel',
properties => \&cancelColorProperties);
DefConstructor('\@@math@bcancel{}',
"<ltx:XMApp>"
. "<ltx:XMTok role='ENCLOSE' enclose='downdiagonalstrike' meaning='cancel'"
. " _force_font='#forcefont' _font='#cancelfont'/>"
. "<ltx:XMWrap>#1</ltx:XMWrap>"
. "</ltx:XMApp>",
alias => '\bcancel',
properties => \&cancelColorProperties);
DefConstructor('\@@math@xcancel{}',
"<ltx:XMApp>"
. "<ltx:XMTok role='ENCLOSE' enclose='updiagonalstrike downdiagonalstrike' meaning='cancel'"
. " _force_font='#forcefont' _font='#cancelfont'/>"
. "<ltx:XMWrap>#1</ltx:XMWrap>"
. "</ltx:XMApp>",
alias => '\xcancel',
properties => \&cancelColorProperties);
# This only works in math mode
# \cancelto{value}{expression}
# Note that the slashthrough SHOULD be an arrow!!!
# Since enclose maps to MathML's menclose notation, which is open-ended,
# we can add a not-(yet)-standard updiagnonalarrow (as suggested by Frederic Wang)
DefConstructor('\cancelto{}{}',
"<ltx:XMApp>"
. "<ltx:XMTok role='SUPERSCRIPTOP'/>"
. "<ltx:XMApp>"
. "<ltx:XMTok role='ENCLOSE' enclose='updiagonalstrike updiagonalarrow' meaning='cancel'"
. " _force_font='#forcefont' _font='#cancelfont'/>"
. "<ltx:XMWrap>#2</ltx:XMWrap>"
. "</ltx:XMApp>"
. "<ltx:XMWrap>#1</ltx:XMWrap>"
. "</ltx:XMApp>",
properties => \&cancelColorProperties);
#======================================================================
# This works, except that
# there isn't any CSS to create the different types of cross throughs
DefConstructor('\@@text@cancel{}',
"<ltx:del class='downdiagonalstrike' _force_font='#forcefont' _font='#cancelfont'>"
. "<ltx:text _noautoclose='1' _force_font='#forcefont' _font='#innerfont'>"
. "#1"
. "</ltx:text>"
. "</ltx:del>",
alias => '\cancel',
properties => \&cancelColorProperties);
DefConstructor('\@@text@bcancel{}',
"<ltx:del class='updiagonalstrike' _force_font='#forcefont' _font='#cancelfont'>"
. "<ltx:text _noautoclose='1' _force_font='#forcefont' _font='#innerfont'>"
. "#1"
. "</ltx:text>"
. "</ltx:del>",
alias => '\bcancel',
properties => \&cancelColorProperties);
DefConstructor('\@@text@xcancel{}',
"<ltx:del class='downdiagonalstrike updiagonalstrike' _force_font='#forcefont' _font='#cancelfont'>"
. "<ltx:text _noautoclose='1' _force_font='#forcefont' _font='#innerfont'>"
. "#1"
. "</ltx:text>"
. "</ltx:del>",
alias => '\xcancel',
properties => \&cancelColorProperties);
ProcessOptions();
1;
|