/usr/share/perl5/LaTeXML/Package/amscd.sty.ltxml is in latexml 0.8.0-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 133 134 135 136 137 | # -*- CPERL -*-
# /=====================================================================\ #
# | amscd | #
# | 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. | #
# |---------------------------------------------------------------------| #
# | Thanks to the arXMLiv group for initial implementation | #
# | http://arxmliv.kwarc.info/ | #
# | Released to the Public Domain | #
# |---------------------------------------------------------------------| #
# | 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;
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Note that the amscd authors themselves point out that amcsd is limited,
# only covering array-like commutative diagrams, and they suggest
# diagram, xypic or kuvio as alternatives.
#
# However, it is just that simplicity that mkes it possible to represent
# the commutative diagram in straight latexml math, w/o resorting to
# the more general svg(-like) problems.
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DefMacro('\CD', '\@@CD\@start@alignment');
DefMacro('\endCD', '\@finish@alignment\@end@CD');
DefPrimitive('\@end@CD', sub { $_[0]->egroup; });
DefConstructor('\@@CD DigestedBody',
'#1',
beforeDigest => sub {
$_[0]->bgroup;
alignmentBindings(MatrixTemplate(), 'math', attributes => { name => 'Matrix' });
Let(T_ALIGN, '\@cd@invisible@align');
Let("\\\\", '\@alignment@newline@noskip');
$STATE->assignMathcode('@' => 0x8000);
Let('@', '\cd@'); },
reversion => '\begin{CD}#1\end{CD}');
DefMacroI('\@cd@invisible@align', undef,
'\@close@inner@column\@close@column'
. '\@open@column\@open@inner@column');
#DefConstructorI('\@alignment@align@marker',undef,'',reversion=>'&');
DefMacro('\cd@ Token', sub {
my ($gullet, $token) = @_;
(T_CS('@' . ToString($token))); });
DefMacroI(T_CS('@>'), 'Until:> Until:>',
'&\cd@stack{>}{\rightarrowfill@}{#1}{#2}&');
DefMacroI(T_CS('@)'), 'Until:) Until:)',
'&\cd@stack{)}{\rightarrowfill@}{#1}{#2}&');
DefMacroI(T_CS('@<'), 'Until:< Until:<',
'&\cd@stack{<}{\leftarrowfill@}{#1}{#2}&');
DefMacroI(T_CS('@('), 'Until:( Until:(',
'&\cd@stack{(}{\leftarrowfill@}{#1}{#2}&');
DefMacroI(T_CS('@A'), 'Until:A Until:A',
'\cd@adjacent{A}{\Big\uparrow}{#1}{#2}&&');
DefMacroI(T_CS('@V'), 'Until:V Until:V',
'\cd@adjacent{V}{\Big\downarrow}{#1}{#2}&&');
DefMacroI(T_CS('@='), undef,
'&\@cd@equals@&');
DefMacroI(T_CS('@|'), undef,
'\Big\Vert&&');
DefMacroI(T_CS('@\vert'), undef,
'\Big\Vert&&');
DefMacroI(T_CS('@.'), undef,
'&&');
# Horizontal
DefMath('\@cd@equals@', "=", role => 'ARROW', stretchy => 'true', reversion => '@=');
# Vertical
DefMath('\@cd@bar@', "|", role => 'ARROW', font => { size => 'Big' }, reversion => '@|');
DefMath('\@cd@vert@', "\x{2225}", role => 'ARROW', font => { size => 'Big' }, reversion => '@\vert');
DefRegister('\minaw@' => Dimension('11.111pt'));
# deal with under, over & underover!
DefConstructor('\cd@stack Undigested {}{}{}', sub {
my ($document, $reversion, $op, $over, $under, %props) = @_;
my $scriptpos = $props{scriptpos};
if ($under->unlist) {
$document->openElement('ltx:XMApp', role => 'ARROW'); # Role?
$document->insertElement('ltx:XMTok', undef, role => 'SUBSCRIPTOP', scriptpos => $scriptpos);
if ($over->unlist) {
$document->openElement('ltx:XMApp'); # Role?
$document->insertElement('ltx:XMTok', undef, role => 'SUPERSCRIPTOP', scriptpos => $scriptpos);
$document->insertElement('ltx:XMArg', $op);
$document->insertElement('ltx:XMArg', $over);
$document->closeElement('ltx:XMApp'); }
else {
$document->insertElement('ltx:XMArg', $op); }
$document->insertElement('ltx:XMArg', $under);
$document->closeElement('ltx:XMApp'); }
elsif ($over->unlist) {
$document->openElement('ltx:XMApp'); # Role?
$document->insertElement('ltx:XMTok', undef, role => 'SUPERSCRIPTOP', scriptpos => $scriptpos);
$document->insertElement('ltx:XMArg', $op);
$document->insertElement('ltx:XMArg', $over);
$document->closeElement('ltx:XMApp'); }
else {
$document->insertElement('ltx:XMArg', $op); } },
properties => { scriptpos => sub { "mid" . $_[0]->getBoxingLevel; } },
reversion => '@#1{#3}#1{#4}#1');
# \cd@adj{}{}{}
# Temporary...
# Later deal with vertically centering the side things, parser issues...
#DefMacro('\cd@adjacent{}{}{}{}','{#3}{#2}{#4}');
DefConstructor('\cd@adjacent Undigested {}{}{}', sub {
my ($document, $reversion, $op, $left, $right, %props) = @_;
$document->openElement('ltx:XMWrap', role => 'ARROW'); # Role?
$document->insertElement('ltx:XMArg', $left) if $left->unlist;
$document->insertElement('ltx:XMArg', $op);
$document->insertElement('ltx:XMArg', $right) if $right->unlist;
$document->closeElement('ltx:XMWrap'); },
reversion => '@#1{#3}#1{#4}#1');
# This isn't really having the desired effect when transformed to MathML and
# displayed in Firefox.... have I got it right; has Firefox???
DefMath('\leftarrowfill@', "\x{2190}", role => 'ARROW', stretchy => 'true');
DefMath('\rightarrowfill@', "\x{2192}", role => 'ARROW', stretchy => 'true');
DefRegister('\minCDarrowwidth' => Dimension('2.5pc'));
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1;
|