summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkxl4
-rw-r--r--tex/context/base/mkiv/data-tex.lua15
-rw-r--r--tex/context/base/mkiv/math-ini.mkxl40
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin29127 -> 29134 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin267806 -> 267808 bytes
-rw-r--r--tex/context/base/mkiv/supp-mat.mkxl180
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
11 files changed, 231 insertions, 18 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index d6a945518..111230de1 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2020.11.03 16:50}
+\newcontextversion{2020.11.04 09:28}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 7646f3f3e..fdf330ae9 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.11.03 16:50}
+\edef\contextversion{2020.11.04 09:28}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 1baddfe32..f70c3d2b3 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2020.11.03 16:50}
+\newcontextversion{2020.11.04 09:28}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 63d4b8bde..d40603575 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.11.03 16:50}
+\edef\contextversion{2020.11.04 09:28}
%D Kind of special:
diff --git a/tex/context/base/mkiv/context.mkxl b/tex/context/base/mkiv/context.mkxl
index c89e37ade..aeb546250 100644
--- a/tex/context/base/mkiv/context.mkxl
+++ b/tex/context/base/mkiv/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2020.11.03 16:50}
+\edef\contextversion{2020.11.04 09:28}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
@@ -185,7 +185,7 @@
\loadmkxlfile{supp-box}
\loadmarkfile{supp-ran}
-\loadmarkfile{supp-mat}
+\loadmkxlfile{supp-mat}
\loadmarkfile{core-uti}
\loadmkvifile{file-job}
diff --git a/tex/context/base/mkiv/data-tex.lua b/tex/context/base/mkiv/data-tex.lua
index e4795d09d..2e8642cdd 100644
--- a/tex/context/base/mkiv/data-tex.lua
+++ b/tex/context/base/mkiv/data-tex.lua
@@ -143,8 +143,9 @@ local function textopener(tag,filename,filehandle,coding)
lines[noflines] = nil
end
pushinputname(filename)
- local currentline, noflines = 0, noflines
- local t = {
+ local currentline = 0
+ local noflines = noflines
+ local handler = {
filename = filename,
noflines = noflines,
-- currentline = 0,
@@ -153,10 +154,11 @@ local function textopener(tag,filename,filehandle,coding)
if trace_locating then
report_tex("%a closer: %a closed",tag,filename)
end
- t = nil
+ handler = nil
+ lines = nil
end,
reader = function(self)
- self = self or t
+ self = self or handler
-- local currentline, noflines = self.currentline, self.noflines
if currentline >= noflines then
return nil
@@ -164,6 +166,7 @@ local function textopener(tag,filename,filehandle,coding)
currentline = currentline + 1
-- self.currentline = currentline
local content = lines[currentline]
+-- lines[currentline] = nil
if content == "" then
return ""
-- elseif content == ctrl_d or ctrl_z then
@@ -181,14 +184,14 @@ local function textopener(tag,filename,filehandle,coding)
end
end
}
- setmetatableindex(t,function(t,k)
+ setmetatableindex(handler,function(t,k)
if k == "currentline" then
return currentline
else
-- no such key
end
end)
- return t
+ return handler
end
helpers.settextopener(textopener) -- can only be done once
diff --git a/tex/context/base/mkiv/math-ini.mkxl b/tex/context/base/mkiv/math-ini.mkxl
index 6e6018896..d6d9ff4f0 100644
--- a/tex/context/base/mkiv/math-ini.mkxl
+++ b/tex/context/base/mkiv/math-ini.mkxl
@@ -244,8 +244,14 @@
% Now we redefine \type {\mathematics} and \type {\m}:
-\permanent\protected\def\mathematics
- {\doifelsenextoptionalcs\math_m_yes\math_m_nop}
+\pushoverloadmode
+
+ \permanent\protected\def\mathematics{\doifelsenextoptionalcs\math_m_yes\math_m_nop}
+
+ \aliased\let\m \mathematics % we keep the simple versions
+ \aliased\let\math\mathematics % we keep the simple versions
+
+\popoverloadmode
\def\math_m_yes
{\relax
@@ -307,9 +313,6 @@
\normalstopimath
\fi}
-\let\m \mathematics
-\let\math\mathematics
-
% e.g.: \definemathematics[i:mp][setups=i:tight,openup=yes]
\newmuskip\defaultthickmuskip \defaultthickmuskip 5mu plus 5mu
@@ -1971,6 +1974,33 @@
{#1\scriptstyle {#2}}%
{#1\scriptscriptstyle{#2}}}
+%D \macros
+%D {cramedllap, crampedrlap, crampedclap}
+%D
+%D In many cases, one wants to use the \tex {clap} macro in math mode while using
+%D subscripts. Normally, subscripts are in cramped mode, and these macros allow you
+%D to go to cramped mode. For example:
+%D
+%D \startbuffer
+%D \startformula
+%D \sum_{a^2 < b^2 < c^2} \quad
+%D \sum_{\clap{a^2 < b^2 < c^2}} \quad
+%D \sum_{\crampedclap{a^2 < b^2 < c^2}}
+%D \stopformula
+%D \stopbuffer
+%D
+%D \start
+%D \typebuffer
+%D \switchtobodyfont[24pt]
+%D \getbuffer
+%D \stop
+%D
+%D This used to be in \type {supp-math.mkxl}:
+
+\permanent\protected\def\crampedllap#1{\llap{\cramped#1}}
+\permanent\protected\def\crampedrlap#1{\rlap{\cramped#1}}
+\permanent\protected\def\crampedclap#1{\clap{\cramped#1}}
+
%D Often we can use:
%D
%D \startbuffer
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index c8b80ef36..4fa535e4f 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 9ec23f869..2bbbcb551 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/supp-mat.mkxl b/tex/context/base/mkiv/supp-mat.mkxl
new file mode 100644
index 000000000..7e0086fc8
--- /dev/null
+++ b/tex/context/base/mkiv/supp-mat.mkxl
@@ -0,0 +1,180 @@
+%D \module
+%D [ file=supp-mat,
+%D version=1998.09.10,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=Math,
+%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.
+
+%D For practical reasons, I decided to move some math things to a support module.
+%D There is nothing spectacular here. It may move back to math-ini.
+
+\writestatus{loading}{ConTeXt Support Macros / Math}
+
+\unprotect
+
+%D \macros
+%D {mathematics, math, nomathematics, startmathmode}
+%D
+%D The \type {$} can be both an begin and end math character. This can lead to
+%D confusing and errorprone situations when macros insert \type {$}. When for
+%D instance we have defined:
+%D
+%D \starttyping
+%D \def\MyPlus{$\,+\,$}
+%D \stoptyping
+%D
+%D the sequence \type{$x^2 \MyPlus y^2 = r^2$} will expand to:
+%D
+%D \starttyping
+%D $x^2 $\,+\,$ y^2 = r^2$
+%D \stoptyping
+%D
+%D Here the \type {\,} are given outside math mode and \TEX\ will definitely
+%D complain about this. A more save definition would have been:
+%D
+%D \starttyping
+%D \def\MyPlus{\mathematics{\,+\,}}
+%D \stoptyping
+%D
+%D Which is implemented (in \type{syst-ini.mkiv}) as:
+
+\permanent\protected\def\Ucheckedstartdisplaymath
+ {\ifinner
+ \ifhmode
+ \normalUstartmath
+ \let\Ucheckedstopdisplaymath\normalUstopmath
+ \else
+ \normalUstartdisplaymath
+ \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
+ \fi
+ \else
+ \normalUstartdisplaymath
+ \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
+ \fi}
+
+\aliased\let\Ucheckedstopdisplaymath\relax
+
+\def\normalmathaligntab{&} % \let\normalmathaligntab\aligntab does to work well in a let to & (a def works ok)
+
+% \let\normalsuper\Usuperscript % obsolete
+% \let\normalsuber\Usubscript % obsolete
+
+\aliased\let\startimath\Ustartmath
+\aliased\let\stopimath \Ustopmath
+\aliased\let\startdmath\Ustartdisplaymath % \Ucheckedstartdisplaymath
+\aliased\let\stopdmath \Ustopdisplaymath % \Ucheckedstopdisplaymath
+
+\permanent\protected\def\mathematics#1{\relax \ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
+\permanent\protected\def\displaymath#1{\noindent \ifmmode#1\else\normalstartdmath#1\normalstopdmath\fi}
+\permanent\protected\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
+\permanent\protected\def\textmath #1{\dontleavehmode\ifmmode#1\else\begingroup\everymath\emptytoks\normalstartimath#1\normalstopimath\endgroup\fi} % \mathsurround\zeropoint
+
+\aliased\let\stopmathmode\relax
+
+\permanent\protected\def\startmathmode % nested variant
+ {\relax\ifmmode
+ \begingroup
+ \enforced\let\stopmathmode\endgroup
+ \else
+ \normalstartimath
+ \enforced\let\stopmathmode\normalstopimath
+ \fi}
+
+\permanent\protected\def\nomathematics#1%
+ {\relax\ifmmode\hbox{#1}\else#1\fi}
+
+\aliased\let\m \mathematics % \mathematics will be overloaded later
+\aliased\let\math\mathematics % \mathematics will be overloaded later
+
+%D \macros
+%D {displaymathematics,inlinemathematics,automathematics}
+%D
+%D An example of usage of the following can be found in the MathML module:
+
+\ifdefined\strc_formulas_start_formula \else
+ \def\strc_formulas_start_formula{\normalstartdmath}
+ \def\strc_formulas_stop_formula {\normalstopdmath }
+\fi
+
+\permanent\protected\def\displaymathematics#1{\relax\ifmmode#1\else\strc_formulas_start_formula{}#1\strc_formulas_stop_formula\fi}
+\permanent\protected\def\inlinemathematics {\dontleavehmode\mathematics}
+%permanent\protected\def\automathematics {\relax\ifhmode\expandafter\inlinemathematics\else\expandafter\displaymathematics\fi}
+
+% better, esp when used in bTABLE ... eTABLE
+
+\permanent\protected\def\automathematics
+ {\relax
+ \ifhmode
+ \expandafter\inlinemathematics
+ \orelse\ifintable
+ \doubleexpandafter\inlinemathematics
+ \else
+ \doubleexpandafter\displaymathematics
+ \fi}
+
+%D \macros
+%D {dimension, nodimension}
+%D
+%D The next few macros are used for typesetting dimensions in such a way that
+%D spacing is acceptable. I won't spend much words on these macros, because they
+%D will be overloaded in the units module.
+%D
+%D REPLACED (keep commented):
+
+\newsignal\dimensionsignal
+
+\def\dimensiontypeface {\tf}
+\def\dimensionhalfspace {\,}
+
+\protected\def\dimension#1%
+ {\pushmacro\dodimensionsignal
+ \gdef\dodimensionsignal{\kern\dimensionsignal}%
+ \ifzeropt\lastskip
+ \ifzeropt\lastkern
+ \ifmmode
+ \mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
+ \else
+ \mathematics{\dimensiontypeface#1}%
+ \fi
+ \orelse\ifdim\lastkern=\dimensionsignal
+ \mathematics{\dimensionhalfspace\dimensiontypeface#1}%
+ \else
+ \unkern\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
+ \fi
+ \else
+ \unskip\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
+ \fi
+ \dodimensionsignal
+ \popmacro\dodimensionsignal}
+
+\protected\def\nodimension#1%
+ {\unskip#1\glet\dodimensionsignal\relax}
+
+% experiment, not yet to be used
+
+% \protected\def\displaybreak
+% {\ifhmode
+% \removeunwantedspaces
+% \ifcase\raggedstatus\hfill\fi
+% \strut\penalty-9999 % \break fails on case (3)
+% \fi}
+%
+% \def\startdisplay{\displaybreak\ignorespaces\startpacked}
+% \def\stopdisplay {\stoppacked\displaybreak\ignorespaces}
+
+\aliased\let\superscript \Usuperscript
+\aliased\let\subscript \Usubscript
+\aliased\let\nosuperscript \Unosuperscript
+\aliased\let\nosubscript \Unosubscript
+\aliased\let\superprescript \Usuperprescript
+\aliased\let\subprescript \Usubprescript
+\aliased\let\nosuperprescript\Unosuperprescript
+\aliased\let\nosubsprecript \Unosubprescript
+
+\protect \endinput
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 1f41d1b43..43d59d1dc 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 2020-11-03 16:50
+-- merge date : 2020-11-04 09:28
do -- begin closure to overcome local limits and interference