summaryrefslogtreecommitdiff
path: root/tex/context/base
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-01-19 15:05:19 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-01-19 15:05:19 +0100
commit35a569ef13b42755e7469cf93d3e4982e12252d6 (patch)
tree3560ae2eea74dccb3122b9d8c52de8b49629a97a /tex/context/base
parent84591a31c39887dbf582df5d535f1de1a115fd62 (diff)
downloadcontext-35a569ef13b42755e7469cf93d3e4982e12252d6.tar.gz
2018-01-19 13:51:00
Diffstat (limited to 'tex/context/base')
-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/mkii/mult-ro.mkii1
-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/data-crl.lua2
-rw-r--r--tex/context/base/mkiv/enco-ini.mkiv4
-rw-r--r--tex/context/base/mkiv/math-ali.mkiv78
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv86
-rw-r--r--tex/context/base/mkiv/mtx-context-meaning.tex18
-rw-r--r--tex/context/base/mkiv/mult-def.lua4
-rw-r--r--tex/context/base/mkiv/mult-sys.mkiv2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin25581 -> 25545 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin250148 -> 250920 bytes
-rw-r--r--tex/context/base/mkiv/tabl-ntb.mkiv13
-rw-r--r--tex/context/base/mkiv/tabl-tbl.mkiv12
16 files changed, 203 insertions, 25 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 2ca1104be..fe034a5fc 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{2018.01.17 13:06}
+\newcontextversion{2018.01.19 13:42}
%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 5e3c46a5f..0704eecb1 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{2018.01.17 13:06}
+\edef\contextversion{2018.01.19 13:42}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-ro.mkii b/tex/context/base/mkii/mult-ro.mkii
index 7862b2d30..ad4e4f214 100644
--- a/tex/context/base/mkii/mult-ro.mkii
+++ b/tex/context/base/mkii/mult-ro.mkii
@@ -1162,6 +1162,7 @@
\setinterfaceconstant{sidespacebefore}{spatiulateralinainte}
\setinterfaceconstant{sidethreshold}{sidethreshold}
\setinterfaceconstant{sign}{semn}
+\setinterfaceconstant{simplecommand}{simplecommand}
\setinterfaceconstant{size}{dimensiune}
\setinterfaceconstant{slantedfeatures}{slantedfeatures}
\setinterfaceconstant{slantedfont}{slantedfont}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 431e378c8..1242ca657 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.01.17 13:06}
+\newcontextversion{2018.01.19 13:42}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index cac8be0c6..ca15299f4 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -41,7 +41,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.01.17 13:06}
+\edef\contextversion{2018.01.19 13:42}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/data-crl.lua b/tex/context/base/mkiv/data-crl.lua
index ec517fba3..dec9972f1 100644
--- a/tex/context/base/mkiv/data-crl.lua
+++ b/tex/context/base/mkiv/data-crl.lua
@@ -26,7 +26,7 @@ local runner = sandbox.registerrunner {
name = "curl resolver",
method = "execute",
program = "curl",
- template = "--silent -- insecure --create-dirs --output %cachename% %original%",
+ template = "--silent --insecure --create-dirs --output %cachename% %original%",
checkers = {
cachename = "cache",
original = "url",
diff --git a/tex/context/base/mkiv/enco-ini.mkiv b/tex/context/base/mkiv/enco-ini.mkiv
index f1428e7c2..f78643975 100644
--- a/tex/context/base/mkiv/enco-ini.mkiv
+++ b/tex/context/base/mkiv/enco-ini.mkiv
@@ -537,6 +537,10 @@
\hbox\bgroup
\enco_periods_nop}
+%D Was missing:
+
+\unexpanded\def\ampersand{\mathortext\mathampersand\textampersand}
+
%D Left-overs:
\appendtoks
diff --git a/tex/context/base/mkiv/math-ali.mkiv b/tex/context/base/mkiv/math-ali.mkiv
index 4de35723b..083fb7645 100644
--- a/tex/context/base/mkiv/math-ali.mkiv
+++ b/tex/context/base/mkiv/math-ali.mkiv
@@ -1138,6 +1138,84 @@
%D
%D \typebuffer % does not run well: \getbuffer
+%D Handy for the \type {m-matrix} module:
+
+\unexpanded\def\startnamedmatrix
+ {\dodoubleempty\math_matrix_start_named}
+
+\def\math_matrix_start_named[#1][#2]%
+ {\begingroup
+ \edef\currentmathmatrix{#1}%
+ \ifsecondargument
+ \setupcurrentmathmatrix[#2]%
+ \fi
+ \math_matrix_start\currentmathmatrix}
+
+\def\stopnamedmatrix
+ {\math_matrix_stop
+ \endgroup}
+
+%D The following code is derived from Aditya's simplematrix prototype but
+%D adapted to regular mathmatrices (which saves some code so it can go into
+%D the core):
+
+\def\math_matrix_simple_row#1%
+ {\rawprocesscommalist[#1]\math_matrix_simple_col
+ \toksapp\scratchtoks{\NR}}
+
+\def\math_matrix_simple_col#1%
+ {\toksapp\scratchtoks{\NC#1}}
+
+\unexpanded\def\math_matrix_simple[#1][#2]#3%
+ {\begingroup
+ \edef\currentmathmatrix{#1}%
+ \ifsecondargument
+ \setupcurrentmathmatrix[#2]%
+ \fi
+ \scratchtoks\emptytoks
+ \processlist[];\math_matrix_simple_row[#3]%
+ \math_matrix_start\currentmathmatrix
+ \the\scratchtoks
+ \math_matrix_stop
+ \endgroup}
+
+%D We hook it into the normal mathmatrix code:
+
+\appendtoks
+ \edef\p_simplecommand{\mathmatrixparameter\c!simplecommand}%
+ \ifx\p_simplecommand\empty\else
+ \setuevalue{\p_simplecommand}{\dodoubleempty\math_matrix_simple[\currentmathmatrix]}%
+ \fi
+\to \everydefinemathmatrix
+
+%D And predefine some matrices:
+
+\definemathmatrix[matrix:parentheses][\c!left={\left(\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right)},\c!align=\v!middle]
+\definemathmatrix[matrix:brackets] [\c!left={\left[\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right]},\c!align=\v!middle]
+\definemathmatrix[matrix:bars] [\c!left={\left|\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right|},\c!align=\v!middle]
+
+\definemathmatrix[thematrix][matrix:parentheses][\c!simplecommand=thematrix]
+
+%D \startbuffer
+%D \startformula
+%D \thematrix{1,2,3,4;5,6,7,8;9,10,11,12}
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \startformula
+%D \startthematrix
+%D \NC 1\NC 2\NC 3\NC 4\NR
+%D \NC 5\NC 6\NC 7\NC 8\NR
+%D \NC 9\NC10\NC11\NC12\NR
+%D \stopthematrix
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
%D \macros
%D {startintertext}
%D
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index e4c02b6c2..d815e587d 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -939,6 +939,75 @@
\activatemathcharacter\underscoreasciicode
\activatemathcharacter\ampersandasciicode
+\appendtoks
+ \edef\p_ampersand{\mathematicsparameter\s!ampersand}%
+ \ifx\p_ampersand\v!normal
+ \let\specialmathaligntab\normalmathaligntab
+ \else
+ \let\specialmathaligntab\mathampersand
+ \fi
+\to \everysetupmathematics
+
+%D A simplified version of this code is:
+%D
+%D \starttyping
+%D \catcode"26=12
+%D
+%D \bgroup
+%D \global\mathcode"26="8000
+%D
+%D \catcode"26=4
+%D
+%D \xdef\normalmathaligntab{&}
+%D
+%D \catcode"26=13
+%D
+%D \global\everymath{\def&{\normalmathaligntab}}
+%D \egroup
+%D \stoptyping
+%D
+%D The following works okay:
+%D
+%D \starttyping
+%D A & B
+%D \stoptyping
+%D
+%D As does:
+%D
+%D \starttyping
+%D $A \Umathchar"2"0"26 B$
+%D \stoptyping
+%D
+%D But the next code:
+%D
+%D \starttyping
+%D $A \char"26 B$
+%D \stoptyping
+%D
+%D fails with: \type{Misplaced alignment tab character &} and here is the
+%D reason.
+%D
+%D When we have a letter or other category a check happens for an active
+%D character and when it has one then it gets expanded and fed back into the
+%D scanner (sort of).
+%D
+%D A \type {\char} is also fed back as raw character and again when it's letter
+%D of other goes through the same process.
+%D
+%D This means that we cannot have a definition like:
+%D
+%D \starttyping
+%D \def\AND{\char"26\relax}
+%D \stoptyping
+%D
+%D that can be used in math mode, which is why the cweb macros do:
+%D
+%D \starttyping
+%D \def\AND{\def\AND{\mathchar"2026\relax}\AND}
+%D \stoptyping
+%D
+%D Maybe we need an option to treat chars like chars.
+
% \activatemathcharacter\primeasciicode
% not used:
@@ -1056,22 +1125,33 @@
%
% \egroup
+% $\char26$ gives an error because it expands to an active character that
+% then becomes an & which is then seen as an alignment character; anyway,
+% even when we switch like this the diufferen tmeaning only happens when
+% we're in math mode which can be delayed till we're in a cell
+
\bgroup
\catcode\underscoreasciicode\activecatcode
\catcode\circumflexasciicode\activecatcode
\catcode\ampersandasciicode \activecatcode
+ \glet\specialmathaligntab\normalmathaligntab
+
\unexpanded\gdef\obeymathcatcodes
{\let _\normalsubscript
\let ^\normalsuperscript
- \let &\normalmathaligntab}
+ \def &\specialmathaligntab
+ }
\doglobal \appendtoks
\let _\normalsubscript
\let ^\normalsuperscript
- \let &\normalmathaligntab % use \def when it's \aligntab
- \to \everymathematics
+ \let &\specialmathaligntab
+ \to \everymathematics
+
+ % \unexpanded\gdef\normalmathampersands
+ % {\let\specialmathaligntab\mathampersand}
\egroup
diff --git a/tex/context/base/mkiv/mtx-context-meaning.tex b/tex/context/base/mkiv/mtx-context-meaning.tex
index c65ec7f46..88b81ef04 100644
--- a/tex/context/base/mkiv/mtx-context-meaning.tex
+++ b/tex/context/base/mkiv/mtx-context-meaning.tex
@@ -21,7 +21,8 @@
% context --extra=meaning setuplayout
% context --extra=meaning setup_layout
% context --extra=meaning --once --noconsole --nostatistics setuplayout
-% mtxrun --silent --script context --extra=meaning --once --noconsole --nostatistics setuplayout
+% mtxrun --silent --script context --extra=meaning --once --noconsole --nostatistics setuplayout
+% mtxrun --script interface --meaning setuplayout
%
% end help
@@ -39,22 +40,21 @@
\starttext
+\usemodule[setups-macros]
+
\startluacode
local h = tex.hashtokens()
local function showmeaning(str)
- local s = string.gsub(str,"^\\","")
- local p = "^" .. string.topattern(s) .. "$"
+ local h = interfaces.macros.collect(str)
context("pattern: ")
- context.type(s)
+ context.type(str)
context.blank()
for i=1,#h do
local hi = h[i]
- if string.find(h[i],p) then
- context.type(hi)
- context.par()
- context.showmeaning(hi)
- end
+ context.type(hi)
+ context.par()
+ context.showmeaning(hi)
end
context.page()
end
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index 0cb60487d..59c2ed605 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -11107,6 +11107,10 @@ return {
["pe"]="رنگ‌عنوان",
["ro"]="culoaretitlu",
},
+ ["simplecommand"]={
+ ["en"]="simplecommand",
+ ["nl"]="simpelcommando",
+ },
["titlecommand"]={
["cs"]="titlecommand",
["de"]="titlecommand",
diff --git a/tex/context/base/mkiv/mult-sys.mkiv b/tex/context/base/mkiv/mult-sys.mkiv
index ead318b71..03e1856ee 100644
--- a/tex/context/base/mkiv/mult-sys.mkiv
+++ b/tex/context/base/mkiv/mult-sys.mkiv
@@ -363,6 +363,8 @@
\definesystemconstant {kernpairs}
\definesystemconstant {mixedcolumn}
+\definesystemconstant {ampersand}
+
%definesystemconstant {property}
%definesystemconstant {overprint}
%definesystemconstant {layer}
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 9091299a5..39922f868 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 5715fe76e..b7a223056 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/tabl-ntb.mkiv b/tex/context/base/mkiv/tabl-ntb.mkiv
index 62bdec0e8..b74694c02 100644
--- a/tex/context/base/mkiv/tabl-ntb.mkiv
+++ b/tex/context/base/mkiv/tabl-ntb.mkiv
@@ -383,7 +383,12 @@
\newif\iftightTBLrowspan \tightTBLrowspantrue
\newif\iftightTBLcolspan \tightTBLcolspanfalse
-\newif\iftraceTABLE \traceTABLEfalse
+\newconditional \c_tabl_ntb_trace_widths
+
+\installtextracker
+ {tables.natural.widths}
+ {\settrue \c_tabl_ntb_trace_widths}
+ {\setfalse\c_tabl_ntb_trace_widths}
% so far
@@ -1684,7 +1689,7 @@
\def\tabl_ntb_check_widths_two{\tabl_ntb_check_widths_indeed\plusone } % 1 = real run
\def\tabl_ntb_check_widths_indeed#1%
- {\iftraceTABLE\tabl_ntb_show_widths B#1\fi
+ {\ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths B#1\fi
\!!counta\zerocount
\!!dimena\dimexpr
\hsize
@@ -1717,7 +1722,7 @@
\fi
\fi
\fi}%
- \iftraceTABLE\tabl_ntb_show_widths M#1\fi
+ \ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths M#1\fi
\ifcase\!!counta \else \divide\!!dimena \!!counta \fi
\dorecurse\c_tabl_ntb_maximum_col
{\scratchdimen\tabl_ntb_get_wid\recurselevel\relax
@@ -1730,7 +1735,7 @@
\tabl_ntb_set_wid\recurselevel{\the\!!dimena}%
\fi
\fi}%
- \iftraceTABLE\tabl_ntb_show_widths E#1\fi}
+ \ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths E#1\fi}
\def\tabl_ntb_check_heights_one_indeed
{\!!countb\tabl_ntb_get_row\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three\relax
diff --git a/tex/context/base/mkiv/tabl-tbl.mkiv b/tex/context/base/mkiv/tabl-tbl.mkiv
index f80df82d7..7a0d2c8a8 100644
--- a/tex/context/base/mkiv/tabl-tbl.mkiv
+++ b/tex/context/base/mkiv/tabl-tbl.mkiv
@@ -227,7 +227,6 @@
\let \m_tabl_tabulate_separator_factor \empty % fraction
-\newif \iftracetabulate % will become a tracker
\newtoks \everytabulatepar % where used ?
\newtoks \everytabulate % public ?
@@ -308,11 +307,16 @@
\kern-\linewidth
\tabl_tabulate_break_no}
+\installtextracker
+ {tables.tabulate.breaks}
+ {\let\tabl_tabulate_break_no_tracer\tabl_tabulate_nobreak_inject_tracer}
+ {\let\tabl_tabulate_break_no_tracer\donothing}
+
+\let\tabl_tabulate_break_no_tracer\donothing
+
\def\tabl_tabulate_nobreak_inject_indeed
{\tabl_tabulate_break_no
- \iftracetabulate
- \tabl_tabulate_nobreak_inject_tracer
- \fi}
+ \tabl_tabulate_break_no_tracer}
\def\tabl_tabulate_nobreak_inject
{\tabulatenoalign{\tabl_tabulate_nobreak_inject_indeed}}