summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx')
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx265
1 files changed, 265 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx
new file mode 100644
index 00000000000..dcbb17c5eca
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx
@@ -0,0 +1,265 @@
+%D \module
+%D [ file=math-dld,
+%D version=2022.07.29,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=delimiteds,
+%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 / Delimited}
+
+\unprotect
+
+%D This is a variant on radicals but in the end it was better to just define a new
+%D environment for this. This is because we don't have the rule and we want a
+%D different control over the spacing. We also don't want the degree.
+
+% Todo: also add the mp plugin here but that more fun stuff for later (when we pick
+% up school math).
+
+\installcorenamespace{mathdelimited}
+\installcorenamespace{mathdelimitedalternative}
+
+\installcommandhandler \??mathdelimited {mathdelimited} \??mathdelimited
+
+\setupmathdelimited
+ [\c!alternative=\v!normal,
+ \c!mpoffset=.25\exheight,
+ \c!topoffset=\zeropoint,
+ \c!bottomoffset=\zeropoint,
+ \c!height=\zeropoint,
+ \c!depth=\zeropoint,
+ \c!strut=\v!height,
+ \c!source=\zerocount,
+ \c!size=\zerocount,
+ \c!left=\zerocount,
+ \c!right=\zerocount,
+ \c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint]
+
+\appendtoks
+ \ifcstok{\mathdelimitedparameter\c!rightmargin}\v!no\else
+ \frozen\protected\instance\edefcsname\currentmathdelimited\endcsname{\math_delimited_handle{\currentmathdelimited}}
+ \fi
+\to \everydefinemathdelimited
+
+\mutable\lettonothing\currentmathdelimited
+
+\tolerant\protected\def\math_delimited_handle#tag#*[#settings]#:#body%
+ {\begingroup
+ \edef\currentmathdelimited{#tag}%
+ \setupcurrentmathdelimited[#settings]%
+ \math_delimited_alternative{%
+ \begincsname\??mathwhateverstrut\mathdelimitedparameter\c!strut\endcsname
+ \scratchdimen\mathdelimitedparameter\c!leftmargin \relax\ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ #body%
+ \scratchdimen\mathdelimitedparameter\c!rightmargin\relax\ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ }%
+ \endgroup}
+
+\def\math_delimited_alternative{\csname\??mathdelimitedalternative\mathdelimitedparameter\c!alternative\endcsname}
+
+\protected\def\math_delimited_common
+ {\Udelimited
+ \s!height\dimexpr\mathdelimitedparameter\c!height+\mathdelimitedparameter\c!topoffset\relax
+ \s!depth \dimexpr\mathdelimitedparameter\c!depth+\mathdelimitedparameter\c!bottomoffset\relax
+ \s!source\numexpr\namedboxanchor{\mathdelimitedparameter\c!source}\relax
+ \s!style \normalmathstyle
+ \s!size \numexpr\namedboxanchor{\mathdelimitedparameter\c!size}\relax
+ \zerocount \mathdelimitedparameter\c!left
+ \zerocount \mathdelimitedparameter\c!right
+ \relax}
+
+\defcsname\??mathdelimitedalternative\v!default\endcsname % #body%
+ {\math_delimited_common} % {#body}}
+
+\defcsname\??mathdelimitedalternative\v!normal\endcsname#body%
+ {\edef\p_color{\mathdelimitedparameter\c!color}%
+ \ifempty\p_color
+ \math_delimited_common{#body}% {} really needed as \rootdelimited expands first
+ \else
+ \pushcolor[\p_color]%
+ \math_delimited_common
+ {\popcolor#body}%
+ \fi}
+
+
+%integerdef\delimitedrightgraveuc \privatecharactercode{delimited right grave}
+\integerdef\delimitedrightddotuc \privatecharactercode{delimited right ddot}
+\integerdef\delimitedrightbaruc \privatecharactercode{delimited right bar}
+%integerdef\delimitedrightacuteuc \privatecharactercode{delimited right acute}
+\integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat}
+\integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
+\integerdef\delimitedrightbreveuc \privatecharactercode{delimited right breve}
+\integerdef\delimitedrightdotuc \privatecharactercode{delimited right dot}
+\integerdef\delimitedrightringuc \privatecharactercode{delimited right ring}
+\integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
+\integerdef\delimitedrightdddotuc \privatecharactercode{delimited right dddot}
+\integerdef\delimitedrightdaggeruc \privatecharactercode{delimited right dagger}
+\integerdef\delimitedrightddaggeruc \privatecharactercode{delimited right ddagger}
+\integerdef\delimitedrightastuc \privatecharactercode{delimited right ast}
+\integerdef\delimitedrightstaruc \privatecharactercode{delimited right star}
+
+% \integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat}
+% \integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
+% \integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
+
+% todo: some more .. are the offsets okay?
+% breve and acute does not make sense
+
+\definemathdelimited
+ [marked]
+ [\c!command=\v!no,
+ \c!topoffset=.2\exheight]
+
+\definemathdelimited
+ [ddotmarked]
+ [marked]
+ [\c!right=\delimitedrightddotuc]
+
+\definemathdelimited
+ [barmarked]
+ [marked]
+ [\c!right=\delimitedrightbaruc]
+
+\definemathdelimited
+ [hatmarked]
+ [marked]
+ [\c!right=\delimitedrighthatuc]
+
+\definemathdelimited
+ [checkmarked]
+ [marked]
+ [\c!right=\delimitedrightcheckuc]
+
+\definemathdelimited
+ [brevemarked]
+ [marked]
+ [\c!right=\delimitedrightbreveuc]
+
+\definemathdelimited
+ [dotmarked]
+ [marked]
+ [\c!right=\delimitedrightdotuc]
+
+\definemathdelimited
+ [ringmarked]
+ [marked]
+ [\c!right=\delimitedrightringuc]
+
+\definemathdelimited
+ [tildemarked]
+ [marked]
+ [\c!right=\delimitedrighttildeuc]
+
+\definemathdelimited
+ [dddotmarked]
+ [marked]
+ [\c!right=\delimitedrightdddotuc]
+
+% The following ones are
+% not really belonging here,
+% but convenient
+
+\definemathdelimited
+ [daggermarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightdaggeruc]
+
+\definemathdelimited
+ [ddaggermarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightddaggeruc]
+
+\definemathdelimited
+ [astmarked]
+ [\c!size=1,
+ \c!right=\delimitedrightastuc]
+
+\definemathdelimited
+ [starmarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightstaruc]
+
+% More contextual
+
+\definemathdelimited
+ [fourier]
+ [\c!topoffset=.2\exheight,
+ \c!right=\delimitedrighthatuc]
+
+\definemathdelimited
+ [inversefourier]
+ [fourier]
+ [\c!right=\delimitedrightcheckuc]
+
+\definemathdelimited
+ [fuzzyfourier]
+ [fourier]
+ [\c!right=\delimitedrighttildeuc]
+
+% \definemathdelimited
+% [bannuity]
+% [%topoffset=.2\exheight,
+% \c!strut=no,
+% \c!rightmargin=.05\emwidth,
+% \c!right=\delimitedrightanutityuc]
+
+% $ \autofences \fourier{(z+\frac12)} + \courier{(z+\frac12)} + \xourier{(z+\frac12)} $
+
+\definemathdelimited [primed] [\c!right="2032,\c!size=1,\c!topoffset=.2\exheight]
+\definemathdelimited [doubleprimed] [primed] [\c!right="2033]
+\definemathdelimited [tripleprimed] [primed] [\c!right="2034]
+\definemathdelimited [quadrupleprimed] [primed] [\c!right="2057]
+\definemathdelimited [reverseprimed] [primed] [\c!right="2035]
+\definemathdelimited [doublereverseprimed] [primed] [\c!right="2036]
+\definemathdelimited [triplereverseprimed] [primed] [\c!right="2037]
+
+%
+
+\integerdef\delimitedleftuppercorner \privatecharactercode{delimited left upper corner}
+\integerdef\delimitedrightuppercorner\privatecharactercode{delimited right upper corner}
+\integerdef\delimitedleftlowercorner \privatecharactercode{delimited left lower corner}
+\integerdef\delimitedrightlowercorner\privatecharactercode{delimited right lower corner}
+
+\definemathdelimited
+ [leftuppermarked]
+ [marked]
+ [\c!left=\delimitedleftuppercorner]
+
+\definemathdelimited
+ [rightuppermarked]
+ [marked]
+ [\c!right=\delimitedrightuppercorner]
+
+\definemathdelimited
+ [uppermarked]
+ [marked]
+ [\c!left=\delimitedleftuppercorner,
+ \c!right=\delimitedrightuppercorner]
+
+\definemathdelimited
+ [leftlowermarked]
+ [marked]
+ [\c!left=\delimitedleftlowercorner]
+
+\definemathdelimited
+ [rightlowermarked]
+ [marked]
+ [\c!right=\delimitedrightlowercorner]
+
+\definemathdelimited
+ [lowermarked]
+ [marked]
+ [\c!left=\delimitedleftlowercorner,
+ \c!right=\delimitedrightlowercorner]
+
+\protect \endinput