 %D \module
%D   [       file=math-ini,
%D        version=2022.07.24,
%D          title=\CONTEXT\ Math Macros,
%D       subtitle=Extensions aka Tweaks,
%D         author={Hans Hagen \& Mikael Sundqvist},
%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 / Tweaks}

%D This file deals with some ommisions in \UNICODE\ (at least we flag them as such).
%D Some of the definitione done elsewhere will be moved here.

\unprotect

% Mathematics - Hollie + Metropole Orkest (conducted by Jules Buckley) .. more than minusses

% \startbuffer
% \startTEXpage[offset=2dk]\showmakeup[mathglue]\mathspacingmode1 % \tracingmath3\tracingonline2
% $ a + -    1 $ \quad
% $     -    2 $ \quad
% $     \um  3 $ \quad
% $ a + \um  4 $ \par
% $     \ump 3 $ \quad
% $ a + \ump 4 $ \quad
% $     \up  5 $ \par
% $ a - \up  6 $ \quad
% $     \upm 5 $ \quad
% $ a - \upm 6 $ \quad
% \par
% $\textstyle         - + \um \up \upm \ump $ \quad
% $\scriptstyle       - + \um \up \upm \ump $ \quad
% $\scriptscriptstyle - + \um \up \upm \ump $ \quad
% \stopTEXpage
% \stopbuffer
%
% \setupbodyfont[bonum]   \getbuffer
% \setupbodyfont[pagella] \getbuffer

\permanent\Umathchardef \unaryminus     \mathunarycode \zerocount \privatecharactercode{unary minus}
\permanent\Umathchardef \unaryplus      \mathunarycode \zerocount \privatecharactercode{unary plus}
\permanent\Umathchardef \unaryplusminus \mathunarycode \zerocount \privatecharactercode{unary plus minus}
\permanent\Umathchardef \unaryminusplus \mathunarycode \zerocount \privatecharactercode{unary minus plus}

\permanent\protected\def\um {\mathortext\unaryminus    \textminus}
\permanent\protected\def\up {\mathortext\unaryplus     \textplus}
\permanent\protected\def\upm{\mathortext\unaryplusminus\textpm}
\permanent\protected\def\ump{\mathortext\unaryminusplus\textmp}

\permanent\protected\def\una#1{\mathatom \s!class \mathunarycode   {#1}}
\permanent\protected\def\bin#1{\mathatom \s!class \mathbinarycode  {#1}}
\permanent\protected\def\rel#1{\mathatom \s!class \mathrelationcode{#1}}
\permanent\protected\def\ord#1{\mathatom \s!class \mathordinarycode{#1}}

% $x + \+1$\par
% $x + \-1$\par

\permanent\Umathchardef\mathunaryplus     \mathunarycode\zerocount"002B % these will go to char-def.lua
\permanent\Umathchardef\mathunaryminus    \mathunarycode\zerocount"2212 % these will go to char-def.lua
\permanent\Umathchardef\mathunaryplusminus\mathunarycode\zerocount"00B1 % these will go to char-def.lua
\permanent\Umathchardef\mathunaryminusplus\mathunarycode\zerocount"2213 % these will go to char-def.lua

\permanent\protected\def\+{\mathortext\mathunaryplus     \textplus             }
%permanent\protected\def\-{\mathortext\mathunaryminus    \textminus            }
\permanent\protected\def\-{\mathortext\mathunaryminus    \explicitdiscretionary}
\permanent\protected\def\±{\mathortext\mathunaryplusminus\textpm}
\permanent\protected\def\∓{\mathortext\mathunaryminusplus\textmp}

\permanent\chardef\textminute"2032
\permanent\chardef\textsecond"2033

% \startsetups[math:rules]
%     \letmathfractionparameter\c!rule\v!symbol
%     \setmathfractionparameter\c!middle{"203E}%
%     \letmathradicalparameter \c!rule\v!symbol
%     \setmathradicalparameter \c!top{\radicalbarextenderuc}%
%     \setmathfenceparameter   \c!alternative{1}%
% \stopsetups

\protect
