summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/math-tex.tex
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2008-06-12 10:42:53 +0000
committerTaco Hoekwater <taco@elvenkind.com>2008-06-12 10:42:53 +0000
commit0d01365d53c456d246da0ca1f0b3cd9868f02b35 (patch)
tree01a655c8028e17cfb371456b299c1848fe08c05b /Master/texmf-dist/tex/context/base/math-tex.tex
parent44f3714442da07fdfc36a7f2a8dcd5d4294c5d26 (diff)
ConTeXt release 2008.05.21
git-svn-id: svn://tug.org/texlive/trunk@8691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/math-tex.tex')
-rw-r--r--Master/texmf-dist/tex/context/base/math-tex.tex106
1 files changed, 99 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/context/base/math-tex.tex b/Master/texmf-dist/tex/context/base/math-tex.tex
index 6cd834ab402..752f113b71c 100644
--- a/Master/texmf-dist/tex/context/base/math-tex.tex
+++ b/Master/texmf-dist/tex/context/base/math-tex.tex
@@ -2,7 +2,7 @@
%D [ file=math-tex,
%D version=2001.04.12,
%D subtitle=Plain Specials,
-%D author={Hans Hagen \& Taco Hoekwater},
+%D author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan},
%D date=\currentdate,
%D copyright=\PRAGMA]
%C
@@ -10,6 +10,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% beware: in mkiv we will do it differently
+
\unprotect
\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000
@@ -24,6 +26,46 @@
\definefamilysynonym [default] [ucgreek] [mr]
\definefamilysynonym [default] [vargreek] [mi]
+
+%D \macros
+%D {\setupmathematics}
+%D
+%D Configuration for integrals. (If needed we can speed this up and make it
+%D installable; no processaction is needed then).
+
+\chardef\intlimitcode\zerocount % 0 nolimits 1 displaylimits 2 limits
+
+\def\intlimits
+ {\ifcase\intlimitcode \nolimits \or \displaylimits \or \limits \fi}
+
+\def\setupmathematics
+ {\dosingleargument\dosetupmathematics}
+
+\def\dosetupmathematics[#1]%
+ {\getparameters[\??mo][#1]
+ \processaction[\@@mointegral]
+ [ nolimits=>\chardef\intlimitcode\zerocount,
+ displaylimits=>\chardef\intlimitcode\plusone,
+ limits=>\chardef\intlimitcode\plustwo]}
+
+%D \startbuffer
+%D $\int_a^b f(x) dx$ and also
+%D $\iint_a^b f(x,y) dxdy$, $\iiint_a^b f(x,y) dxdy$,
+%D $\iiiint_a^b f(x) dx$
+%D \startformula
+%D \int_a^b f(x) dx \quad
+%D \iint_a^b f(x) dx \quad
+%D \iiint_a^b f(x) dx \quad
+%D \iiiint_a^b f(x) dx \quad
+%D \stopformula
+%D \stopbuffer
+%D
+%D Default: \getbuffer
+%D
+%D Displaylimits: \setupmathematics[integral=displaylimits] \getbuffer
+%D
+%D Limits: \setupmathematics[integral=limits] \getbuffer
+
\startmathcollection [default]
\definemathsymbol [alpha] [nothing] [lcgreek] ["0B]
@@ -319,8 +361,8 @@
\startmathcollection[default]
\definemathcommand [lnot] {\neg}
-\definemathcommand [int] {\intop\nolimits}
-\definemathcommand [oint] {\ointop\nolimits}
+\definemathcommand [int] {\intop \intlimits}
+\definemathcommand [oint] {\ointop\intlimits}
\definemathcommand [land] {\wedge}
\definemathcommand [lor] {\vee}
\definemathcommand [neq] {\not=}
@@ -444,19 +486,31 @@
\definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["7F]
\definemathsymbol [Updownarrow] [rel] [sy] ["6D] [ex] ["77]
\definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["0F]
-\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B]
\definemathsymbol [langle] [open] [sy] ["68] [ex] ["0A]
-\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09]
+\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B]
\definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["08]
-\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07]
+\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09]
\definemathsymbol [lceil] [open] [sy] ["64] [ex] ["06]
-\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05]
+\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07]
\definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["04]
+\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05]
\definemathsymbol [sqrt] [radical] [sy] ["70] [ex] ["70]
\stopmathcollection
+%D By request:
+
+\startmathcollection[default]
+
+\definemathsymbol [lvert] [open] [sy] ["6A] [ex] ["0C]
+\definemathsymbol [rvert] [close] [sy] ["6A] [ex] ["0C]
+
+\definemathsymbol [lVert] [open] [sy] ["6B] [ex] ["0D]
+\definemathsymbol [rVert] [close] [sy] ["6B] [ex] ["0D]
+
+\stopmathcollection
+
%D For brooks:
%D
%D \starttyping
@@ -624,4 +678,42 @@
\definemathcommand [colonsim] [rel] {\coloncolon\colonsep\sim}
\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep}
+%D More integrals (AM):
+
+\def\dointkern{\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}}
+
+\definemathcommand [iint] {\repeatintegral\plusone }
+\definemathcommand [iiint] {\repeatintegral\plustwo }
+\definemathcommand [iiiint] {\repeatintegral\plusthree}
+
+\def\repeatintegral#1%
+ {\scratchtoks\emptytoks
+ \let\dointlimits\donothing
+ \let\dodointlimits\intlimits
+ \dorecurse{#1}{\appendtoks \intop \dointkern \to \scratchtoks}
+ \appendtoks \intop \dointlimits \dodointlimits \to \scratchtoks
+ \edef\dodorepeatintegral{\the\scratchtoks}%
+ \futurelet\next\dorepeatintegral}
+
+%D If the \type{\limits} option is used after \type{\iint}, use
+%D \type{\mathop} and fudge the left hand space a bit to make the
+%D subscript visually centered.
+
+\def\dorepeatintegral
+ {\ifx\next\limits \dointlimitcorrection \else
+ \ifx\next\displaylimits \dointlimitcorrection \else
+ \ifx\next\nolimits \donothing \else
+ \ifcase\intlimitcode\else \dointlimitcorrection \fi\fi\fi\fi
+ \dodorepeatintegral}
+
+\def\dointlimitcorrection
+ {\mkern-7mu\mathchoice{\mkern-2mu}{}{}{}%
+ \mathop\bgroup
+ \mkern7mu\mathchoice{\mkern2mu}{}{}{}%
+ \let\dointlimits\egroup}
+
+
+\setupmathematics
+ [integral=nolimits]
+
\protect \endinput