summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4105 -> 4111 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/math-def.mkiv29
-rw-r--r--tex/context/base/math-ini.lua35
-rw-r--r--tex/context/base/math-rad.mkvi270
-rw-r--r--tex/context/base/status-files.pdfbin24599 -> 24623 bytes
-rw-r--r--tex/context/base/status-lua.log2
-rw-r--r--tex/context/base/task-ini.lua2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
10 files changed, 332 insertions, 12 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 097d3ea82..bcdf03966 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2013.07.19 10:31}
+\newcontextversion{2013.07.19 18:57}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index a9c684cc7..f50635154 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 4e1e6a42c..442582c9c 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2013.07.19 10:31}
+\edef\contextversion{2013.07.19 18:57}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv
index 8a8020c6e..1c7e9816c 100644
--- a/tex/context/base/math-def.mkiv
+++ b/tex/context/base/math-def.mkiv
@@ -88,11 +88,23 @@
\let\normalmatharg\arg % todo: maybe automatically
-% using attributes
+% methods:
+%
+% 1: none
+% 2: lua
+% 3: tex
+
+% variants:
+%
+% 1: step 1
+% 2: step 2
+% 3: htdp * 1.33^n
+% 4: size * 1.33^n
-\setnewconstant\bigmathdelimitermethod\plusone
+\setnewconstant\bigmathdelimitermethod \plusone
+\setnewconstant\bigmathdelimitervariant\plusthree
-\def\plainbigdelimiters % traditional method
+\unexpanded\def\plainbigdelimiters % traditional method
{\bigmathdelimitermethod\plustwo}
\plainbigdelimiters % is default for the moment but not so nice
@@ -108,13 +120,13 @@
\installcorenamespace{mathbig}
-\unexpanded\def\choosemathbig#1#2% so we accent \big{||} as well
+\unexpanded\def\choosemathbig#1#2% so we accept \big{||} as well
{{\hbox{$%
\ifcase\bigmathdelimitermethod
\doleftbigmath#2\relax
\dorightbigmath#2\relax
\or
- \attribute\mathsizeattribute#1\relax
+ \attribute\mathsizeattribute\numexpr\bigmathdelimitervariant*\plushundred+#1\relax
\doleftbigmath#2\relax
\dorightbigmath#2\relax
\else
@@ -126,6 +138,13 @@
\mathsurround\zeropoint
$}}}
+\unexpanded\def\mathdelimiterstep#1#2%
+ {\begingroup
+ \attribute\mathsizeattribute\numexpr\plushundred+#1\relax
+ \doleftbigmath#2\relax
+ \dorightbigmath#2\relax
+ \endgroup}
+
\definemathcommand [big] {\choosemathbig\plusone } \setvalue{\??mathbig1}{0.85}
\definemathcommand [Big] {\choosemathbig\plustwo } \setvalue{\??mathbig2}{1.15}
\definemathcommand [bigg] {\choosemathbig\plusthree} \setvalue{\??mathbig3}{1.45}
diff --git a/tex/context/base/math-ini.lua b/tex/context/base/math-ini.lua
index dc1e9f29a..80d99d26d 100644
--- a/tex/context/base/math-ini.lua
+++ b/tex/context/base/math-ini.lua
@@ -445,16 +445,24 @@ function commands.doifelseutfmathbelow(chr)
end
-- helpers
+--
+-- 1: step 1
+-- 2: step 2
+-- 3: htdp * 1.33^n
+-- 4: size * 1.33^n
-function mathematics.big(tfmdata,unicode,n)
+function mathematics.big(tfmdata,unicode,n,method)
local t = tfmdata.characters
local c = t[unicode]
- if c then
+ if c and n > 0 then
local vv = c.vert_variants or c.next and t[c.next].vert_variants
if vv then
local vvn = vv[n]
return vvn and vvn.glyph or vv[#vv].glyph or unicode
- else
+ elseif method == 1 or method == 2 then
+ if method == 2 then -- large steps
+ n = n * 2
+ end
local next = c.next
while next do
if n <= 1 then
@@ -469,6 +477,27 @@ function mathematics.big(tfmdata,unicode,n)
end
end
end
+ else
+ local size = 1.33^n
+ if method == 4 then
+ size = tfmdata.parameters.size * size
+ else -- if method == 3 then
+ size = (c.height + c.depth) * size
+ end
+ local next = c.next
+ while next do
+ local cn = t[next]
+ if (cn.height + cn.depth) >= size then
+ return next
+ else
+ local tn = cn.next
+ if tn then
+ next = tn
+ else
+ return next
+ end
+ end
+ end
end
end
return unicode
diff --git a/tex/context/base/math-rad.mkvi b/tex/context/base/math-rad.mkvi
new file mode 100644
index 000000000..3aac0130b
--- /dev/null
+++ b/tex/context/base/math-rad.mkvi
@@ -0,0 +1,270 @@
+%D \module
+%D [ file=math-rad,
+%D version=2013.07.13,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Radicals,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Math Macros / Radicals}
+
+\unprotect
+
+%D This is already defined in math-def.mkiv:
+
+% \def\rootradical{\Uroot \defaultmathfamily "221A } % can be done in char-def
+%
+% \def\root#1\of{\rootradical{#1}} % #2
+%
+% A traditional approach:
+%
+% \unexpanded\def\sqrt{\doifnextoptionalelse\rootwithdegree\rootwithoutdegree}
+%
+% \def\rootwithdegree [#1]{\rootradical{#1}}
+% \def\rootwithoutdegree {\rootradical {}}
+
+\installcorenamespace{mathradical}
+\installcorenamespace{mathradicalalternative}
+
+\installcommandhandler \??mathradical {mathradical} \??mathradical
+
+\setupmathradical
+ [\c!alternative=\v!default,
+ \c!offset=.25\exheight]
+
+\appendtoks
+ \setuevalue{\currentmathradical}{\math_radical_handle{\currentmathradical}}
+\to \everydefinemathradical
+
+\unexpanded\def\math_radical_handle#tag%
+ {\begingroup
+ \edef\currentmathradical{#tag}%
+ \doifnextoptionalelse\math_radical_degree_yes\math_radical_degree_nop}
+
+\def\math_radical_alternative{\csname\??mathradicalalternative\mathradicalparameter\c!alternative\endcsname}
+
+\def\m_math_no_degree{{}}
+
+\def\math_radical_degree_yes[#degree]{\edef\currentmathradicaldegree{#degree}\math_radical_indeed}
+\def\math_radical_degree_nop {\let\currentmathradicaldegree\m_math_no_degree\math_radical_indeed}
+
+\def\math_radical_indeed#body%
+ {\math_radical_alternative{#body}\endgroup}
+
+\setvalue{\??mathradicalalternative\v!default}% #1%
+ {\rootradical{\currentmathradicaldegree}}
+
+\setvalue{\??mathradicalalternative\v!normal}#body%
+ {\edef\p_color{\mathradicalparameter\c!color}%
+ \ifx\p_color\empty
+ \rootradical\currentmathradicaldegree{#body}%
+ \else\ifx\currentmathradicaldegree\empty
+ \pushcolor[\p_color]%
+ \rootradical\currentmathradicaldegree
+ {\popcolor#body}%
+ \else
+ \pushcolor[\p_color]%
+ \rootradical{\popcolor\currentmathradicaldegree\pushcolor[\p_color]}%
+ {\popcolor#body}%
+ \fi\fi}
+
+% As I had a long standing whish to see a proper final root element I decided
+% to make one my own.
+%
+% \startMPcode
+% path p ; p := unitsquare xysized(4cm,1cm) ;
+%
+% path q ; q := boundingbox p enlarged (bbheight(p)/10) ;
+% numeric h ; h := bbheight(q) ;
+%
+% draw p ;
+% draw
+% llcorner q shifted (-h/2,h/2) --
+% llcorner q shifted (-h/4,0) --
+% ulcorner q --
+% urcorner q --
+% urcorner q shifted (0,-h/10) ;
+% \stopMPcode
+%
+% \startMPextensions
+% vardef math_root(expr w,h,d,o) =
+% path q ; q := boundingbox unitsquare xysized(w,h) enlarged (o);
+% llcorner q shifted (-h/2,h/2) --
+% llcorner q shifted (-h/4,-d) --
+% ulcorner q --
+% urcorner q --
+% urcorner q shifted (0,-h/10)
+% enddef ;
+% \stopMPextensions
+%
+% \startuniqueMPgraphic{root}{width,height,depth,offset,linewidth}
+% pickup pencircle scaled \MPvar{linewidth} ;
+% draw math_root(\MPvar{width},\MPvar{height},\MPvar{depth},\MPvar{offset}) ;
+% \stopuniqueMPgraphic
+%
+% \unexpanded\def\sqrt#1%
+% {\begingroup
+% \setbox\scratchbox\mathstylehbox{#1}%
+% \scratchoffset\MPrawvar{root}{offset}%.25\exheight
+% \scratchwidth \wd\scratchbox
+% \scratchheight\ht\scratchbox
+% \scratchdepth \dp\scratchbox
+% \setbox2=\hbox\bgroup % todo: tag this box as sqrt
+% \uniqueMPgraphic
+% {root}%
+% {width=\the\scratchwidth,%
+% depth=\the\scratchdepth,%
+% height=\the\scratchheight,%
+% offset=\the\scratchoffset,
+% linewidth=\the\linewidth}%
+% \egroup
+% \scratchdimen\wd2
+% \lower\dimexpr\scratchoffset+\scratchdepth\relax\box2
+% \hskip-\scratchdimen
+% \hbox to \scratchdimen{\hss\box\scratchbox\hskip\scratchoffset}%
+% \endgroup}
+
+\startMPextensions
+ vardef math_radical_simple(expr w,h,d,o) =
+ (-h/2-o,h/2-o) --
+ (-h/4-o,-d-o) --
+ (-o,h+o) --
+ (w+o,h+o) --
+ (w+o,h-h/10+o)
+ enddef ;
+\stopMPextensions
+
+\startuniqueMPgraphic{math:radical:default}%{...}
+ draw
+ math_radical_simple(OverlayWidth,OverlayHeight,OverlayDepth,OverlayOffset)
+ withpen pencircle xscaled (2OverlayLineWidth) yscaled (3OverlayLineWidth/4) rotated 30
+ % dashed evenly
+ withcolor OverlayLineColor ;
+\stopuniqueMPgraphic
+
+% todo: spacing .. this is just an experiment (article driven)
+
+\setvalue{\??mathradicalalternative\v!mp}#body% we could use dowithnextbox
+ {\begingroup
+ \scratchoffset\mathradicalparameter\c!offset
+ \setbox\nextbox\mathstylehbox{#body}%
+ % we use the \overlay variables as these are passes anyway and
+ % it's more efficient than using parameters
+ \edef\overlaywidth {\the\wd\nextbox}%
+ \edef\overlayheight {\the\ht\nextbox}%
+ \edef\overlaydepth {\the\dp\nextbox}%
+ \edef\overlayoffset {\the\scratchoffset}%
+ \edef\overlaylinewidth{\the\linewidth}%
+ \edef\overlaylinecolor{\mathradicalparameter\c!color}%
+ %
+ \edef\p_mp{\mathradicalparameter\c!mp}%
+ %
+ \setbox\scratchbox\hbox\bgroup % todo: tag this box as sqrt
+ \uniqueMPgraphic
+ {\p_mp}%
+ %{...}%
+ \egroup
+ \scratchdimen \wd\scratchbox
+ \scratchtopoffset \dimexpr\scratchoffset+\dp\nextbox\relax
+ \scratchbottomoffset\dimexpr\scratchoffset+\ht\nextbox/2\relax
+ \hbox to \scratchdimen{\hss\box\nextbox\hskip\scratchoffset}%
+ \hskip-\scratchdimen
+ \lower\dimexpr\scratchtopoffset\box\scratchbox%
+ \ifx\currentmathradicaldegree\empty \else
+ \setbox\scratchbox\mathstylehbox{\scriptscriptstyle\currentmathradicaldegree\hss}%
+ \wd\scratchbox\scratchdimen
+ \hskip-\scratchdimen
+ \raise\dimexpr\scratchbottomoffset\box\scratchbox
+ \fi
+ \endgroup}
+
+\definemathradical[sqrt][mp=math:radical:default]
+
+% \setupmathradical[sqrt][alternative=normal,color=darkblue]
+% \setupmathradical[sqrt][alternative=mp,color=darkgreen]
+
+%D Because I wanted to illustrate some more fun stuff another mechanism
+%D is provided as well ... let's put some dangerous tools in the hand of
+%D math juglers like Aditya.
+
+\installcorenamespace{mathornament}
+\installcorenamespace{mathornamentalternative}
+
+\installcommandhandler \??mathornament {mathornament} \??mathornament
+
+\setupmathornament
+ [\c!alternative=\v!mp, % currently mp only .. maybe some day layer too
+ \c!offset=.25\exheight]
+
+\appendtoks
+ \setuevalue{\currentmathornament}{\math_ornament_handle{\currentmathornament}}
+\to \everydefinemathornament
+
+\unexpanded\def\math_ornament_handle#tag#body%
+ {\begingroup
+ \edef\currentmathornament{#tag}%
+ \csname\??mathornamentalternative\mathornamentparameter\c!alternative\endcsname{#body}%
+ \endgroup}
+
+\setvalue{\??mathornamentalternative\v!mp}#body% we could use dowithnextbox
+ {\begingroup
+ \scratchoffset\mathornamentparameter\c!offset
+ \setbox\nextbox\mathstylehbox{#body}%
+ \edef\overlaywidth {\the\wd\nextbox}%
+ \edef\overlayheight {\the\ht\nextbox}%
+ \edef\overlaydepth {\the\dp\nextbox}%
+ \edef\overlayoffset {\the\scratchoffset}%
+ \edef\overlaylinewidth{\the\linewidth}%
+ \edef\overlaylinecolor{\mathornamentparameter\c!color}%
+ \edef\p_mp{\mathornamentparameter\c!mp}%
+ \setbox\scratchbox\hbox{\uniqueMPgraphic{\p_mp}}% todo: add code key + tag
+ \scratchdimen \wd\scratchbox
+ \scratchtopoffset \dimexpr\scratchoffset+\dp\nextbox\relax
+ \scratchbottomoffset\dimexpr\scratchoffset+\ht\nextbox/2\relax
+ \hbox to \scratchdimen{\hss\box\nextbox\hskip\scratchoffset}%
+ \hskip-\scratchdimen
+ \box\scratchbox
+ \endgroup}
+
+% \startMPextensions
+% vardef math_ornament_hat(expr w,h,d,o,l) =
+% image ( path p ; p :=
+% (w/2,h + 10l) --
+% (o + w,h + o) --
+% (w/2,h + 7l) --
+% (-o,h + o) --
+% cycle ;
+% fill p ;
+% setbounds currentpicture to (-o,0) -- (w+o,0) -- (w+o,h+2o) -- (-o,h+2o) -- cycle ;
+% )
+% enddef ;
+% \stopMPextensions
+%
+% \startuniqueMPgraphic{math:ornament:hat}
+% draw
+% math_ornament_hat(
+% OverlayWidth,
+% OverlayHeight,
+% OverlayDepth,
+% OverlayOffset,
+% OverlayLineWidth
+% )
+% withpen
+% pencircle
+% xscaled (2OverlayLineWidth)
+% yscaled (3OverlayLineWidth/4)
+% rotated 30
+% withcolor
+% OverlayLineColor ;
+% \stopuniqueMPgraphic
+%
+% \definemathornament [mathhat] [mp=math:ornament:hat]
+%
+% \dorecurse{8}{$\mathhat{\blackrule[width=#1ex,color=gray]}$ }
+
+\protect \endinput
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 8ed3b2301..8b9bac2d1 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.log b/tex/context/base/status-lua.log
index b3e3fc78d..5610ff0e5 100644
--- a/tex/context/base/status-lua.log
+++ b/tex/context/base/status-lua.log
@@ -1,6 +1,6 @@
(cont-yes.mkiv
-ConTeXt ver: 2013.07.19 10:31 MKIV beta fmt: 2013.7.19 int: english/english
+ConTeXt ver: 2013.07.19 18:57 MKIV beta fmt: 2013.7.19 int: english/english
system > 'cont-new.mkiv' loaded
(cont-new.mkiv)
diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua
index 107bfe226..154e7cc6d 100644
--- a/tex/context/base/task-ini.lua
+++ b/tex/context/base/task-ini.lua
@@ -83,6 +83,7 @@ appendaction("math", "normalizers", "noads.handlers.resize", nil, "noh
appendaction("math", "normalizers", "noads.handlers.check", nil, "nohead") -- always on
appendaction("math", "normalizers", "noads.handlers.tags", nil, "nohead") -- disabled
appendaction("math", "normalizers", "noads.handlers.italics", nil, "nohead") -- disabled
+appendaction("math", "normalizers", "noads.handlers.classes", nil, "nohead") -- disabled
appendaction("math", "builders", "builders.kernel.mlist_to_hlist") -- always on
------------("math", "builders", "noads.handlers.italics", nil, "nohead") -- disabled
@@ -158,6 +159,7 @@ disableaction("finalizers", "builders.paragraphs.tag")
disableaction("math", "noads.handlers.tags")
disableaction("math", "noads.handlers.italics")
+disableaction("math", "noads.handlers.classes")
disableaction("mvlbuilders", "typesetters.checkers.handler")
disableaction("vboxbuilders","typesetters.checkers.handler")
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index e32dad3d3..2b69ce233 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 07/19/13 10:31:47
+-- merge date : 07/19/13 18:57:55
do -- begin closure to overcome local limits and interference