-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amscd #2449
Amscd #2449
Changes from 3 commits
6ca26e3
263ad3f
a4c36fd
5a5b943
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -535,7 +535,14 @@ sub pmml_maybe_resize { | |
my $depth = $node->getAttribute('depth') || ($parent && $parent->getAttribute('depth')); | ||
my $xoff = $node->getAttribute('xoffset') || ($parent && $parent->getAttribute('xoffset')); | ||
my $yoff = $node->getAttribute('yoffset') || ($parent && $parent->getAttribute('yoffset')); | ||
if ($width || $height || $depth || $xoff || $yoff) { | ||
my $role = $node->getAttribute('role') || ($parent && $parent->getAttribute('role')); | ||
my $unstretchy = (($node->getAttribute('stretchy') || ($parent && $parent->getAttribute('stretchy'))) || 'yes') eq 'no'; | ||
|
||
# First, special case hack for stretchy arrows, with specified width | ||
# Stretchiness (currently) only has effect within munder/mover!!!!! | ||
if ($width && (($role || '') eq 'ARROW') && !$unstretchy) { # SPECIAL CASE HACK | ||
$result = ['m:mover', {}, $result, ['m:mspace', { width => $width }]]; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if a well-named Maybe There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The my $stretchy_attr = $node->getAttribute('stretchy') || ($parent && $parent->getAttribute('stretchy')) || "true";
my $unstretchy = $strechy_attr neq "true"; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Somehow I knew you'd suggest that, so why didn't I just head you off by implementing it? But actually, something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, if a class is going to be used to detect the "special case", then we can drop the test of |
||
elsif ($width || $height || $depth || $xoff || $yoff) { | ||
if ($$result[0] eq 'm:mpadded') { } | ||
elsif ($$result[0] eq 'm:mrow') { | ||
$$result[0] = 'm:mpadded'; } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
<tag>(1)</tag> | ||
<tag role="refnum">1</tag> | ||
</tags> | ||
<Math mode="display" tex="\begin{CD}S^{{\mathcal{W}}_{\Lambda}}\otimes T@>{j}>{}>T\\ @V{}V{}V@V{}V{\operatorname{End}P}V\\ (S\otimes T)/I@=(Z\otimes T)/J\end{CD}" text="commutative-diagram@(Array[[S ^ (W _ Lambda) tensor-product T, rightarrowfill@ ^ j, T], [downarrow, , absent downarrow End@(P), , ], [(S tensor-product T) / I, @cd@equals@, (Z tensor-product T) / J]])" xml:id="S0.E1.m1"> | ||
<Math mode="display" tex="\begin{CD}S^{{\mathcal{W}}_{\Lambda}}\otimes T@>{j}>{}>T\\ @V{}V{}V@V{}V{\operatorname{End}P}V\\ (S\otimes T)/I=(Z\otimes T)/J\end{CD}" text="commutative-diagram@(Array[[S ^ (W _ Lambda) tensor-product T, rightarrow ^ j, T], [downarrow, , absent downarrow End@(P), , ], [(S tensor-product T) / I, =, (Z tensor-product T) / J]])" xml:id="S0.E1.m1"> | ||
<XMath> | ||
<XMDual> | ||
<XMApp> | ||
|
@@ -39,7 +39,7 @@ | |
<XMCell align="center"> | ||
<XMApp> | ||
<XMTok role="SUPERSCRIPTOP" scriptpos="mid5"/> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">→</XMTok> | ||
<XMTok font="italic" fontsize="70%" role="UNKNOWN">j</XMTok> | ||
</XMApp> | ||
</XMCell> | ||
|
@@ -56,7 +56,7 @@ | |
<XMApp role="ARROW"> | ||
<XMTok fontsize="160%" name="downarrow" role="ARROW">↓</XMTok> | ||
<XMTok meaning="absent"/> | ||
<XMApp> | ||
<XMApp width="0.0pt"> | ||
<XMTok fontsize="70%" role="OPFUNCTION" scriptpos="post">End</XMTok> | ||
<XMTok font="italic" fontsize="70%" role="UNKNOWN">P</XMTok> | ||
</XMApp> | ||
|
@@ -85,7 +85,7 @@ | |
</XMApp> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="@cd@equals@" role="ARROW" stretchy="true">=</XMTok> | ||
<XMTok meaning="equals" role="ARROW" stretchy="true" width="30.0pt">=</XMTok> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMApp> | ||
|
@@ -116,7 +116,7 @@ | |
<tag>(2)</tag> | ||
<tag role="refnum">2</tag> | ||
</tags> | ||
<Math mode="display" tex="\begin{CD}\operatorname{cov}(\mathcal{L})@>{}>{}>\operatorname{non}(\mathcal{K% })@>{}>{}>\operatorname{cf}(\mathcal{K})@>{}>{}>\operatorname{cf}(\mathcal{L})% \\ @V{}V{}V@A{}A{}A@A{}A{}A@V{}V{}V\\ \operatorname{add}(\mathcal{L})@>{}>{}>\operatorname{add}(\mathcal{K})@>{}>{}>% \operatorname{cov}(\mathcal{K})@>{}>{}>\operatorname{non}(\mathcal{L})\end{CD}" text="commutative-diagram@(Array[[cov@(L), rightarrowfill@, non@(K), rightarrowfill@, cf@(K), rightarrowfill@, cf@(L)], [downarrow, , uparrow, , uparrow, , downarrow, , ], [add@(L), rightarrowfill@, add@(K), rightarrowfill@, cov@(K), rightarrowfill@, non@(L)]])" xml:id="S0.E2.m1"> | ||
<Math mode="display" tex="\begin{CD}\operatorname{cov}(\mathcal{L})@>{i}>{j}>\operatorname{non}(\mathcal% {K})@){i}){})\operatorname{cf}(\mathcal{K})@>{}>{j}>\operatorname{cf}(\mathcal% {L})\\ @V{}V{}V\Big{\|}\Big{\|}@A{}A{}A\\ \operatorname{add}(\mathcal{L})@<{}<{}<\operatorname{add}(\mathcal{K})@({}({}(% \operatorname{cov}(\mathcal{K})@<{}<{}<\operatorname{non}(\mathcal{L})\end{CD}" text="commutative-diagram@(Array[[cov@(L), (rightarrow ^ i) _ j, non@(K), rightarrow ^ i, cf@(K), rightarrow _ j, cf@(L)], [downarrow, , ||, , ||, , uparrow, , ], [add@(L), rightarrow, add@(K), rightarrow, cov@(K), rightarrow, non@(L)]])" xml:id="S0.E2.m1"> | ||
<XMath> | ||
<XMDual> | ||
<XMApp> | ||
|
@@ -142,7 +142,15 @@ | |
</XMDual> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMApp role="ARROW"> | ||
<XMTok role="SUBSCRIPTOP" scriptpos="mid5"/> | ||
<XMApp> | ||
<XMTok role="SUPERSCRIPTOP" scriptpos="mid5"/> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">→</XMTok> | ||
<XMTok font="italic" fontsize="70%" role="UNKNOWN">i</XMTok> | ||
</XMApp> | ||
<XMTok font="italic" fontsize="70%" role="UNKNOWN">j</XMTok> | ||
</XMApp> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMDual> | ||
|
@@ -161,7 +169,11 @@ | |
</XMDual> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMApp> | ||
<XMTok role="SUPERSCRIPTOP" scriptpos="mid5"/> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">→</XMTok> | ||
<XMTok font="italic" fontsize="70%" role="UNKNOWN">i</XMTok> | ||
</XMApp> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMDual> | ||
|
@@ -180,7 +192,11 @@ | |
</XMDual> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMApp role="ARROW"> | ||
<XMTok role="SUBSCRIPTOP" scriptpos="mid5"/> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">→</XMTok> | ||
<XMTok font="italic" fontsize="70%" role="UNKNOWN">j</XMTok> | ||
</XMApp> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMDual> | ||
|
@@ -205,15 +221,15 @@ | |
</XMCell> | ||
<XMCell/> | ||
<XMCell align="center"> | ||
<XMTok fontsize="160%" name="uparrow" role="ARROW">↑</XMTok> | ||
<XMTok fontsize="160%" name="||" role="VERTBAR">∥</XMTok> | ||
</XMCell> | ||
<XMCell/> | ||
<XMCell align="center"> | ||
<XMTok fontsize="160%" name="uparrow" role="ARROW">↑</XMTok> | ||
<XMTok fontsize="160%" name="||" role="VERTBAR">∥</XMTok> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The DefMathI('\|', undef, "\x{2225}", role => 'VERTBAR', name => '||'); In the TeXbook, I see its definition marked with "vertical line" in Appendix E, p. 420:
Would There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be, but |
||
</XMCell> | ||
<XMCell/> | ||
<XMCell align="center"> | ||
<XMTok fontsize="160%" name="downarrow" role="ARROW">↓</XMTok> | ||
<XMTok fontsize="160%" name="uparrow" role="ARROW">↑</XMTok> | ||
</XMCell> | ||
<XMCell/> | ||
<XMCell/> | ||
|
@@ -236,7 +252,7 @@ | |
</XMDual> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">←</XMTok> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMDual> | ||
|
@@ -255,7 +271,7 @@ | |
</XMDual> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">←</XMTok> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMDual> | ||
|
@@ -274,7 +290,7 @@ | |
</XMDual> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMTok name="rightarrowfill@" role="ARROW" stretchy="true">→</XMTok> | ||
<XMTok meaning="rightarrow" role="ARROW" stretchy="true" width="30.0pt">←</XMTok> | ||
</XMCell> | ||
<XMCell align="center"> | ||
<XMDual> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a clarifying question:
What is the intended meaning of an
XMTok
that has a set positive width (30pt here), withstretchy="true"
at the same time?Does the XMath
width
act asmin-width
in this circumstance?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! Good question! So, the way it gets converted to MathML (wrapped in an
mover
with a widemspace
, in this PR) allows for the expectation that other table cells might be wider and cause the arrow to stretch even further, so that it would act as amin-width
. However, the current MathML-Core apparently only does horizontal stretch withinmover/munder
, so it would never see those other cells' widths. So, in practice (currently) it would act as the width.