summaryrefslogtreecommitdiff
path: root/tex/context/base/math-ini.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-05-14 15:26:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-05-14 15:26:00 +0200
commit60239bee8781bf85829bc6d9a159ebc630657960 (patch)
treef8e68eb840d1403c676d18f0af9f3c92c589904f /tex/context/base/math-ini.mkiv
parentb34cc94e16a5baacd0201e20f190ec224c00f952 (diff)
downloadcontext-60239bee8781bf85829bc6d9a159ebc630657960.tar.gz
beta 2010.05.14 15:26
Diffstat (limited to 'tex/context/base/math-ini.mkiv')
-rw-r--r--tex/context/base/math-ini.mkiv27
1 files changed, 27 insertions, 0 deletions
diff --git a/tex/context/base/math-ini.mkiv b/tex/context/base/math-ini.mkiv
index c8518dc3a..bda849ed6 100644
--- a/tex/context/base/math-ini.mkiv
+++ b/tex/context/base/math-ini.mkiv
@@ -350,15 +350,18 @@
\ifdefined\normalsuber\else \def\normalsuber{_} \fi
\ifdefined\normalsuper\else \def\normalsuper{^} \fi
+\ifdefined\normalaltab\else \def\normalaltab{&} \fi
\bgroup
\catcode`_=\active
\catcode`^=\active
+ \catcode`&=\active
\global \everynonknuthmode {\appendtoks
\let_\normalsuber
\let^\normalsuper
+ \let&\normalaltab
\to \everymathematics}
\egroup
@@ -366,19 +369,23 @@
\appendtoks
\mathcode`_="8000
\mathcode`^="8000
+ \mathcode`&="8000
\catcode`_=\@@other
\catcode`^=\@@other
+ \catcode`&=\@@other
\to \everynonknuthmode
\appendtoks
\catcode`_=\@@subscript
\catcode`^=\@@superscript
+ \catcode`&=\@@alignment
\to \everydonknuthmode
\appendtoks
\startextendcatcodetable\ctxcatcodes
\catcode`_=\@@other
\catcode`^=\@@other
+ \catcode`&=\@@other
\stopextendcatcodetable
\to \everynonknuthmode
@@ -386,6 +393,7 @@
\startextendcatcodetable\ctxcatcodes
\catcode`_=\@@subscript
\catcode`^=\@@superscript
+ \catcode`&=\@@alignment
\stopextendcatcodetable
\to \everydonknuthmode
@@ -559,6 +567,19 @@
\crampedscriptscriptstyle \fi % 6 -> 7
#1}}
+\def\mathstylefont#1% #1 is number (\normalmathstyle)
+ {\ifcase#1\relax
+ \textfont \or
+ \textfont \or
+ \textfont \or
+ \textfont \or
+ \scriptfont \or
+ \scriptfont \or
+ \scriptscriptfont \or
+ \scriptscriptfont \else
+ \textfont
+ \fi\zerocount}
+
%D Something similar can be used in the (re|)|definition
%D of \type {\text}. This version is a variation on the one
%D in the math module (see \type{m-math} and|/|or \type
@@ -578,6 +599,12 @@
%{\hbox{\everymath{#1}\switchtobodyfont [#2]#3}} % 15 sec
{\hbox{\everymath{#1}\setcurrentfontbody{#2}#3}} % 3 sec (no math)
+%D Safeguard against redefinitions:
+
+\appendtoks
+ \let\_\normalunderscore % is textunderscore or fakeunderscore
+\to \everymathematics
+
%D Because we may overload \type {\text} in other (structuring)
%D macros, we say: