Update for itex2MML 1.3.13

Implements \mathrlap{}, \mathllap{}, and \mathclap{}.
Deprecates the use of \rlap{} (use \mathrlap{}, instead:
the latter works in math-mode in the LaTeX export, whereas
TeX's \rlap{} did not).
This commit is contained in:
Jacques Distler 2009-10-05 02:36:00 -05:00
parent 41274d64d0
commit d89769fe81
3 changed files with 19 additions and 2 deletions

View file

@ -83,6 +83,11 @@
\def\slash{\protect\itex@pslash}
\makeatother
% math-mode versions of \rlap, etc
% from Alexander Perlis, "A complement to \smash, \llap, and lap"
% http://math.arizona.edu/~aprl/publications/mathclap/
\def\clap#1{\hbox to 0pt{\hss#1\hss}} \def\mathllap{\mathpalette\mathllapinternal} \def\mathrlap{\mathpalette\mathrlapinternal} \def\mathclap{\mathpalette\mathclapinternal} \def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}} \def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}} \def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}}
% Renames \sqrt as \oldsqrt and redefine root to result in \sqrt[#1]{#2}
\let\oldroot\root
\def\root#1#2{\oldroot #1 \of{#2}}

View file

@ -1007,6 +1007,11 @@ class WikiControllerTest < ActionController::TestCase
\def\slash{\protect\itex@pslash}
\makeatother
% math-mode versions of \rlap, etc
% from Alexander Perlis, "A complement to \smash, \llap, and lap"
% http://math.arizona.edu/~aprl/publications/mathclap/
\def\clap#1{\hbox to 0pt{\hss#1\hss}} \def\mathllap{\mathpalette\mathllapinternal} \def\mathrlap{\mathpalette\mathrlapinternal} \def\mathclap{\mathpalette\mathclapinternal} \def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}} \def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}} \def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}}
% Renames \sqrt as \oldsqrt and redefine root to result in \sqrt[#1]{#2}
\let\oldroot\root
\def\root#1#2{\oldroot #1 \of{#2}}

View file

@ -212,6 +212,13 @@ END_THM
def test_have_latest_itex2mml
assert_markup_parsed_as(
%{<p>equation <math class='maruku-mathml' displa} +
%{y='inline' xmlns='http://www.w3.org/1998/Math/} +
%{MathML'><mi>A</mi><mpadded lspace='-100%width'} +
%{ width='0'><mi>B</mi></mpadded></math></p>},
"equation $A \\mathllap{B}$")
assert_markup_parsed_as(
%{<p>equation <math class='maruku-mathml' displa} +
%{y='inline' xmlns='http://www.w3.org/1998/Math/} +
@ -247,8 +254,8 @@ END_THM
assert_markup_parsed_as(
%{<p>\\rlap: <math class='maruku-mathml' display='} +
%{inline' xmlns='http://www.w3.org/1998/Math/MathML'><mpadded} +
%{ width='0'><mn>123</mn></mpadded></math></p>},
%{inline' xmlns='http://www.w3.org/1998/Math/MathML'>} +
%{<mn>123</mn></math></p>},
'\rlap: $\rlap{123}$')
end