summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/context-version.pdfbin4172 -> 4182 bytes
-rw-r--r--tex/context/base/mkiv/chem-str.lua22
-rw-r--r--tex/context/base/mkiv/chem-str.mkiv8
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua2
-rw-r--r--tex/context/base/mkiv/colo-run.mkiv110
-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/font-run.mkiv308
-rw-r--r--tex/context/base/mkiv/lpdf-ano.lua207
-rw-r--r--tex/context/base/mkiv/lpdf-ini.lua6
-rw-r--r--tex/context/base/mkiv/math-del.mkiv51
-rw-r--r--tex/context/base/mkiv/math-fen.mkiv11
-rw-r--r--tex/context/base/mkiv/mult-fun.lua1
-rw-r--r--tex/context/base/mkiv/mult-low.lua2
-rw-r--r--tex/context/base/mkiv/pack-bck.mkvi2
-rw-r--r--tex/context/base/mkiv/pack-rul.mkiv2
-rw-r--r--tex/context/base/mkiv/page-mix.mkiv3
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin8952 -> 8951 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin266570 -> 260654 bytes
-rw-r--r--tex/context/base/mkiv/strc-ref.lua10
-rw-r--r--tex/context/base/mkiv/symb-run.mkiv12
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv1
-rw-r--r--tex/context/base/mkiv/trac-vis.lua10
-rw-r--r--tex/context/base/mkiv/type-ini.mkvi4
-rw-r--r--tex/context/base/mkiv/type-run.mkiv51
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
26 files changed, 430 insertions, 399 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index a9f2b51a4..de7e9a195 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/chem-str.lua b/tex/context/base/mkiv/chem-str.lua
index d724394bb..e90464ad2 100644
--- a/tex/context/base/mkiv/chem-str.lua
+++ b/tex/context/base/mkiv/chem-str.lua
@@ -234,6 +234,7 @@ local syntax = {
space = { direct = 'chem_symbol("\\chemicalsymbol[space]");' },
plus = { direct = 'chem_symbol("\\chemicalsymbol[plus]");' },
minus = { direct = 'chem_symbol("\\chemicalsymbol[minus]");' },
+ equals = { direct = 'chem_symbol("\\chemicalsymbol[equals]");' },
gives = { direct = formatters['chem_symbol("\\chemicalsymbol[gives]{%s}{%s}");'], arguments = 2 },
equilibrium = { direct = formatters['chem_symbol("\\chemicalsymbol[equilibrium]{%s}{%s}");'], arguments = 2 },
mesomeric = { direct = formatters['chem_symbol("\\chemicalsymbol[mesomeric]{%s}{%s}");'], arguments = 2 },
@@ -846,17 +847,22 @@ implement {
}
-- todo: top / bottom
--- maybe add "=" for double and "≡" for triple?
+-- note that "<->" here differs from ppchtex
local inline = {
- ["single"] = "\\chemicalsinglebond", ["-"] = "\\chemicalsinglebond",
- ["double"] = "\\chemicaldoublebond", ["--"] = "\\chemicaldoublebond",
- ["triple"] = "\\chemicaltriplebond", ["---"] = "\\chemicaltriplebond",
- ["gives"] = "\\chemicalgives", ["->"] = "\\chemicalgives",
- ["equilibrium"] = "\\chemicalequilibrium", ["<->"] = "\\chemicalequilibrium",
- ["mesomeric"] = "\\chemicalmesomeric", ["<>"] = "\\chemicalmesomeric",
- ["plus"] = "\\chemicalplus", ["+"] = "\\chemicalplus",
+ ["single"] = "\\chemicalsinglebond", ["-"] = "\\chemicalsinglebond",
+ ["double"] = "\\chemicaldoublebond", ["--"] = "\\chemicaldoublebond",
+ ["="] = "\\chemicaldoublebond",
+ ["triple"] = "\\chemicaltriplebond", ["---"] = "\\chemicaltriplebond",
+ ["≡"] = "\\chemicaltriplebond",
+ ["gives"] = "\\chemicalgives", ["->"] = "\\chemicalgives",
+ ["equilibrium"] = "\\chemicalequilibrium", ["<-->"] = "\\chemicalequilibrium",
+ ["<=>"] = "\\chemicalequilibrium",
+ ["mesomeric"] = "\\chemicalmesomeric", ["<>"] = "\\chemicalmesomeric",
+ ["<->"] = "\\chemicalmesomeric",
+ ["plus"] = "\\chemicalplus", ["+"] = "\\chemicalplus",
["minus"] = "\\chemicalminus",
+ ["equals"] = "\\chemicalequals",
["space"] = "\\chemicalspace",
}
diff --git a/tex/context/base/mkiv/chem-str.mkiv b/tex/context/base/mkiv/chem-str.mkiv
index 0bebcf5c8..a0b0a9327 100644
--- a/tex/context/base/mkiv/chem-str.mkiv
+++ b/tex/context/base/mkiv/chem-str.mkiv
@@ -431,8 +431,8 @@
\unexpanded\def\chemicaloxidationplus {\dotriplegroupempty\chemicaloxidation{\textplus }} % {} needed!
\unexpanded\def\chemicaloxidationminus{\dotriplegroupempty\chemicaloxidation{\textminus}} % {} needed!
-\unexpanded\def\chemicalforeveropen {\dotriplegroupempty\chemicalleft {\normalstartimath\big[\normalstopimath}} % {} needed!
-\unexpanded\def\chemicalforeverclose {\dotriplegroupempty\chemicalright {\normalstartimath\big]\normalstopimath}} % {} needed!
+\unexpanded\def\chemicalforeveropen {\dotriplegroupempty\chemicalleft {$\big[$}} % {} needed!
+\unexpanded\def\chemicalforeverclose {\dotriplegroupempty\chemicalright {$\big]$}} % {} needed!
\unexpanded\def\chemicaloxidationone {\chemicaloxidation\relax1}
\unexpanded\def\chemicaloxidationtwo {\chemicaloxidation\relax2}
\unexpanded\def\chemicaloxidationthree{\chemicaloxidation\relax3}
@@ -545,6 +545,7 @@
\definechemicalsymbol[i:space] [\enspace\quad\enspace]
\definechemicalsymbol[i:plus] [\enspace\mathematics{+}\enspace]
\definechemicalsymbol[i:minus] [\enspace\mathematics{-}\enspace]
+\definechemicalsymbol[i:equals] [\enspace\mathematics{=}\enspace]
\definechemicalsymbol[i:gives] [\enspace\mathematics{\xrightarrow{}{}}\enspace]
\definechemicalsymbol[i:equilibrium] [\enspace\mathematics{\xrightoverleftarrow{}{}}\enspace]
\definechemicalsymbol[i:mesomeric] [\enspace\mathematics{\xleftrightarrow{}{}}\enspace]
@@ -560,6 +561,7 @@
\unexpanded\def\chemicalequilibrium{\chemicalsymbol[i:equilibrium]}
\unexpanded\def\chemicalplus {\chemicalsymbol[i:plus]}
\unexpanded\def\chemicalminus {\chemicalsymbol[i:minus]}
+\unexpanded\def\chemicalequals {\chemicalsymbol[i:equals]}
\unexpanded\def\chemicalspace {\chemicalsymbol[i:space]}
\unexpanded\def\chemicalinline #1{#1}
@@ -610,6 +612,7 @@
\definechemicalsymbol[d:space] [\enspace\quad\enspace]
\definechemicalsymbol[d:plus] [\enspace+\enspace]
\definechemicalsymbol[d:minus] [\enspace-\enspace]
+\definechemicalsymbol[d:equals] [\enspace=\enspace]
\definechemicalsymbol[d:gives] [\rightarrowfill] % \chem_arrow_construct\xrightarrow
\definechemicalsymbol[d:equilibrium] [\rightoverleftarrowfill] % \chem_arrow_construct\xrightoverleftarrow
\definechemicalsymbol[d:mesomeric] [\leftarrowfill] % \chem_arrow_construct\xleftrightarrow
@@ -622,6 +625,7 @@
\definechemicalsymbol[d:SPACE] [{\chemicalsymbol[d:space]}]
\definechemicalsymbol[d:PLUS] [{\chemicalsymbol[d:plus]}]
\definechemicalsymbol[d:MINUS] [{\chemicalsymbol[d:minus]}]
+\definechemicalsymbol[d:EQUALS] [{\chemicalsymbol[d:equals]}]
\definechemicalsymbol[d:GIVES] [{\chemicalsymbol[d:gives]}]
\definechemicalsymbol[d:EQUILIBRIUM] [{\chemicalsymbol[d:equilibrium]}]
\definechemicalsymbol[d:MESOMERIC] [{\chemicalsymbol[d:mesomeric]}]
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index b988e867b..4da01e8e1 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -1640,7 +1640,7 @@ setmetatable(delayed, { __index = indexer, __call = caller } )
local nested = { } context.nested = nested -- creates strings
-local function indexer(parent,k)
+local function indexer(parent,k) -- not ok when traced
local f = function(...)
local t, savedflush, n = { }, flush, 0
flush = function(c,f,s,...) -- catcodes are ignored
diff --git a/tex/context/base/mkiv/colo-run.mkiv b/tex/context/base/mkiv/colo-run.mkiv
index 16f54c3b5..1b8b87c75 100644
--- a/tex/context/base/mkiv/colo-run.mkiv
+++ b/tex/context/base/mkiv/colo-run.mkiv
@@ -58,13 +58,16 @@
\setuppalet[#1]
\tabskip\zeropoint
\def\colo_palets_show_palet##1%
- {\doifelseinset\v!number{#2}{##1\hskip.5em}{}&
- \color[##1]{\vrule\s!width3em\s!height\strutht\s!depth\strutdp}%
- \graycolor[##1]{\vrule\s!width3em\s!height\strutht\s!depth\strutdp}&
- \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr}
+ {\doifelseinset\v!number{#2}{##1\hskip.5\emwidth}{}%
+ \aligntab
+ \color [##1]{\vrule\s!width3\emwidth\s!height\strutht\s!depth\strutdp}%
+ \graycolor[##1]{\vrule\s!width3\emwidth\s!height\strutht\s!depth\strutdp}%
+ \aligntab
+ \doifinset\v!value{#2}{\hskip.5\emwidth\colorvalue{##1}}%
+ \crcr}
\halign
- {\hss##&\hss##\hss&##\cr
- &\doifinset\v!name{#2}{\strut#1}&\cr%
+ {\hss\alignmark\alignmark\aligntab\hss\alignmark\alignmark\hss\aligntab\alignmark\alignmark\cr
+ \aligntab\doifinset\v!name{#2}{\strut#1}\aligntab\cr
\colo_palets_process[#1]\colo_palets_show_palet\crcr}}}
\gdef\colo_palets_show_horizontal[#1][#2]% todo: bTABLE etc
@@ -75,34 +78,36 @@
\offinterlineskip
\setuppalet[#1]
\tabskip\zeropoint
- \!!widtha\zeropoint
+ \scratchwidth\zeropoint
\doifinset\v!number{#2}
{\def\colo_palets_show_palet##1%
- {\setbox0\hbox{##1}%
- \ifdim\!!widtha<\wd0\!!widtha\wd0\fi}%
+ {\setbox\scratchbox\hbox{##1}%
+ \ifdim\scratchwidth<\wd\scratchbox
+ \scratchwidth\wd\scratchbox
+ \fi}%
\colo_palets_process[#1]\colo_palets_show_palet}%
- \advance\!!widtha 1em
- \ifdim\!!widtha<5em
- \!!widtha5em
+ \advance\scratchwidth\emwidth
+ \ifdim\scratchwidth<5\emwidth
+ \scratchwidth5\emwidth
\fi
\halign
- {##&&\hbox to \!!widtha{\hss##\hss}\cr
+ {\alignmark\alignmark\aligntab\aligntab\hbox to \scratchwidth{\hss\alignmark\alignmark\hss}\cr
\doifinset\v!number{#2}
- {\def\colo_palets_show_palet##1{&\strut##1}%
+ {\def\colo_palets_show_palet##1{\aligntab\strut##1}%
\colo_palets_process[#1]\colo_palets_show_palet}\cr
- \doifinset\v!name{#2}{#1\hskip.5em}%
+ \doifinset\v!name{#2}{#1\hskip.5\emwidth}%
\def\colo_palets_show_palet##1%
- {&\strut\color[##1]{\vrule\s!width\!!widtha\s!height\strutht\s!depth\zeropoint}}%
+ {\aligntab\strut\color[##1]{\vrule\s!width\scratchwidth\s!height\strutht\s!depth\zeropoint}}%
\colo_palets_process[#1]\colo_palets_show_palet\crcr
\noalign{\vskip-\strutdepth}%
\def\colo_palets_show_palet##1%
- {&\graycolor[##1]{\vrule\s!width\!!widtha\s!height\zeropoint\s!depth\strutdp}}%
+ {\aligntab\graycolor[##1]{\vrule\s!width\scratchwidth\s!height\zeropoint\s!depth\strutdp}}%
\colo_palets_process[#1]\colo_palets_show_palet\crcr
\doifinset\v!value{#2}
{\def\colo_palets_show_palet##1%
- {&\vbox
- {\hsize\!!widtha
- \vskip.25ex
+ {\aligntab\vbox
+ {\hsize\scratchwidth
+ \vskip.25\exheight
\everypar{\strut}
\veryraggedcenter
\let\colorformatseparator\endgraf
@@ -132,8 +137,8 @@
\offinterlineskip
\setuppalet[#2]
\getcommacommandsize[\getvalue{\??colorpalet#2}]
- \!!widtha2em\relax
- \hsize\commalistsize\!!widtha
+ \scratchwidth2\emwidth\relax
+ \hsize\commalistsize\scratchwidth
\def\colo_palets_compare##1%
{\hbox
{\setbox0\hbox
@@ -142,8 +147,8 @@
\box0
\hbox to \hsize
{\def\colo_palets_compare####1%
- {\hbox to \!!widtha
- {\hss#1[####1]{\vrule\s!width.5\!!widtha\s!height2.25ex\s!depth-.75ex}\hss}}%
+ {\hbox to \scratchwidth
+ {\hss#1[####1]{\vrule\s!width.5\scratchwidth\s!height2.25\exheight\s!depth-.75\exheight}\hss}}%
\processcommacommand[\getvalue{\??colorpalet#2}]\colo_palets_compare}}
\endgraf}
\processcommacommand[\getvalue{\??colorpalet#2}]\colo_palets_compare}}
@@ -155,7 +160,10 @@
\gdef\colo_groups_show[#1][#2]%
{\doifcolor{#1:1}
- {\doifelseinset\v!vertical{#2} \colo_groups_show_vertical \colo_groups_show_horizontal [#1][#2]}}
+ {\doifelseinset\v!vertical{#2}
+ \colo_groups_show_vertical
+ \colo_groups_show_horizontal
+ [#1][#2]}}
\gdef\colo_groups_show_horizontal[#1][#2]%
{\vbox
@@ -169,18 +177,18 @@
\def\colo_groups_show_group##1%
{\doifcolor{#1:##1}{\vbox
{\halign
- {\hss####\hss\cr
+ {\hss\alignmark\alignmark\alignmark\alignmark\hss\cr
\doifinset\v!number{#2}{\strut##1}\cr
- \color[#1:##1]{\vrule\s!width4em\s!height\strutht\s!depth\zeropoint}\cr
- \graycolor[#1:##1]{\vrule\s!width4em\s!height\zeropoint\s!depth\strutdp}\cr
+ \color [#1:##1]{\vrule\s!width4\emwidth\s!height\strutht \s!depth\zeropoint}\cr
+ \graycolor[#1:##1]{\vrule\s!width4\emwidth\s!height\zeropoint\s!depth\strutdp }\cr
\doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}}}}%
\hbox
{\doifinset\v!name{#2}
{\strut
\doifelseinset\v!value{#2}
- {\raise3\lineheight\hbox{#1\hskip.5em}}
+ {\raise3\lineheight\hbox{#1\hskip.5\emwidth}}
{#1}%
- \hskip.5em}%
+ \hskip.5\emwidth}%
\colo_groups_show_group1\colo_groups_show_group2\colo_groups_show_group3\colo_groups_show_group4%
\colo_groups_show_group5\colo_groups_show_group6\colo_groups_show_group7\colo_groups_show_group8}}}
@@ -194,13 +202,17 @@
\tabskip\zeropoint
\def\colo_groups_show_group##1%
{\doifcolor{#1:##1}
- {\doifinset\v!number{#2}{##1\hskip.5em}&
- \color[#1:##1]{\vrule\s!width2.5em\s!height\strutht\s!depth\strutdp}%
- \graycolor[#1:##1]{\vrule\s!width2.5em\s!height\strutht\s!depth\strutdp}&
- \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}%
+ {\doifinset\v!number{#2}
+ {##1\hskip.5\emwidth}%
+ \aligntab
+ \color [#1:##1]{\vrule\s!width2.5\emwidth\s!height\strutht\s!depth\strutdp}%
+ \graycolor[#1:##1]{\vrule\s!width2.5\emwidth\s!height\strutht\s!depth\strutdp}
+ \aligntab
+ \doifinset\v!value{#2}{\hskip.5\emwidth\colorvalue{#1:##1}}%
+ \crcr}}%
\halign
- {\hss##&\hss##\hss&##\hss\cr
- &\doifinset\v!name{#2}{\strut#1}&\crcr
+ {\hss\alignmark\alignmark\aligntab\hss\alignmark\alignmark\hss\aligntab\alignmark\alignmark\hss\cr
+ \aligntab\doifinset\v!name{#2}{\strut#1}\aligntab\crcr
\colo_groups_show_group1\colo_groups_show_group2\colo_groups_show_group3\colo_groups_show_group4%
\colo_groups_show_group5\colo_groups_show_group6\colo_groups_show_group7\colo_groups_show_group8}}}
@@ -210,8 +222,7 @@
\gdef\colo_groups_compare[#1]%
{\doifcolor{#1:1}
{\hbox
- {\colo_groups_compare_indeed\color[#1]%
- \quad
+ {\colo_groups_compare_indeed\color [#1]\quad
\colo_groups_compare_indeed\graycolor[#1]}}}
\gdef\colo_groups_compare_indeed#1[#2]%
@@ -219,20 +230,23 @@
{\forgetall
\setlocalhsize
\hsize\localhsize
- \!!counta\zerocount
- \dorecurse{15}{\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}}
- \!!widtha2em\relax
- \hsize\!!counta\!!widtha
- \dorecurse\!!counta{\colo_groups_compare_step{#1}{#2}\recurselevel}}}
+ \scratchcounter\zerocount
+ \dorecurse{15}{\doifcolor{#2:\recurselevel}{\advance\scratchcounter\plusone}}
+ \scratchwidth2\emwidth\relax
+ \hsize\scratchcounter\scratchwidth
+ \dorecurse\scratchcounter{\colo_groups_compare_step{#1}{#2}\recurselevel}}}
\def\colo_groups_compare_step#1#2#3%
{\hbox to \hsize
- {\setbox0\hbox
- {#1[#2:#3]{\vrule\s!width\hsize\s!height3ex}}%
- \wd0\zeropoint
- \box0
+ {\setbox\scratchbox\hbox
+ {#1[#2:#3]{\vrule\s!width\hsize\s!height3\exheight}}%
+ \wd\scratchbox\zeropoint
+ \box\scratchbox
\hbox to \hsize
- {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\vrule\s!width.5\!!widtha\s!height2.25ex\s!depth-.75ex}\hss}}}
+ {\hss
+ \dorecurse\scratchcounter
+ {#1[#2:\recurselevel]{\vrule\s!width.5\scratchwidth\s!height2.25\exheight\s!depth-.75\exheight}%
+ \hss}}}
\endgraf}
\protect \endinput
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index c3398f101..dea0e124d 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{2016.02.20 14:55}
+\newcontextversion{2016.02.22 19:54}
%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 a69210b70..92bb70e08 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -39,7 +39,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2016.02.20 14:55}
+\edef\contextversion{2016.02.22 19:54}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-run.mkiv b/tex/context/base/mkiv/font-run.mkiv
index 9a69b480f..e9a6f9ddb 100644
--- a/tex/context/base/mkiv/font-run.mkiv
+++ b/tex/context/base/mkiv/font-run.mkiv
@@ -13,14 +13,14 @@
%C details.
%D [This code is hooked into the core macros and saves some format
-%D space. It needs a cleanup.]
+%D space. It needs a cleanup as it's real old derioved \MKII\ code]
\unprotect
-\gdef\@@onlyenglish#1%
+\gdef\font_show_only_english#1%
{\blank{\tttf \type {#1} is only available in the english interface}\blank}
-\gdef\dosetshowfonttitle#1%
+\gdef\font_show_title#1%
{\tabskip\zeropoint
\parindent\zeropoint
\setlocalhsize
@@ -32,12 +32,12 @@
{\edef\title{[\fontclass]\space\title}}}}
\unexpanded\gdef\showbodyfont
- {\dosingleempty\doshowbodyfont}
+ {\dosingleempty\font_show_bodyfont}
-\gdef\doshowbodyfont[#1]%
+\gdef\font_show_bodyfont[#1]%
{\ifinsidefloat\else\startbaselinecorrection\fi
\vbox
- {\dosetshowfonttitle{#1}%
+ {\font_show_title{#1}%
\def\bigstrut##1##2%
{\hbox{\vrule
\s!height##1\strutht
@@ -61,7 +61,7 @@
\tabskip=\zeropoint\cr
\noalign{\hrule}
&\multispan{29}{\vrule\hfil\tttf\strut\title\hfil
- \llap{\string\mr\hbox to 1em{\hss:\hss}\normalstartimath\mr\languageparameter\c!text\normalstopimath\quad}\vrule}\cr
+ \llap{\string\mr\hpack to \emwidth{\hss:\hss}\normalstartimath\mr\languageparameter\c!text\normalstopimath\quad}\vrule}\cr
\noalign{\hrule}\next{}{\tt\string}{}
\noalign{\hrule}\next{\tt\string\rm}\rm{\languageparameter\c!text}
\noalign{\hrule}\next{\tt\string\ss}\ss{\languageparameter\c!text}
@@ -70,12 +70,12 @@
\ifinsidefloat\else\stopbaselinecorrection\fi}
\unexpanded\gdef\showbodyfontenvironment
- {\dosingleempty\doshowbodyfontenvironment}
+ {\dosingleempty\font_show_bodyfont_environment}
-\gdef\doshowbodyfontenvironment[#1]%
+\gdef\font_show_bodyfont_environment[#1]%
{\ifinsidefloat\else\startbaselinecorrection\fi
\vbox
- {\dosetshowfonttitle{#1}%
+ {\font_show_title{#1}%
\def\next##1%
{&&\bodyfontsizevariable{##1}\s!text
&&\bodyfontsizevariable{##1}\s!script
@@ -105,133 +105,151 @@
\ifinsidefloat\else\stopbaselinecorrection\fi}
\unexpanded\gdef\showfont
- {\dodoubleempty\doshowfont}
+ {\dodoubleempty\font_show_font}
-\gdef\doshowfont[#1][#2]%
+\gdef\font_show_font[#1][#2]% doing this in lua is much faster
{\bgroup
\iffirstargument
\definefont[\s!dummy][#1]\dummy
\fi
\doifelsenothing{#2}
- {\dodoshowfont{#1}{0}}
+ {\font_show_font_indeed{#1}\zerocount}
{\doifelse{#2}\v!all
- {\dostepwiserecurse{0}{255}{1}
- {\donefalse
- \let\charplane\recurselevel
- \dostepwiserecurse{0}{255}{1}
- {\iffontchar\font\numexpr\charplane*256+\recurselevel\relax
- \donetrue
+ {\dostepwiserecurse\zerocount{255}\plusone
+ {\scratchcounterone \recurselevel
+ \scratchcountertwo \numexpr\scratchcounterone*256\relax
+ \scratchcounterthree\numexpr\scratchcountertwo+255\relax
+ \doloop
+ {\iffontchar\font\scratchcountertwo
+ \font_show_font_indeed{#1}\scratchcounterone
\exitloop
- \fi}%
- \ifdone
- \dodoshowfont{#1}\charplane
- \fi}}
- {\processcommalist[#2]{\dodoshowfont{#1}}}}%
+ \else\ifnum\scratchcountertwo=\scratchcounterthree
+ \exitloop
+ \else
+ \advance\scratchcountertwo\plusone
+ \fi\fi}}}
+ {\processcommalist[#2]{\font_show_font_indeed{#1}}}}%
\egroup}
-\gdef\dodoshowfont#1#2%
+\gdef\font_show_font_indeed#1#2% made some 50% faster but still slow
{\bgroup
- \edef\charplane{\number#2}%
\iffirstargument
-% \definefont[\s!dummy][#1]\dummy
- \else\ifdim2.5em>.05\hsize \tx
- \ifdim2.5em>.05\hsize \txx
+ % \definefont[\s!dummy][#1]\dummy
+ \else\ifdim2.5\emwidth>.05\hsize \tx
+ \ifdim2.5\emwidth>.05\hsize \txx
\fi\fi\fi
\ifinsidefloat\else\startbaselinecorrection\fi
\vbox\bgroup
+ \scratchdimenone 2.5\emwidth
+ \scratchdimentwo 2.4\emwidth
+ \scratchdimenthree2.3\emwidth
+ \edef\charplane{\number#2}%
\forgetall
\startoverlay % easier in cld
{\vbox
- {\tf \setstrut \dummy
+ {\tf
+ \setstrut
+ \dummy
\offinterlineskip
- \dostepwiserecurse{0}{15}{1}
- {\let\row\recurselevel
- \hbox
- {\red
- \dostepwiserecurse{0}{15}{1}
- {\let\col\recurselevel
- \@EA\scratchcounter\string"\hexnumber\row\hexnumber\col\relax
- \edef\rowcol{\the\scratchcounter}%
- \iffontchar\font\scratchcounter
- \setbox\scratchbox\ruledhbox{\black\char\numexpr\charplane*256+\scratchcounter\relax}%
- \ifdim\wd\scratchbox>\zeropoint
- \donetrue \else \donefalse
- \fi
+ \unexpanded\def\wrapbox##1%
+ {\vpack to \scratchdimenone
+ {\vss
+ \hpack to \scratchdimenone
+ {\dummy
+ \ifdim\interwordspace=\zeropoint
+ \setbox##1\hpack
+ {\raise.5\dp##1\hpack
+ {\lower.5\ht##1\copy##1}}%
+ \ht##1\zeropoint
+ \dp##1\zeropoint
\else
- \setbox\scratchbox\hbox{\gray\vrule\s!width1ex\s!height.5ex\s!depth.5ex}%
+ \ht##1\strutht
+ \dp##1\strutdp
+ \strut
\fi
- \startoverlay
- {\tf\vbox to 2.5em
- {\vss
- \hbox to 2.5em
- {\dummy\ifdim\interwordspace=\zeropoint
- \setbox\scratchbox\hbox
- {\raise.5\dp\scratchbox\hbox
- {\lower.5\ht\scratchbox\copy\scratchbox}}%
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \else
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \strut
- \fi
- \hss\copy\scratchbox\hss}
- \vss}}
- {\tf\vbox to 2.3em
- {\ifdone
- \hsize2.4em
- \blue
- \tinyfont
- \hfill\number\rowcol
- \vfill
- \octnumber\rowcol\hfill\lchexnumbers\rowcol
- \par
- \fi}}
- \stopoverlay}}}
+ \hss\copy##1\hss}
+ \vss}}%
+ \unexpanded\def\textbox##1%
+ {\vpack to \scratchdimentwo
+ {\hsize\scratchdimenthree
+ ##1%
+ \par}}%
+ \unexpanded\def\scratchnum
+ {\blue
+ \tinyfont
+ \hfill
+ \number\scratchcounter
+ \vfill
+ \octnumber\scratchcounter
+ \hfill
+ \lchexnumbers\scratchcounter}%
+ \setbox\scratchboxone\hpack{\tf\textbox{}}%
+ \setbox\scratchboxtwo\hpack{\tf\gray\vrule\s!width\exheight\s!height.5\exheight\s!depth.5\exheight}%
+ \setbox\scratchboxtwo\wrapbox\scratchboxtwo
+ \setbox\scratchboxthree\hpack
+ {\startoverlay
+ {\box\scratchboxtwo}
+ {\box\scratchboxone}
+ \stopoverlay}%
+ \dostepwiserecurse\zerocount{15}\plusone
+ {\scratchcounterone\recurselevel
+ \hpack
+ {\dostepwiserecurse\zerocount{15}\plusone
+ {\scratchcountertwo \recurselevel
+ \scratchcounter \numexpr\scratchcounterone*16+\scratchcountertwo\relax
+ \scratchcounterthree\numexpr\charplane*256+\scratchcounter\relax
+ \iffontchar\font\scratchcounterthree
+ \setbox\scratchbox\ruledhpack{\char\scratchcounterthree}%
+ \tf
+ \startoverlay
+ {\wrapbox\scratchbox}
+ {\textbox\scratchnum}
+ \stopoverlay
+ \else
+ \copy\scratchboxthree
+ \fi}}}%
\par}}
{\tf\basegrid[\c!nx=16,\c!ny=16,\c!dx=2.5,\c!dy=2.5,\c!unit=em]}
\stopoverlay
\nointerlineskip
- \vskip2pt
+ \vskip2\points
% the \noexpand before \blank is needed for non etex
- \edef\ascii{name: {\noexpand\black\fontname\font}}
- \def\do##1##2{\ifx##1\undefined\else\ifx##1\empty\else##2\fi\fi}%
\edef\theshowfontspecs{name: {\noexpand\black\fontname\font}\quad plane: \charplane\enspace"\hexnumber\charplane}%
\tf % also sets em
- \hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs}
+ \hbox to 40\emwidth{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs}
\egroup
\ifinsidefloat\else\stopbaselinecorrection\fi
\egroup}
% \showfontstyle[modern][rm][tf][all] % #2, #3 and #4 can be 'all'
-\unexpanded\gdef\showfontstyle {\dodoubleempty \dodoshowfontstyle}
-\unexpanded\gdef\redoshowfontstyle {\dotripleempty \dododoshowfontstyle}
-\unexpanded\gdef\redodoshowfontstyle{\doquadrupleempty\dodododoshowfontstyle}
+\unexpanded\gdef\showfontstyle {\dodoubleempty \font_show_style}
+\unexpanded\gdef\font_show_style_a{\dotripleempty \font_show_style_b}
+\unexpanded\gdef\font_show_style_c{\doquadrupleempty\font_show_style_d}
% no lists any more, so no 'all' any longer
-\gdef\dodoshowfontstyle[#1][#2]%
+\gdef\font_show_style[#1][#2]%
{\doifelsenothing{#2}
- {\redoshowfontstyle[#1][\s!rm,\s!ss,\s!tt,\s!mm]}
- {\redoshowfontstyle[#1][#2]}}
+ {\font_show_style_a[#1][\s!rm,\s!ss,\s!tt,\s!mm]}
+ {\font_show_style_a[#1][#2]}}
-\gdef\dododoshowfontstyle[#1][#2][#3]%
+\gdef\font_show_style_b[#1][#2][#3]%
{\doifelsenothing{#3}
- {\redodoshowfontstyle[#1][#2][\s!tf,\s!bf,\s!it,\s!sl,\s!bs,\s!bi]}
- {\redodoshowfontstyle[#1][#2][#3]}}
+ {\font_show_style_c[#1][#2][\s!tf,\s!bf,\s!it,\s!sl,\s!bs,\s!bi]}
+ {\font_show_style_c[#1][#2][#3]}}
-\gdef\dodododoshowfontstyle[#1][#2][#3][#4]%
- {\doshowfontstyleindeed[#1][#2][#3][#4]}
+\gdef\font_show_style_d[#1][#2][#3][#4]%
+ {\font_show_style_e[#1][#2][#3][#4]}
% so far
-\gdef\doshowfontstyleindeed[#1][#2][#3][#4]%
+\gdef\font_show_style_e[#1][#2][#3][#4]%
{\bgroup
\raggedright
\switchtobodyfont[#1]
\def\dododocommand##1%
- {\dostepwiserecurse{0}{255}{1}
+ {\dostepwiserecurse\zerocount{255}\plusone
{\scratchcounter\numexpr##1*256+\recurselevel\relax
\iffontchar\font\scratchcounter\relax
\char\scratchcounter
@@ -241,9 +259,9 @@
{\starttextrule{\tttf #1 ##1 ##2}
\nobreak\getvalue{##2}%
\doifelsenothing{#4}
- {\dododocommand{0}}
+ {\dododocommand\zerocount}
{\doifelse{#4}\v!all
- {\dostepwiserecurse{0}{255}{1}{\expanded{\dododocommand{\recurselevel}}}}
+ {\dostepwiserecurse\zerocount{255}\plusone{\expanded{\dododocommand{\recurselevel}}}}
{\processcommalist[#4]{\dododocommand}}}%
\par \nobreak
\stoptextrule}
@@ -256,89 +274,105 @@
\unexpanded\gdef\showligature#1%
{\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}}
-\unexpanded\gdef\showligatures[#1]%
+\unexpanded\gdef\showligatures[#1]% we keep it around for compatibility reasons
{\ifx\starttabulate\undefined
- \@@onlyenglish\showligatures
+ \font_show_only_english\showligatures
\else
\bgroup
- \def\show##1{\hbox{\red\ruledhbox{\black##1}}}%
- \definefont[\s!dummy][#1]\dummy
- \starttabulate[|*{9}{c|}]
- \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC
- \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR
- \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC
- \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR
+ \def\font_show_ligature##1{\hbox{\red\ruledhbox{\black##1}}}%
+ \definedfont[#1*default]%
+ %starttabulate[|*{9}{c|}]
+ \starttabulate[|*{7}{c|}]
+ \NC\type{ff}
+ \NC\type{fi}
+ \NC\type{fl}
+ \NC\type{ffi}
+ \NC\type{ffl}
+ %NC\type{``}
+ %NC\type{''}
+ \NC\type{--}
+ \NC\type{---}
+ \NC\NR
+ \NC\font_show_ligature{ff}
+ \NC\font_show_ligature{fi}
+ \NC\font_show_ligature{fl}
+ \NC\font_show_ligature{ffi}
+ \NC\font_show_ligature{ffl}
+ %NC\font_show_ligature{``}
+ %NC\font_show_ligature{''}
+ \NC\font_show_ligature{--}
+ \NC\font_show_ligature{---}
+ \NC\NR
\stoptabulate
\egroup
\fi}
\unexpanded\gdef\showfontstrip
- {\dosingleempty\doshowfontstrip}
+ {\dosingleempty\font_show_strip}
-\gdef\doshowfontstrip[#1]%
+\gdef\font_show_strip[#1]%
{\ifx\starttabulate\undefined
- \@@onlyenglish\showfontstrip
+ \font_show_only_english\showfontstrip
\else
\bgroup
- \def\dofontstripa##1##2%
+ \def\font_show_strip_a##1##2%
{\tttf\string##1}
- \def\dofontstripb##1##2%
+ \def\font_show_strip_b##1##2%
{\ruledhbox{\switchtobodyfont[#1]##1{##2}}}
- \def\dofontstripc##1##2%
+ \def\font_show_strip_c##1##2%
{\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
\tt\tfx\the\ht\scratchbox}%
- \def\dofontstripd##1##2%
+ \def\font_show_strip_d##1##2%
{\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
\tt\tfx\the\wd\scratchbox}%
- \def\fontstrip##1##2##3%
+ \def\font_show_strip_indeed##1##2##3%
{\NC##2\rm{##3}\NC
##2\ss{##3}\NC
##2\tt{##3}\NC
##2\mathematics{##3}\NC
\tttf##1\NR}
\starttabulate[|c|c|c|c|c|]
- \fontstrip\relax\dofontstripa\empty
+ \font_show_strip_indeed\relax\font_show_strip_a\empty
\TB
- \fontstrip\relax\dofontstripb{xxxx}
- \fontstrip\relax\dofontstripb{12345}
- \fontstrip\relax\dofontstripb{(Agw)}
+ \font_show_strip_indeed\relax\font_show_strip_b{xxxx}
+ \font_show_strip_indeed\relax\font_show_strip_b{12345}
+ \font_show_strip_indeed\relax\font_show_strip_b{(Agw)}
\TB
- \fontstrip{(x height)}\dofontstripc{x}
- \fontstrip{(m width)}\dofontstripd{m}
+ \font_show_strip_indeed{(x height)}\font_show_strip_c{x}
+ \font_show_strip_indeed{(m width)}\font_show_strip_d{m}
\stoptabulate
\egroup
\fi}
\ifdefined\databox \else \newbox\databox \fi
-\unexpanded\gdef\testminimalbaseline#1% to be used in a tabulate
+\unexpanded\gdef\testminimalbaseline#1% to be used in a 10 column tabulate
{\setbox\databox\ruledhbox{#1}%
- \scratchdimen\ht\databox
- \advance\scratchdimen\dp\databox
- \scratchtoks{#1}%
- \expanded
- {\NC \ruledhbox{\the\scratchtoks}
- \noexpand \NC ->
- \noexpand \NC \the\scratchdimen
- \noexpand \NC =
- \noexpand \NC \the\ht\databox
- \noexpand \NC +
- \noexpand \NC \the\dp\databox
- \noexpand \NC \ifdim\scratchdimen<\baselineskip <
- \else\ifdim\scratchdimen=\baselineskip =
- \else > \fi\fi
- \noexpand \NC \the\baselineskip
- \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok)
- \noexpand \NC \noexpand \NR }}
+ \scratchdimen\htdp\databox
+ \normalexpanded {
+ \NC \ruledhbox{#1}%
+ \NC ->
+ \NC \the\htdp\databox
+ \NC =
+ \NC \the\ht\databox
+ \NC +
+ \NC \the\dp\databox
+ \NC \ifdim\scratchdimen<\baselineskip <
+ \else\ifdim\scratchdimen=\baselineskip =
+ \else > \fi\fi
+ \NC \the\baselineskip
+ \NC (\ifdim\scratchdimen>\baselineskip not \fi ok)
+ \NC \NR}
+ }
\unexpanded\gdef\showminimalbaseline
{\ifx\starttabulate\undefined
- \@@onlyenglish\showminimalbaseline
+ \font_show_only_english\showminimalbaseline
\else
- \starttabulate[||T|T|T|T|T|T|T|T|T|]
- \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}%
- \testminimalbaseline{(/)}%
- \testminimalbaseline{\normalstartimath\frac{1}{2}x\normalsuperscript2\normalsubscript3\normalstopimath}
+ \starttabulate[|l|T|T|T|T|T|T|T|T|T|]
+ \testminimalbaseline{\hbox to \emwidth{\hss\showstruts\strut\hss}}%
+ \testminimalbaseline{(/)}%
+ \testminimalbaseline{\normalstartimath\frac{1}{2}x\normalsuperscript2\normalsubscript3\normalstopimath}
\stoptabulate
\fi}
diff --git a/tex/context/base/mkiv/lpdf-ano.lua b/tex/context/base/mkiv/lpdf-ano.lua
index 21bc1e076..f4f5f1a8e 100644
--- a/tex/context/base/mkiv/lpdf-ano.lua
+++ b/tex/context/base/mkiv/lpdf-ano.lua
@@ -153,10 +153,7 @@ end)
-- the caching is somewhat memory intense on the one hand but
-- it saves many small temporary tables so it might pay off
-local pagedestinations = allocate()
-local pagereferences = allocate() -- annots are cached themselves
-
-setmetatableindex(pagedestinations, function(t,k)
+local pagedestinations = setmetatableindex(function(t,k)
k = tonumber(k)
if not k or k <= 0 then
return pdfnull()
@@ -174,7 +171,7 @@ setmetatableindex(pagedestinations, function(t,k)
return v
end)
-setmetatableindex(pagereferences,function(t,k)
+local pagereferences = setmetatableindex(function(t,k)
k = tonumber(k)
if not k or k <= 0 then
return nil
@@ -191,9 +188,6 @@ setmetatableindex(pagereferences,function(t,k)
return v
end)
-lpdf.pagereferences = pagereferences -- table
-lpdf.pagedestinations = pagedestinations -- table
-
local defaultdestination = pdfarray { 0, pdf_fit }
-- fit is default (see lpdf-nod)
@@ -369,6 +363,7 @@ local destinationactions = {
-- [v_minheight] = function(r,w,h,d) return f_fitbv(r,(getvpos()+h)*factor) end, -- left coordinate, fit height of content in window
[v_minheight] = function(r,w,h,d) return f_fitbv(r,gethpos()*factor) end, -- left coordinate, fit height of content in window [v_fit] = f_fit, -- fit page in window
[v_tight] = f_fitb, -- fit content in window
+ -- new:
[v_fit] = f_fit,
}
@@ -387,10 +382,10 @@ local defaultview = v_fit
local defaultaction = destinationactions[defaultview]
-- A complication is that we need to use named destinations when we have views so we
--- end up with a mix. A previous versions just output multiple destinations but not
+-- end up with a mix. A previous versions just output multiple destinations but now
-- that we moved all to here we can be more sparse.
-local pagedestinations = table.setmetatableindex(function(t,k)
+local pagedestinations = setmetatableindex(function(t,k) -- not the same as the one above!
local v = pdfdelayedobject(f_fit(k))
t[k] = v
return v
@@ -424,49 +419,19 @@ function nodeinjections.destination(width,height,depth,names,view)
-- we could save some aut's by using a name when given but it doesn't pay off apart
-- from making the code messy and tracing hard .. we only save some destinations
-- which we already share anyway
- -- for n=1,#names do
- -- local name = names[n]
- -- if usedviews[name] then
- -- -- already done, maybe a warning
- -- elseif type(name) == "number" then
- -- if noview then
- -- usedviews[name] = view
- -- names[n] = false
- -- elseif method == v_page then
- -- usedviews[name] = view
- -- names[n] = false
- -- else
- -- local used = usedinternals[name]
- -- if used and used ~= defaultview then
- -- usedviews[name] = view
- -- names[n] = autoprefix .. name
- -- doview = true
- -- else
- -- -- names[n] = autoprefix .. name
- -- names[n] = false
- -- end
- -- end
- -- elseif method == v_page then
- -- usedviews[name] = view
- -- else
- -- usedviews[name] = view
- -- doview = true
- -- end
- -- end
-
if method == v_page then
for n=1,#names do
local name = names[n]
if usedviews[name] then
-- already done, maybe a warning
elseif type(name) == "number" then
- if noview then
- usedviews[name] = view
- names[n] = false
- else
+ -- if noview then
+ -- usedviews[name] = view
+ -- names[n] = false
+ -- else
usedviews[name] = view
names[n] = false
- end
+ -- end
else
usedviews[name] = view
end
@@ -519,56 +484,55 @@ end
-- we could share dictionaries ... todo
-local function somedestination(destination,internal,page) -- no view anyway
+local function pdflinkpage(page)
+ return pagereferences[page]
+end
+
+local function pdflinkinternal(internal,page)
local method = references.innermethod
- if method == v_auto then
- if type(destination) == "number" then
- if not internal then
- internal = destination
- end
- destination = nil
+ if internal then
+ flaginternals[internal] = true -- for bookmarks and so
+ local used = usedinternals[internal]
+ if used == defaultview or used == true then
+ return pagereferences[page]
end
- if internal then
- flaginternals[internal] = true -- for bookmarks and so
- local used = usedinternals[internal]
- if used == defaultview or used == true then
- return pagereferences[page]
- end
- if type(destination) ~= "string" then
- destination = autoprefix .. internal
- end
- return pdfdictionary {
- S = pdf_goto,
- D = destination,
- }
- elseif destination then
- -- hopefully this one is flushed
- return pdfdictionary {
- S = pdf_goto,
- D = destination,
- }
+ if type(internal) ~= "string" then
+ internal = autoprefix .. internal
end
- elseif method == v_name then
- if not destination and internal then
- flaginternals[internal] = true -- for bookmarks and so
- if type(destination) ~= "string" then
- destination = autoprefix .. internal
- end
- end
- if destination then
- return pdfdictionary {
- S = pdf_goto,
- D = destination,
- }
+ return pdfdictionary {
+ S = pdf_goto,
+ D = internal,
+ }
+ else
+ return pagereferences[page]
+ end
+end
+
+local function pdflinkname(destination,internal,page)
+ local method = references.innermethod
+ if method == v_auto then
+ flaginternals[internal] = true -- for bookmarks and so
+ local used = usedinternals[internal]
+ if used == defaultview then -- or used == true then
+ return pagereferences[page]
end
+ return pdfdictionary {
+ S = pdf_goto,
+ D = destination,
+ }
+ elseif method == v_name then
+ -- flaginternals[internal] = true -- for bookmarks and so
+ return pdfdictionary {
+ S = pdf_goto,
+ D = destination,
+ }
+ else
+ return pagereferences[page]
end
- return pagereferences[page]
end
-- annotations
-local pdflink = somedestination
-
local function pdffilelink(filename,destination,page,actions)
if not filename or filename == "" or file.basename(filename) == tex.jobname then
return false
@@ -701,7 +665,7 @@ local f_annot = formatters["<< /Type /Annot %s /Rect [ %0.3F %0.3F %0.3F %0.3F ]
directives.register("refences.sharelinks", function(v) share = v end)
-table.setmetatableindex(hashed,function(t,k)
+setmetatableindex(hashed,function(t,k)
local v = pdfdelayedobject(k)
if share then
t[k] = v
@@ -781,37 +745,46 @@ end)
-- runners and specials
+local splitter = lpeg.splitat(",",true)
+
runners["inner"] = function(var,actions)
local internal = false
- local inner = nil
+ local name = nil
local method = references.innermethod
- if method == v_auto or method == v_name then
- local vi = var.i
- if vi then
- local vir = vi.references
- if vir then
- -- todo: no need for it when we have a real reference
- local reference = vir.reference
- if reference and reference ~= "" then
- var.inner = reference
- local prefix = var.p
- if prefix and prefix ~= "" then
- var.prefix = prefix
- inner = prefix .. ":" .. reference
- else
- inner = reference
- end
- end
- internal = vir.internal
- if internal then
- flaginternals[internal] = true
+ local vi = var.i
+ local page = var.page
+ if vi then
+ local vir = vi.references
+ if vir then
+ -- todo: no need for it when we have a real reference ... although we need
+ -- this mess for prefixes anyway
+ local reference = vir.reference
+ if reference and reference ~= "" then
+ reference = lpegmatch(splitter,reference) or reference
+ var.inner = reference
+ local prefix = var.p
+ if prefix and prefix ~= "" then
+ var.prefix = prefix
+ name = prefix .. ":" .. reference
+ else
+ name = reference
end
end
+ internal = vir.internal
+ if internal then
+ flaginternals[internal] = true
+ end
end
+ end
+ if name then
+ return pdflinkname(name,internal,page)
+ elseif internal then
+ return pdflinkinternal(internal,page)
+ elseif page then
+ return pdflinkpage(page)
else
- var.inner = nil
+ -- real bad
end
- return pdflink(inner,internal,var.r)
end
runners["inner with arguments"] = function(var,actions)
@@ -878,7 +851,7 @@ function specials.internal(var,actions) -- better resolve in strc-ref
report_reference("no internal reference %a",i or "<unset>")
else
flaginternals[i] = true
- return pdflink(nil,i,v.references.realpage)
+ return pdflinkinternal(i,v.references.realpage)
end
end
@@ -902,7 +875,7 @@ function specials.page(var,actions)
p = references.realpageofpage(tonumber(p))
end
end
- return pdflink(nil,nil,p or var.operation)
+ return pdflinkpage(p or var.operation)
end
end
@@ -911,7 +884,7 @@ function specials.realpage(var,actions)
if file then
return pdffilelink(references.checkedfile(file),nil,var.operation,actions)
else
- return pdflink(nil,nil,var.operation)
+ return pdflinkpage(var.operation)
end
end
@@ -930,7 +903,7 @@ function specials.userpage(var,actions)
-- var.r = p
-- end
end
- return pdflink(nil,nil,p or var.operation)
+ return pdflinkpage(p or var.operation)
end
end
@@ -938,7 +911,7 @@ function specials.deltapage(var,actions)
local p = tonumber(var.operation)
if p then
p = references.checkedrealpage(p + texgetcount("realpageno"))
- return pdflink(nil,nil,p)
+ return pdflinkpage(p)
end
end
@@ -1195,7 +1168,7 @@ local function build(levels,start,parent,method,nested)
end
local action = nil
if variant == "list" then
- action = somedestination(reference.internal,reference.internal,reference.realpage)
+ action = pdflinkinternal(reference.internal,reference.realpage)
elseif variant == "realpage" then
action = pagereferences[realpage]
else
@@ -1207,7 +1180,7 @@ local function build(levels,start,parent,method,nested)
Prev = prev and pdfreference(prev),
A = action,
}
- -- entry.Dest = somedestination(reference.internal,reference.internal,reference.realpage)
+ -- entry.Dest = pdflinkinternal(reference.internal,reference.realpage)
if not first then
first, last = child, child
end
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua
index 2f55fb25d..fabb45286 100644
--- a/tex/context/base/mkiv/lpdf-ini.lua
+++ b/tex/context/base/mkiv/lpdf-ini.lua
@@ -586,9 +586,9 @@ local function pdfnull()
return p_null
end
---~ print(pdfboolean(false),pdfboolean(false,false),pdfboolean(false,true))
---~ print(pdfboolean(true),pdfboolean(true,false),pdfboolean(true,true))
---~ print(pdfboolean(nil,true),pdfboolean(nil,false))
+-- print(pdfboolean(false),pdfboolean(false,false),pdfboolean(false,true))
+-- print(pdfboolean(true),pdfboolean(true,false),pdfboolean(true,true))
+-- print(pdfboolean(nil,true),pdfboolean(nil,false))
local function pdfboolean(b,default)
if type(b) == "boolean" then
diff --git a/tex/context/base/mkiv/math-del.mkiv b/tex/context/base/mkiv/math-del.mkiv
index 2d57781c8..be78b581f 100644
--- a/tex/context/base/mkiv/math-del.mkiv
+++ b/tex/context/base/mkiv/math-del.mkiv
@@ -67,4 +67,55 @@
\def\mathopnolimits#1{\mathop{\mathrm#1}\nolimits} % was \rm, which follows text fonts (used in mml parser, check!)
\def\mathopdolimits#1{\mathop{\mathrm#1}} % was \rm, which follows text fonts (used in mml parser, check!)
+% A new experiment:
+
+\installcorenamespace {mathextensible}
+
+\installcommandhandler \??mathextensible {mathextensible} \??mathextensible
+
+\let\setupmathextensibles\setupmathextensible
+
+\setupmathextensibles
+ [\c!symbol=0,
+ \c!command=\v!yes,
+ \c!factor=1.5,
+ \c!height=\exheight,
+ \c!depth=\exheight]
+
+\appendtoks
+ \edef\p_command{\mathextensibleparameter\c!command}%
+ \ifx\p_command\v!yes
+ \setuevalue\currentmathextensible{\math_fenced_extensible[\currentmathextensible]}%
+ \fi
+\to \everydefinemathextensible
+
+\unexpanded\def\math_fenced_extensible
+ {\dodoubleempty\math_fenced_extensible_indeed}
+
+\unexpanded\def\math_fenced_extensible_indeed[#1][#2]%
+ {\mathop{%
+ \edef\currentmathextensible{#1}%
+ \edef\p_factor{\mathextensibleparameter\c!factor}%
+ \ifsecondargument
+ \doifassignmentelse{#2}
+ {\setupcurrentmathextensible[#2]}%
+ {\edef\p_factor{#2}}%
+ \fi
+ \Uvextensible
+ axis % can be an option
+ height \p_factor\dimexpr\mathextensibleparameter\c!height\relax
+ depth \p_factor\dimexpr\mathextensibleparameter\c!depth\relax
+ \Udelimiter\zerocount\zerocount\mathextensibleparameter\c!symbol
+ \relax}%
+ }
+
+\let\mathextensible\math_fenced_extensible
+
+% \startformula
+% \integral[factor=3] \frac{1}{2}
+% \integral[5] \frac{1}{2}
+% \stopformula
+
+\definemathextensible[integral][\c!symbol="222B]
+
\protect \endinput
diff --git a/tex/context/base/mkiv/math-fen.mkiv b/tex/context/base/mkiv/math-fen.mkiv
index f4994479c..81e39723d 100644
--- a/tex/context/base/mkiv/math-fen.mkiv
+++ b/tex/context/base/mkiv/math-fen.mkiv
@@ -532,6 +532,17 @@
\definemathcommand [Biggm] [rel] [one] {\Bigg}
\definemathcommand [Biggr] [close] [one] {\Bigg}
+% \definemathfence [integral] [\c!left="222B]
+%
+% \unexpanded\def\Lintegral {\math_fenced_fenced_start{integral}}
+% \unexpanded\def\Rintegral {\math_fenced_fenced_stop {integral}}
+%
+% \installmathfencepair \lintegral \Lintegral \rintegral \Rintegral
+%
+% \left\lintegral
+% \vrule height 3cm depth 3cm
+% \right\rintegral
+
%definemathfence [fancybracket] [bracket] [command=yes,color=red]
% experimental accents:
diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua
index b53424f65..63cbe1a82 100644
--- a/tex/context/base/mkiv/mult-fun.lua
+++ b/tex/context/base/mkiv/mult-fun.lua
@@ -11,6 +11,7 @@ return {
-- "originlength", "tickstep ", "ticklength",
-- "autoarrows", "ahfactor",
-- "angleoffset", anglelength", anglemethod",
+ "ahvariant", "ahdimple", "ahfactor",
"metapostversion",
"maxdimensions",
"drawoptionsfactor",
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index b39d48e47..9bf001352 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -174,7 +174,7 @@ return {
--
"donothing", "dontcomplain", "forgetall",
--
- "donetrue", "donefalse",
+ "donetrue", "donefalse", "foundtrue", "foundfalse",
--
"inlineordisplaymath","indisplaymath","forcedisplaymath","startforceddisplaymath","stopforceddisplaymath","reqno",
--
diff --git a/tex/context/base/mkiv/pack-bck.mkvi b/tex/context/base/mkiv/pack-bck.mkvi
index 430339f6d..346e7df57 100644
--- a/tex/context/base/mkiv/pack-bck.mkvi
+++ b/tex/context/base/mkiv/pack-bck.mkvi
@@ -244,8 +244,6 @@
%D \macros
%D {backgroundline}
-%D
-%D For the moment an undocumented feature, but a candidate for going public.
\unexpanded\def\backgroundline[#color]%
{\dontleavehmode
diff --git a/tex/context/base/mkiv/pack-rul.mkiv b/tex/context/base/mkiv/pack-rul.mkiv
index 2150842aa..c8288586f 100644
--- a/tex/context/base/mkiv/pack-rul.mkiv
+++ b/tex/context/base/mkiv/pack-rul.mkiv
@@ -22,7 +22,7 @@
\unprotect
-\definesystemvariable {ol} % OmLijnd -> check scrn-fld too
+% \definesystemvariable {ol} % OmLijnd -> check scrn-fld too
%D \macros
%D {linewidth, setuplinewidth}
diff --git a/tex/context/base/mkiv/page-mix.mkiv b/tex/context/base/mkiv/page-mix.mkiv
index 77bc6ea6c..0e329ce09 100644
--- a/tex/context/base/mkiv/page-mix.mkiv
+++ b/tex/context/base/mkiv/page-mix.mkiv
@@ -167,6 +167,7 @@
\definemixedcolumns
[\s!itemgroupcolumns]
[\c!n=\itemgroupparameter\c!n,
+ \c!direction=\itemgroupparameter\c!direction,
\c!separator=\v!none,
\c!splitmethod=\v!none,
\c!grid=\v!tolerant,
@@ -641,7 +642,7 @@
\else
\dorecurse\c_page_mix_n_of_columns
{\page_mix_routine_package_step
- \ifnum\recurselevel>\c_page_mix_n_of_columns
+ \ifnum\recurselevel<\c_page_mix_n_of_columns
\page_mix_routine_package_separate
\fi}%
\fi
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index f889b0ba7..ad86c889c 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 9b8900816..57684ac87 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/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua
index 2d6f3837b..358b97744 100644
--- a/tex/context/base/mkiv/strc-ref.lua
+++ b/tex/context/base/mkiv/strc-ref.lua
@@ -1937,12 +1937,10 @@ local function setinternalreference(specification)
-- ugly .. later we decide to ignore it when we have a real one
-- but for testing we might want to see them all
- if innermethod == v_page then
- -- we dont' want too many #1 #2 #3 etc
- if internal then
- tn = tn + 1
- t[tn] = internal -- when number it's internal
- end
+ if internal and innermethod ~= v_name then
+ -- we dont' want too many #1 #2 #3 etc
+ tn = tn + 1
+ t[tn] = internal -- when number it's internal
end
destination = references.mark(t,nil,nil,specification.view) -- returns an attribute
end
diff --git a/tex/context/base/mkiv/symb-run.mkiv b/tex/context/base/mkiv/symb-run.mkiv
index 3d92c4416..de17201c3 100644
--- a/tex/context/base/mkiv/symb-run.mkiv
+++ b/tex/context/base/mkiv/symb-run.mkiv
@@ -19,6 +19,7 @@
context.start()
context.forcesymbolset { collection }
context.starttabulate { "|lT|l|l|" }
+ local option = { framecolor = "orange", rulethickness = ".8pt", offset = interfaces.variables.overlay }
for i=1,#symbols do
local symbol = symbols[i]
context.NC()
@@ -26,15 +27,8 @@
context.NC()
context.symbol(symbol)
context.NC()
- context.color (
- { "red" },
- context.nested.ruledhbox(
- context.nested.color (
- { "black" },
- context.nested.symbol(symbol)
- )
- )
- )
+ context.framed(options,context.nested.symbol(symbol))
+ context.NC()
context.NR()
end
context.stoptabulate()
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index ffaada966..e3053adfb 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -503,6 +503,7 @@
%D Let's test this one:
\newif\ifdone
+\newif\iffound
%D Potential primitive in \LUATEX:
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index bb94c484b..3fc8ebc6d 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -630,10 +630,10 @@ end
local bpfactor = number.dimenfactors.bp
-callback.register("process_rule",function(n,h,v)
- local p = string.formatters["0 0 %0.6F %0.6F re f"](h*bpfactor,v*bpfactor)
- pdf.print("direct",p)
-end)
+-- callback.register("process_rule",function(n,h,v)
+-- local p = string.formatters["0 0 %0.6F %0.6F re f"](h*bpfactor,v*bpfactor)
+-- pdf.print("direct",p)
+-- end)
local function ruledglyph(head,current,previous)
local wd = getfield(current,"width")
@@ -651,7 +651,7 @@ local function ruledglyph(head,current,previous)
baseline = new_rule(wd-2*linewidth,linewidth,0)
end
local doublelinewidth = 2*linewidth
- -- could be a pdf rule
+ -- could be a pdf rule (or a user rule now)
local info = linked_nodes(
new_rule(linewidth,ht,dp),
new_rule(wd-doublelinewidth,-dp+linewidth,dp),
diff --git a/tex/context/base/mkiv/type-ini.mkvi b/tex/context/base/mkiv/type-ini.mkvi
index e4cd0b0b1..3969a5b95 100644
--- a/tex/context/base/mkiv/type-ini.mkvi
+++ b/tex/context/base/mkiv/type-ini.mkvi
@@ -639,8 +639,4 @@
\let\fontstyle\s!rm
\fi\fi}
-%D This might become a module:
-
-\fetchruntimecommand \typetypescript {\f!typeprefix\s!run}
-
\protect \endinput
diff --git a/tex/context/base/mkiv/type-run.mkiv b/tex/context/base/mkiv/type-run.mkiv
deleted file mode 100644
index 0455d8966..000000000
--- a/tex/context/base/mkiv/type-run.mkiv
+++ /dev/null
@@ -1,51 +0,0 @@
-%D \module
-%D [ file=type-run,
-%D version=2001.04.20,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Runtime Macros,
-%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.
-
-\unprotect
-
-\gdef\typetypescript
- {\dotripleempty\dotypetypescript}
-
-\gdef\dotypetypescript[#1][#2][#3]%
- {\bgroup
- \def\dochecktypescript##1##2% script use
- {\doifelsenothing{##1##2}
- {\donetrue}
- {\doifelsecommon{##1}{##2}\donetrue\donefalse}}
- \edef\typescriptone {\truetypescript{#1}}%
- \edef\typescripttwo {\truetypescript{#2}}%
- \edef\typescriptthree{\truetypescript{#3}}%
- \unexpanded\def\starttypescript
- {\bgroup
- \obeylines % else we loose the first line due to lookahead
- \dotripleempty\dostarttypescript}
- \def\dostarttypescript[##1][##2][##3]%
- {\def\next####1\stoptypescript{\egroup}
- \dochecktypescript{##1}\typescriptone \ifdone
- \dochecktypescript{##2}\typescripttwo \ifdone
- \dochecktypescript{##3}\typescriptthree\ifdone
- \def\next%
- {\unexpanded\def\stoptypescript{\egroup\type{\stoptypescript}}
- % what follows now is quite ugly
- \skipfirstverbatimlinefalse
- \type{\starttypescript}
- \doifsomething{##1}{\type{[##1]}}
- \doifsomething{##2}{\type{[##2]}}
- \doifsomething{##3}{\type{[##3]}}
- \processdisplayverbatim{\stoptypescript}}%
- \fi\fi\fi
- \next}
- \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript
- \egroup}
-
-\protect \endinput
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 4676a4679..ca93a5609 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 : 02/20/16 14:55:34
+-- merge date : 02/22/16 19:54:56
do -- begin closure to overcome local limits and interference