summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/attr-ini.mkiv2
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-def.mkiv10
-rw-r--r--tex/context/base/font-ini.mkiv249
-rw-r--r--tex/context/base/grph-inc.mkii5
-rw-r--r--tex/context/base/grph-inc.mkiv12
-rw-r--r--tex/context/base/math-def.mkiv6
-rw-r--r--tex/context/base/node-bck.lua116
-rw-r--r--tex/context/base/node-bck.mkiv163
-rw-r--r--tex/context/base/strc-doc.lua2
-rw-r--r--tex/context/base/strc-ref.lua9
-rw-r--r--tex/context/base/strc-ref.mkiv28
-rw-r--r--tex/context/base/strc-sec.mkiv7
-rw-r--r--tex/context/base/syst-aux.mkiv10
-rw-r--r--tex/context/base/tabl-tbl.mkiv30
-rw-r--r--tex/context/bib/t-bib.tex4
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
19 files changed, 583 insertions, 78 deletions
diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv
index 7d9cb100e..b90d4976b 100644
--- a/tex/context/base/attr-ini.mkiv
+++ b/tex/context/base/attr-ini.mkiv
@@ -23,7 +23,7 @@
\definesystemattribute[state]
\definesystemattribute[skip]
\definesystemattribute[penalty]
-\definesystemattribute[colormodel][global] % no reset \chardef\colormodelattribute \dogetattributeid{colormodel}
+\definesystemattribute[colormodel][global] \chardef\colormodelattribute \dogetattributeid{colormodel}
\definesystemattribute[color] \chardef\colorattribute \dogetattributeid{color}
\definesystemattribute[transparency] \chardef\transparencyattribute \dogetattributeid{transparency}
\definesystemattribute[background] \chardef\backgroundattribute \dogetattributeid{background}
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 54a26704d..161d4c918 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2009.08.17 19:06}
+\newcontextversion{2009.08.19 17:10}
%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/context.mkiv b/tex/context/base/context.mkiv
index fdba7661a..03f26c8f0 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -20,7 +20,7 @@
\loadcorefile{syst-ini}
-\ifnum\luatexversion<42
+\ifnum\luatexversion<43
\writestatus{!!!!}{Your luatex binary is way too old, you need at least version 0.42.}
\expandafter\end
\fi
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 3f6608a1c..5f9615230 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2009.08.17 19:06}
+\edef\contextversion{2009.08.19 17:10}
%D For those who want to use this:
diff --git a/tex/context/base/core-def.mkiv b/tex/context/base/core-def.mkiv
index 782fe3f67..583eb5870 100644
--- a/tex/context/base/core-def.mkiv
+++ b/tex/context/base/core-def.mkiv
@@ -63,10 +63,10 @@
% temporary here:
-\ifx\in \undefined\else \let\normalmathin \in \unexpanded\def\in {\mathortext\normalmathin \dospecialin } \fi
-\ifx\at \undefined\else \let\normalmathat \at \unexpanded\def\at {\mathortext\normalmathat \dospecialat } \fi
-\ifx\about\undefined\else \let\normalmathabout\about \unexpanded\def\about{\mathortext\normalmathabout\dospecialabout} \fi
-\ifx\from \undefined\else \let\normalmathfrom \from \unexpanded\def\from {\mathortext\normalmathfrom \dospecialfrom } \fi
-\ifx\over \undefined\else \let\normalmathover \over \unexpanded\def\over {\mathortext\normalmathover \dospecialabout} \fi
+\ifdefined\in \let\normalmathin \in \unexpanded\def\in {\mathortext\normalmathin \dospecialin } \else \let\in \dospecialin \fi
+\ifdefined\at \let\normalmathat \at \unexpanded\def\at {\mathortext\normalmathat \dospecialat } \else \let\at \dospecialat \fi
+\ifdefined\about \let\normalmathabout\about \unexpanded\def\about{\mathortext\normalmathabout\dospecialabout} \else \let\about\dospecialabout \fi
+\ifdefined\from \let\normalmathfrom \from \unexpanded\def\from {\mathortext\normalmathfrom \dospecialfrom } \else \let\from \dospecialfrom \fi
+\ifdefined\over \let\normalmathover \over \unexpanded\def\over {\mathortext\normalmathover \dospecialabout} \else \let\over \dospecialabout \fi
\protect \endinput
diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv
index a31ed6e66..c39bdb8b7 100644
--- a/tex/context/base/font-ini.mkiv
+++ b/tex/context/base/font-ini.mkiv
@@ -2211,15 +2211,54 @@
\let\fontstrategy\relax
-\def\synchronizefont
+% \def\synchronizefont
+% {\tryingfonttrue
+% \ifx\fontclass\empty\else
+% \global\let\fontstrategy\dofontclassstrategy
+% \the\fontstrategies \relax % \relax still needed ?
+% \fi
+% \iftryingfont
+% \global\let\fontstrategy\dofontstrategy
+% \the\fontstrategies \relax % \relax still needed ?
+% \fi
+% \autofontsizefalse
+% \ifskipfontcharacteristics
+% \setfontcharacteristics
+% \the\everyfontswitch
+% \fi}
+
+% \def\dofontstrategy#1#2#3#4#5%
+% {\ifcsname#2#3#4#5\endcsname
+% #1\csname#2#3#4#5\endcsname \tryingfontfalse
+% \fi}
+
+% \def\dofontclassstrategy#1#2#3#4#5%
+% {\ifcsname\fontclass#2#3#4#5\endcsname
+% #1\csname\fontclass#2#3#4#5\endcsname \tryingfontfalse
+% \fi}
+
+% \def\synchronizefont % we can have dups i.e. no need to let fontstrategy
+% {\tryingfonttrue
+% \ifx\fontclass\empty\else
+% \global\let\fontstrategy\dofontclassstrategy
+% \applyfontstrategies
+% \fi
+% \iftryingfont
+% \global\let\fontstrategy\dofontstrategy
+% \applyfontstrategies
+% \fi
+% \autofontsizefalse
+% \ifskipfontcharacteristics
+% \setfontcharacteristics
+% \the\everyfontswitch
+% \fi}
+
+\def\synchronizefont % we can have dups i.e. no need to let fontstrategy
{\tryingfonttrue
- \ifx\fontclass\empty\else
- \global\let\fontstrategy\dofontclassstrategy
- \the\fontstrategies \relax % \relax still needed ?
- \fi
- \iftryingfont
- \global\let\fontstrategy\dofontstrategy
- \the\fontstrategies \relax % \relax still needed ?
+ \ifx\fontclass\empty
+ \applyfontstrategies
+ \else
+ \applyfontclassstrategies
\fi
\autofontsizefalse
\ifskipfontcharacteristics
@@ -2227,39 +2266,185 @@
\the\everyfontswitch
\fi}
-\def\dofontstrategy#1#2#3#4#5%
- {\ifcsname#2#3#4#5\endcsname
- #1\csname#2#3#4#5\endcsname \tryingfontfalse
+% \appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- --- --- --- % pt tt bf a
+% \fontbody \fontstyle \fontalternative \fontsize
+% \fi \to \fontstrategies
+%
+% \appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- --- def % pt tt bf
+% \fontbody \fontstyle \fontalternative \defaultfontsize
+% \fi \to \fontstrategies
+%
+% \appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- def --- % pt tt tf a
+% \fontbody \fontstyle \defaultfontalternative \fontsize
+% \fi \to \fontstrategies
+%
+% \appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- def def % pt tt tf
+% \fontbody \fontstyle \defaultfontalternative \defaultfontsize
+% \fi \to \fontstrategies
+%
+% \appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- def def def % pt rm tf
+% \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
+% \fi \to \fontstrategies
+%
+% \appendtoks \iftryingfont \fontstrategy \autofontsizetrue % def def def def % rm tf
+% \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
+% \fi \to \fontstrategies
+
+% \def\fontstrategiesa % --- --- --- --- % pt tt bf a
+% {\fontstrategy \autofontsizefalse \fontbody \fontstyle \fontalternative \fontsize
+% \iftryingfont \fontstrategiesb \fi}
+% \def\fontstrategiesb % --- --- --- def % pt tt bf
+% {\fontstrategy \autofontsizetrue \fontbody \fontstyle \fontalternative \defaultfontsize
+% \iftryingfont \fontstrategiesc \fi}
+% \def\fontstrategiesc % --- --- def --- % pt tt tf a
+% {\fontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \fontsize
+% \iftryingfont \fontstrategiesd \fi}
+% \def\fontstrategiesd % --- --- def def % pt tt tf
+% {\fontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \defaultfontsize
+% \iftryingfont \fontstrategiese \fi}
+% \def\fontstrategiese % --- def def def % pt rm tf
+% {\fontstrategy \autofontsizefalse \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
+% \iftryingfont \fontstrategiesf \fi}
+% \def\fontstrategiesf % def def def def % rm tf
+% {\fontstrategy \autofontsizetrue \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize}
+
+% \fontstrategies {\fontstrategiesa}
+% \let\applyfontstrategies\fontstrategiesa
+
+% \def\fontclassstrategiesa % --- --- --- --- % pt tt bf a
+% {\dofontclassstrategy \autofontsizefalse \fontbody \fontstyle \fontalternative \fontsize
+% \iftryingfont \fontclassstrategiesb \fi}
+% \def\fontclassstrategiesb % --- --- --- def % pt tt bf
+% {\dofontclassstrategy \autofontsizetrue \fontbody \fontstyle \fontalternative \defaultfontsize
+% \iftryingfont \fontclassstrategiesc \fi}
+% \def\fontclassstrategiesc % --- --- def --- % pt tt tf a
+% {\dofontclassstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \fontsize
+% \iftryingfont \fontclassstrategiesd \fi}
+% \def\fontclassstrategiesd % --- --- def def % pt tt tf
+% {\dofontclassstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \defaultfontsize
+% \iftryingfont \fontclassstrategiese \fi}
+% \def\fontclassstrategiese % --- def def def % pt rm tf
+% {\dofontclassstrategy \autofontsizefalse \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
+% \iftryingfont \fontclassstrategiesf \fi}
+% \def\fontclassstrategiesf % def def def def % rm tf
+% {\dofontclassstrategy \autofontsizetrue \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize}
+
+\def\fontclassstrategiesa % --- --- --- --- % pt tt bf a
+ {\ifcsname\fontclass\fontbody \fontstyle \fontalternative \fontsize\endcsname
+ \autofontsizefalse
+ \csname\fontclass\fontbody \fontstyle \fontalternative \fontsize\endcsname
+ \else
+ \expandafter\fontclassstrategiesb
+ \fi}
+
+\def\fontclassstrategiesb % --- --- --- def % pt tt bf
+ {\ifcsname\fontclass\fontbody \fontstyle \fontalternative \defaultfontsize\endcsname
+ \autofontsizetrue
+ \csname\fontclass\fontbody \fontstyle \fontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontclassstrategiesc
+ \fi}
+
+\def\fontclassstrategiesc % --- --- def --- % pt tt tf a
+ {\ifcsname\fontclass\fontbody \fontstyle \defaultfontalternative \fontsize\endcsname
+ \autofontsizetrue
+ \csname\fontclass\fontbody \fontstyle \defaultfontalternative \fontsize\endcsname
+ \else
+ \expandafter\fontclassstrategiesd
\fi}
-\def\dofontclassstrategy#1#2#3#4#5%
- {\ifcsname\fontclass#2#3#4#5\endcsname
- #1\csname\fontclass#2#3#4#5\endcsname \tryingfontfalse
+\def\fontclassstrategiesd % --- --- def def % pt tt tf
+ {\ifcsname\fontclass\fontbody \fontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \autofontsizetrue
+ \csname\fontclass\fontbody \fontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontclassstrategiese
\fi}
-\appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- --- --- --- % pt tt bf a
- \fontbody \fontstyle \fontalternative \fontsize
-\fi \to \fontstrategies
+\def\fontclassstrategiese % --- def def def % pt rm tf
+ {\ifcsname\fontclass\fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \autofontsizefalse
+ \csname\fontclass\fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontclassstrategiesf
+ \fi}
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- --- def % pt tt bf
- \fontbody \fontstyle \fontalternative \defaultfontsize
-\fi \to \fontstrategies
+\def\fontclassstrategiesf % def def def def % rm tf
+ {\ifcsname\fontclass\defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \autofontsizetrue
+ \csname\fontclass\defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontstrategiesa
+ \fi}
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- def --- % pt tt tf a
- \fontbody \fontstyle \defaultfontalternative \fontsize
-\fi \to \fontstrategies
+% no class
+
+% \def\fontstrategiesa % --- --- --- --- % pt tt bf a
+% {\dofontstrategy \autofontsizefalse \fontbody \fontstyle \fontalternative \fontsize
+% \iftryingfont \fontstrategiesb \fi}
+% \def\fontstrategiesb % --- --- --- def % pt tt bf
+% {\dofontstrategy \autofontsizetrue \fontbody \fontstyle \fontalternative \defaultfontsize
+% \iftryingfont \fontstrategiesc \fi}
+% \def\fontstrategiesc % --- --- def --- % pt tt tf a
+% {\dofontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \fontsize
+% \iftryingfont \fontstrategiesd \fi}
+% \def\fontstrategiesd % --- --- def def % pt tt tf
+% {\dofontstrategy \autofontsizetrue \fontbody \fontstyle \defaultfontalternative \defaultfontsize
+% \iftryingfont \fontstrategiese \fi}
+% \def\fontstrategiese % --- def def def % pt rm tf
+% {\dofontstrategy \autofontsizefalse \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
+% \iftryingfont \fontstrategiesf \fi}
+% \def\fontstrategiesf % def def def def % rm tf
+% {\dofontstrategy \autofontsizetrue \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize}
+
+\def\fontstrategiesa % --- --- --- --- % pt tt bf a
+ {\ifcsname\fontbody \fontstyle \fontalternative \fontsize\endcsname
+ \autofontsizefalse
+ \csname\fontbody \fontstyle \fontalternative \fontsize\endcsname
+ \else
+ \expandafter\fontstrategiesb
+ \fi}
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- def def % pt tt tf
- \fontbody \fontstyle \defaultfontalternative \defaultfontsize
-\fi \to \fontstrategies
+\def\fontstrategiesb % --- --- --- --- % pt tt bf a
+ {\ifcsname\fontbody \fontstyle \fontalternative \defaultfontsize\endcsname
+ \autofontsizetrue
+ \csname\fontbody \fontstyle \fontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontstrategiesc
+ \fi}
-\appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- def def def % pt rm tf
- \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-\fi \to \fontstrategies
+\def\fontstrategiesc % --- --- --- --- % pt tt bf a
+ {\ifcsname\fontbody \fontstyle \defaultfontalternative \fontsize\endcsname
+ \autofontsizetrue
+ \csname\fontbody \fontstyle \defaultfontalternative \fontsize\endcsname
+ \else
+ \expandafter\fontstrategiesd
+ \fi}
+
+\def\fontstrategiesd % --- --- --- --- % pt tt bf a
+ {\ifcsname\fontbody \fontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \autofontsizetrue
+ \csname\fontbody \fontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontstrategiese
+ \fi}
+
+\def\fontstrategiese % --- --- --- --- % pt tt bf a
+ {\ifcsname\fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \autofontsizefalse
+ \csname\fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \else
+ \expandafter\fontstrategiesf
+ \fi}
+
+\def\fontstrategiesf % --- --- --- --- % pt tt bf a
+ {\ifcsname\defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \autofontsizetrue
+ \csname\defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize\endcsname
+ \fi}
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % def def def def % rm tf
- \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-\fi \to \fontstrategies
+\let\applyfontstrategies \fontstrategiesa
+\let\applyfontclassstrategies\fontclassstrategiesa
%D Let's synchronize:
diff --git a/tex/context/base/grph-inc.mkii b/tex/context/base/grph-inc.mkii
index acb5ae7e9..dde7ab2e6 100644
--- a/tex/context/base/grph-inc.mkii
+++ b/tex/context/base/grph-inc.mkii
@@ -611,6 +611,7 @@
\doshowfigurestate{state : figure not found (\expandedfigurename)}%
\global\setbox\foundexternalfigure\naturalvbox
{\doscalebox\??ef{\blackrule[\c!width=\naturalfigurewidth,\c!height=\naturalfigureheight]}}%
+ \xdef\noffigurepages{0}%
\or
\doshowfiguremessage8\expandedfigurename
\doshowfigurestate{state : reusing existing figure}%
@@ -896,8 +897,8 @@
\doresetobjects}
\def\doiffigureelse#1%
- {\getfiguredimensions[#1]%
- \ifcase\figurewidth
+ {\getfiguredimensions[#1]% so data is available !
+ \ifdim\analyzedfigurewidth=\zeropoint % todo: \figurestatus
\expandafter\secondoftwoarguments
\else
\expandafter\firstoftwoarguments
diff --git a/tex/context/base/grph-inc.mkiv b/tex/context/base/grph-inc.mkiv
index 3fe30458e..c8c0e36b7 100644
--- a/tex/context/base/grph-inc.mkiv
+++ b/tex/context/base/grph-inc.mkiv
@@ -270,11 +270,11 @@
\egroup
\egroup}
-\def\signalexternalfigure
+\def\signalexternalfigure % global
{\ifcase\figurestatus
- \resetsystemmode\v!figure % todo, also: \v!resource
+ \global\resetsystemmode\v!figure % todo, also: \v!resource
\else
- \setsystemmode \v!figure % todo, also: \v!resource
+ \global\setsystemmode \v!figure % todo, also: \v!resource
\fi}
\def\startfoundexternalfigure#1#2%
@@ -345,15 +345,15 @@
\def\dogetfiguredimensions[#1][#2]%
{\startnointerference
- \testexternalfigureonly
+ \settrue\testexternalfigureonly
\externalfigure[#1][#2,\c!display=,\c!object=\v!no]%
\stopnointerference}
\let\getfiguredimensionsonly\getfiguredimensions
\def\doiffigureelse#1%
- {\getfiguredimensions[#1]%
- \ifcase\figurewidth % todo: \figurestatus
+ {\getfiguredimensions[#1]% so data is available !
+ \ifdim\figurewidth=\zeropoint % todo: \figurestatus
\expandafter\secondoftwoarguments
\else
\expandafter\firstoftwoarguments
diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv
index 0438777fa..ad5e40672 100644
--- a/tex/context/base/math-def.mkiv
+++ b/tex/context/base/math-def.mkiv
@@ -331,8 +331,8 @@
% tricky .. todo
-\appendtoks
- \def\over{\primitive\over}%
-\to \everymathematics
+% \appendtoks
+% \def\over{\primitive\over}%
+% \to \everymathematics
\protect \endinput
diff --git a/tex/context/base/node-bck.lua b/tex/context/base/node-bck.lua
new file mode 100644
index 000000000..6a01294f8
--- /dev/null
+++ b/tex/context/base/node-bck.lua
@@ -0,0 +1,116 @@
+if not modules then modules = { } end modules ['node-bck'] = {
+ version = 1.001,
+ comment = "companion to node-bck.tex",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local hlist = node.id("hlist")
+local vlist = node.id("vlist")
+
+local has_attribute = node.has_attribute
+local set_attribute = node.set_attribute
+local traverse = node.traverse
+
+local new_rule = nodes.rule
+local new_glue = nodes.glue
+
+local a_color = attributes.private('color')
+local a_transparency = attributes.private('transparency')
+local a_colorspace = attributes.private('colormodel')
+local a_background = attributes.private('background')
+
+local function add_backgrounds(head) -- boxes, inline will be done too
+ local id = head.id
+ if id == vlist or id == hlist then
+ local current = head.list
+ while current do
+ local id = current.id
+ if id == hlist then -- and current.list
+ local background = has_attribute(current,a_background)
+ if background then
+ -- direct to hbox
+ -- colorspace is already set so we can omit that and stick to color
+ local mode = has_attribute(current,a_colorspace)
+ if mode then
+ local glue = new_glue(-current.width)
+ local rule = new_rule(current.width,current.height,current.depth)
+ local color = has_attribute(current,a_color)
+ local transparency = has_attribute(current,a_transparency)
+ set_attribute(rule,a_colorspace, mode)
+ if color then
+ set_attribute(rule,a_color, color)
+ end
+ if transparency then
+ set_attribute(rule,a_transparency,transparency)
+ end
+ rule.next = glue
+ glue.next = current.list
+ current.list = rule
+ end
+ else
+ -- temporary hack for aligments
+ local list, background, found = current.list, nil, nil
+ for l in traverse(list) do
+ background = has_attribute(l,a_background)
+ if background then
+ found = l
+ break
+ end
+ end
+ if background then
+ local mode = has_attribute(found,a_colorspace)
+ if mode then
+ local glue = new_glue(-current.width)
+ local rule = new_rule(current.width,current.height,current.depth)
+ local color = has_attribute(found,a_color)
+ local transparency = has_attribute(found,a_transparency)
+ set_attribute(rule,a_colorspace, mode)
+ if color then
+ set_attribute(rule,a_color, color)
+ end
+ if transparency then
+ set_attribute(rule,a_transparency,transparency)
+ end
+ rule.next = glue
+ glue.next = list
+ current.list = rule
+ end
+ else
+ add_backgrounds(current)
+ end
+ end
+ elseif id == vlist then -- and current.list
+ -- direct to vbox
+ local background = has_attribute(current,a_background)
+ if background then
+ local mode = has_attribute(current,a_colorspace)
+ if mode then
+ local glue = new_glue(-current.height-current.depth)
+ local rule = new_rule(current.width,current.height,current.depth)
+ local color = has_attribute(current,a_color)
+ local transparency = has_attribute(current,a_transparency)
+ set_attribute(rule,a_colorspace, mode)
+ if color then
+ set_attribute(rule,a_color, color)
+ end
+ if transparency then
+ set_attribute(rule,a_transparency,transparency)
+ end
+ rule.next = glue
+ glue.next = current.list
+ current.list = rule
+ end
+ end
+ add_backgrounds(current)
+ end
+ current = current.next
+ end
+ end
+ return head, true
+end
+
+nodes.add_backgrounds = add_backgrounds
+
+tasks.appendaction("shipouts","normalizers","nodes.add_backgrounds")
diff --git a/tex/context/base/node-bck.mkiv b/tex/context/base/node-bck.mkiv
new file mode 100644
index 000000000..758e598e8
--- /dev/null
+++ b/tex/context/base/node-bck.mkiv
@@ -0,0 +1,163 @@
+%D \module
+%D [ file=node-bck,
+%D version=2009.06.08,
+%D title=\CONTEXT\ Node Macros,
+%D subtitle=Backgrounds,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Node Support / Backgrounds}
+
+%D This is first attempt to replacing backgrounds in a few
+%D tables mechanisms.
+
+\unprotect
+
+\registerctxluafile{node-bck}{1.001}
+
+%D Box helpers:
+
+\def\doaddbackgroundtobox#1[#2]%
+ {\begingroup\faststartcolor[#2]%
+ \normalexpanded{\noexpand\faststopcolor\endgroup#1
+ attr \backgroundattribute \plusone
+ attr \colormodelattribute \the\attribute\colormodelattribute
+ attr \colorattribute \the\attribute\colorattribute
+ attr \transparencyattribute \the\attribute\transparencyattribute}}
+
+\def\backgroundvbox{\doaddbackgroundtobox\vbox}
+\def\backgroundvtop{\doaddbackgroundtobox\vtop}
+\def\backgroundhbox{\doaddbackgroundtobox\hbox}
+
+\def\colorattr#1%
+ {\ifcsname(cs:\currentpalet#1)\endcsname
+ \thecolorattr{\currentpalet#1}%
+ \else\ifcsname(cs:#1)\endcsname
+ \thecolorattr{#1}%
+ \fi\fi}
+
+\def\thecolorattr#1%
+ {attr \colormodelattribute \attribute\colormodelattribute
+ attr \colorattribute \csname(cs:#1)\endcsname
+ attr \transparencyattribute \csname(ts:#1)\endcsname}
+
+\def\backgroundcolorattr#1%
+ {\ifcsname(cs:\currentpalet#1)\endcsname
+ \thebackgroundcolorattr{\currentpalet#1}%
+ \else\ifcsname(cs:#1)\endcsname
+ \thebackgroundcolorattr{#1}%
+ \fi\fi}
+
+\def\thebackgroundcolorattr#1%
+ {attr \backgroundattribute \plusone
+ attr \colormodelattribute \attribute\colormodelattribute
+ attr \colorattribute \csname(cs:#1)\endcsname
+ attr \transparencyattribute \csname(ts:#1)\endcsname}
+
+% \def\backgroundvbox[#1]{\vbox \backgroundcolorattr{#1}}
+% \def\backgroundvtop[#1]{\vtop \backgroundcolorattr{#1}}
+% \def\backgroundhbox[#1]{\hbox \backgroundcolorattr{#1}}
+
+%D tabulate:
+
+\def\tabulatenormalcolumn#1%
+ {\doiffastoptionalcheckelse{\tabulatenormalcolumnyes#1}{\tabulatenormalcolumnnop#1}}
+
+\def\tabulatenormalcolumnnop#1% overloads anch-pgr
+ {&\iftabulateequal\tabulateequalpos\else\tabulatenormalpos\fi&\global\chardef\tabulatetype#1&}
+
+\def\tabulatenormalcolumnyes#1[#2]%
+ {&\iftabulateequal\tabulateequalpos\else\tabulatenormalpos\fi&\global\chardef\tabulatetype#1&%
+ \iftrialtypesetting\else\settabulatecolor{#2}\fi\ignorespaces}
+
+\newcount\maxtabularcolorcolumn
+
+\def\settabulatecolor#1% we could store the attributes at the cost of a lua call
+ {\begingroup
+ \global\settrue\tabulatehascolors
+ \ifnum\tabulatecolumn>\maxtabularcolorcolumn
+ \global\maxtabularcolorcolumn\tabulatecolumn
+ \fi
+ \setxvalue{\??tt:c:\the\tabulatecolumn}{#1}%
+ \dosetattribute{background}\plusone
+ \faststartcolor[#1]\strut\char0\faststopcolor
+ \endgroup}
+
+\def\repeatsettabulatecolor
+ {\begingroup
+ \ifcsname\??tt:c:\the\tabulatecolumn\endcsname
+ \dosetattribute{background}\plusone
+ \faststartcolor[\csname\??tt:c:\the\tabulatecolumn\endcsname]\strut\char0\faststopcolor
+ \fi
+ \endgroup}
+
+\def\resettabulatecolors
+ {\ifcase\maxtabularcolorcolumn\else
+ \doresettabulatecolors
+ \fi}
+
+\def\doresettabulatecolors
+ {\dorecurse\maxtabularcolorcolumn{\letgvalue{\??tt:c:\recurselevel}\undefined}} % slow
+
+\appendtoks
+ \resettabulatecolors
+\to \everyaftertabulaterow
+
+\def\splitofftabulatebox % overloads in anch-pgr
+ {\dontcomplain
+ \global\setbox\tabulatebox % % % global ? % % %
+ \vsplit\tablebox\tabulatecolumn to \lineheight
+ \setbox\tabulatebox\normalvbox
+ {\unvbox\tabulatebox}%
+ \setbox\tabulatebox\hbox to \wd\tabulatebox
+ {\iftrialtypesetting\else\ifconditional\tabulatehascolors\repeatsettabulatecolor\fi\fi
+ \hss\dotabulatehook{\box\tabulatebox}\hss}%
+ \ht\tabulatebox\strutht
+ \dp\tabulatebox\strutdp
+ \box\tabulatebox
+ \iftrialtypesetting\else\ifconditional\tablehaspositions\doflushtabulateepos\fi\fi}
+
+\appendtoks
+ \global\setfalse\tabulatehascolors
+\to \everytabulate
+
+\protect \endinput
+
+% test
+
+\starttext
+
+\backgroundvbox[green] {\input tufte } \par
+\backgroundvbox[blue] {\input ward } \par
+\backgroundvbox[red] {\input knuth } \par
+\backgroundhbox[yellow]{\rotate[rotation=45]{hello world}} \par
+
+\starttabulate[||p||]
+\NC test \NC test \NC test \NC \NR
+\NC test \NC[green] \input tufte \NC[yellow] test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC[blue] test \NC[red] test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC[gray] test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC[blue] test \NC test \NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC test \NC[magenta] test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC[cyan] \dorecurse{10}{\input ward }\NC test \NC \NR
+\NC test \NC test \NC test \NC \NR
+\NC test \NC[yellow] test \NC test \NC \NR
+\stoptabulate
+
+\stoptext
diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua
index 76599c371..cb279e320 100644
--- a/tex/context/base/strc-doc.lua
+++ b/tex/context/base/strc-doc.lua
@@ -187,7 +187,9 @@ end
function sections.somelevel(given)
-- old number
local numbers, ownnumbers, forced, status, olddepth = data.numbers, data.ownnumbers, data.forced, data.status, data.depth
+--~ print("old",olddepth,given.metadata.name,levelmap[given.metadata.name])
local newdepth = tonumber(levelmap[given.metadata.name] or (olddepth > 0 and olddepth) or 1) -- hm, levelmap only works for section-*
+--~ print("new",newdepth)
local directives = given.directives
local resetset = (directives and directives.resetset) or ""
local resetter = sets.getall("structure:resets",data.block,resetset)
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index b1b77f45f..eb4f74ce8 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -690,6 +690,15 @@ function filters.generic.title(data)
end
end
+function filters.generic.text(data)
+ if data then
+ local entries = data.entries
+ if entries then
+ helpers.title(entries.text or "?",data.metadata)
+ end
+ end
+end
+
function filters.generic.number(data) -- todo: spec and then no stopper
if data then
helpers.prefix(data)
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index 8bf724b99..5db3d0013 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -11,6 +11,17 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% todo: (1) configure references, (2) rendering => with presets
+%
+% \starttext
+% \definestructureconversionset[default][Character,number,Romannumerals,Character][number]
+% \definestructureseparatorset [default][.,.,--][.]
+% \setupstructurehead[subsection][sectionstopper=),sectionsegments=4:4]
+
+% \setupreferencing[sectionsegments=3:4]
+% \section {One} \subsection[sec:test]{Two} See \in[sec:test]
+% \stoptext
+
\writestatus{loading}{ConTeXt Structure Macros / Cross Referencing}
\registerctxluafile{strc-ref}{1.001}
@@ -704,15 +715,22 @@
%D and~\type{[} becomes active (and when asked for, typeset
%D in a different color and typeface).
-\definecommand in {\dospecialin}
-\definecommand at {\dospecialat}
-\definecommand about {\dospecialabout}
-\definecommand from {\dospecialfrom}
-\definecommand over {\dospecialabout} % needed here, else math problems
+% \unexpanded\def\in {\mathortext\donormalmathin \dospecialin}
+% \unexpanded\def\at {\mathortext\donormalmathat \dospecialat}
+% \unexpanded\def\about{\mathortext\donormalmathabout\dospecialabout}
+% \unexpanded\def\from {\mathortext\donormalmathfrom \dospecialfrom}
+% \unexpanded\def\over {\mathortext\donormalmathover \dospecialabout}
+
+% \definecommand in {\dospecialin}
+% \definecommand at {\dospecialat}
+% \definecommand about {\dospecialabout}
+% \definecommand from {\dospecialfrom}
+% \definecommand over {\dospecialabout} % needed here, else math problems
\def\currentreferencenumber {\ctxlua{jobreferences.filter("number")}}
\def\currentreferencepage {\ctxlua{jobreferences.filter("page")}}
\def\currentreferencetitle {\ctxlua{jobreferences.filter("title")}}
+\def\currentreferencetext {\ctxlua{jobreferences.filter("text")}}
\def\currentreferencerealpage{\ctxlua{jobreferences.realpage()}}
\unexpanded\def\dospecialabout[#1]%
diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv
index d64af6a53..ddc601eb8 100644
--- a/tex/context/base/strc-sec.mkiv
+++ b/tex/context/base/strc-sec.mkiv
@@ -145,7 +145,7 @@
% deeptextcommand and deepnumbercommand are left undefined !
-\def\dodefineuniquestructurehead#1#2% class, parameters
+\def\dodefineuniquestructurehead#1#2% class, parent
{\def\currentstructurehead{#1}%
\presetlabeltext[#1=]%
\getparameters[\??nh#1][\c!label=#1,#2]%
@@ -183,14 +183,15 @@
\doifelse{#1}{#2}
{\getparameters[\??nh#1][\c!label=#1]%
\doifundefined{\??li#1}{\definelist[#1][\c!prefix=\v!no]}}% definestructurelist ?
- {\getparameters[\??nh#1][\s!parent=\??nh#2,\c!label=#1]%
+ {\getparameters[\??nh#1][\s!parent=\??nh#2,\c!label=#1,\c!coupling=#2]%
\definemarking[#1][#2]%
\definemarking[#1\v!number][#2\c!number]%
\doifundefined{\??li#1}{\definelist[#1][#2][\c!prefix=\v!no]}}% definestructurelist ?
\the\everystructureheadsetup}
\appendtoks
- \setstructurelevel\currentstructurehead{\structuresectionheadsection{\structuresectionheadcoupling\currentstructurehead}}%
+% \setstructurelevel\currentstructurehead{\structuresectionheadsection{\structuresectionheadcoupling\currentstructurehead}}%
+ \setstructurelevel\currentstructurehead{\thenamedstructureheadlevel\currentstructurehead}%
\doifelse{\structureheadparameter\c!ownnumber}\v!yes
{\setevalue\currentstructurehead{\noexpand\dohandlestructureheadown[\currentstructurehead]}}
{\setevalue\currentstructurehead{\noexpand\dohandlestructureheadnop[\currentstructurehead]}}%
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv
index 7b119f578..995a0cb6e 100644
--- a/tex/context/base/syst-aux.mkiv
+++ b/tex/context/base/syst-aux.mkiv
@@ -350,14 +350,16 @@
%D The next one is handy in predictable situations:
-\def\doiffastoptionalcheckelse
- {\futurelet\nexttoken\dodoiffastoptionalcheckelse}
+\long\def\doiffastoptionalcheckelse#1#2%
+ {\def\nextoptionalcommandyes{#1}%
+ \def\nextoptionalcommandnop{#2}%
+ \futurelet\nexttoken\dodoiffastoptionalcheckelse}
\def\dodoiffastoptionalcheckelse
{\ifx\nexttoken\nextoptionalcharactertoken
- \expandafter\firstoftwoarguments
+ \expandafter\nextoptionalcommandyes
\else
- \expandafter\secondoftwoarguments
+ \expandafter\nextoptionalcommandnop
\fi}
%D This macro uses some auxiliary macros. Although we were able
diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv
index af2b50c86..bfff978ab 100644
--- a/tex/context/base/tabl-tbl.mkiv
+++ b/tex/context/base/tabl-tbl.mkiv
@@ -792,17 +792,17 @@
\def\doparsetabulate
{\futurelet\next\dodoparsetabulate}
-\def\dodoparsetabulate % \@EAEAEA gebruiken
- {\ifx\next\relax
- % exit
- \else\ifx*\next
- \let\next\dorepeatparsetabulate
- \else\ifx\bgroup\next
- \let\next\dododoparsetabulate
- \else
- \let\next\dodododoparsetabulate
- \fi\fi\fi
- \next}%
+% \def\dodoparsetabulate % \@EAEAEA gebruiken
+% {\ifx\next\relax
+% % exit
+% \else\ifx*\next
+% \let\next\dorepeatparsetabulate
+% \else\ifx\bgroup\next
+% \let\next\dododoparsetabulate
+% \else
+% \let\next\dodododoparsetabulate
+% \fi\fi\fi
+% \next}%
\def\dorepeatparsetabulate*#1#2%
{\dorecurse{#1}{\!!toksb\expandafter{\the\!!toksb#2}}% \dorecurse{#1}{\appendtoks#2\to\!!toksb}%
@@ -816,6 +816,14 @@
{\!!toksb\expandafter{\the\!!toksb#1}% \appendtoks#1\to\!!toksb
\doparsetabulate}
+\letvalue{\??tt<\meaning *}\dorepeatparsetabulate
+\letvalue{\??tt<\meaning \bgroup}\dododoparsetabulate
+\letvalue{\??tt<\meaning \relax}\donothing
+\letvalue{\??tt<\s!unknown }\dodododoparsetabulate
+
+\def\dodoparsetabulate
+ {\csname\??tt<\ifcsname\??tt<\meaning\next\endcsname\meaning\next\else\s!unknown\fi\endcsname}
+
\setvalue{\??tt:\c!split:\v!yes }{\splittabulatetrue}
\setvalue{\??tt:\c!split:\v!repeat}{\splittabulatetrue}
\setvalue{\??tt:\c!split:\v!no }{\splittabulatefalse}
diff --git a/tex/context/bib/t-bib.tex b/tex/context/bib/t-bib.tex
index 11ed1309c..876bad8e2 100644
--- a/tex/context/bib/t-bib.tex
+++ b/tex/context/bib/t-bib.tex
@@ -1092,7 +1092,7 @@
\else\ifcsname#2\s!en#3\endcsname
\csname#2\s!en#3\endcsname
\fi\fi
- \fi\fi}
+ \fi\fi}
\def\docompletepublications[#1]%
{\begingroup
@@ -1435,7 +1435,7 @@
\edef\currentbibauthor{\currentbibauthor ##1\bibalternative{andtext}}%
\else
\edef\currentbibauthor{\currentbibauthor ##1\bibalternative{namesep}}%
- \fi
+ \fi
\fi }%
\processcommalist[#2]\bibprocessauthoritem }
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index a44570a48..3834afce5 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 08/17/09 19:08:24
+-- merge date : 08/19/09 17:12:50
do -- begin closure to overcome local limits and interference