summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-10-29 21:26:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-10-29 21:26:00 +0100
commit16fcd7eb3abb97077d17573838095b37a05fbcf0 (patch)
tree03318f16c5f80130293c6a31318eb7ec743924f0
parent17edf6ae96ce4e5e8eeaadc47bb3abc321fc2f6e (diff)
downloadcontext-16fcd7eb3abb97077d17573838095b37a05fbcf0.tar.gz
beta 2009.10.29 21:26
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/font-ini.lua1
-rw-r--r--tex/context/base/font-ini.mkiv2
-rw-r--r--tex/context/base/math-vfu.lua2
-rw-r--r--tex/context/base/scrn-int.mkiv2
-rw-r--r--tex/context/base/spac-ver.mkiv30
-rw-r--r--tex/context/base/strc-des.mkiv59
-rw-r--r--tex/context/base/strc-not.mkiv6
-rw-r--r--tex/context/base/strc-ref.lua21
-rw-r--r--tex/context/base/strc-ref.mkiv66
-rw-r--r--tex/context/base/strc-ren.mkiv3
-rw-r--r--tex/context/base/strc-sec.mkiv3
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua3
14 files changed, 178 insertions, 24 deletions
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 5686e4764..8a2b1faf8 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.10.28 19:27}
+\newcontextversion{2009.10.29 21:26}
%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.tex b/tex/context/base/context.tex
index 3a3736d9d..82e0e9451 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.10.28 19:27}
+\edef\contextversion{2009.10.29 21:26}
%D For those who want to use this:
diff --git a/tex/context/base/font-ini.lua b/tex/context/base/font-ini.lua
index 5feb512b0..5cff22760 100644
--- a/tex/context/base/font-ini.lua
+++ b/tex/context/base/font-ini.lua
@@ -32,6 +32,7 @@ fonts.verbose = false -- more verbose cache tables
fonts.ids[0] = { -- nullfont
characters = { },
descriptions = { },
+ name = "nullfont",
}
fonts.methods = fonts.methods or {
diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv
index 936b6e537..3ce821a39 100644
--- a/tex/context/base/font-ini.mkiv
+++ b/tex/context/base/font-ini.mkiv
@@ -2958,6 +2958,8 @@
\chardef\currentxfontsize\zerocount
\redoconvertfont
\tf
+ \the\everybodyfont % indeed needed
+ \the\everyglobalbodyfont % indeed needed
\saveinterlinespace}
\def\restoreglobalbodyfont % ook style etc
diff --git a/tex/context/base/math-vfu.lua b/tex/context/base/math-vfu.lua
index 35c488a39..908bcdf53 100644
--- a/tex/context/base/math-vfu.lua
+++ b/tex/context/base/math-vfu.lua
@@ -360,7 +360,7 @@ function fonts.vf.math.define(specification,set)
for unicode, index in next, vector do
local fci = fc[index]
if not fci then
- local fontname = fs.name
+ local fontname = fs.name or "unknown"
local rf = reported[fontname]
if not rf then rf = { } reported[fontname] = rf end
local rv = rf[vectorname]
diff --git a/tex/context/base/scrn-int.mkiv b/tex/context/base/scrn-int.mkiv
index a68c374dd..91a42f706 100644
--- a/tex/context/base/scrn-int.mkiv
+++ b/tex/context/base/scrn-int.mkiv
@@ -13,6 +13,8 @@
\writestatus{loading}{ConTeXt Screen Macros / Interaction}
+\registerctxluafile{scrn-int}{1.001}
+
\unprotect
%D This is an update of \MKII\ code. In the process profiles and versions
diff --git a/tex/context/base/spac-ver.mkiv b/tex/context/base/spac-ver.mkiv
index 7cf33169b..5aca501be 100644
--- a/tex/context/base/spac-ver.mkiv
+++ b/tex/context/base/spac-ver.mkiv
@@ -141,11 +141,6 @@
{\doifassignmentelse{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]%
\the\iflocalinterlinespace\everysetuplocalinterlinespace\else\everysetupglobalinterlinespace\fi}
-\def\setuplocalinterlinespace[#1]%
- {\localinterlinespacetrue
- \setupinterlinespace[#1]%
- \localinterlinespacefalse}
-
\def\simplesetupinterlinespace % adapts to the font
{\localinterlinespacetrue
\setfontparameters
@@ -153,6 +148,31 @@
\the\everysetuplocalinterlinespace
\localinterlinespacefalse}
+\unexpanded\def\setuplocalinterlinespace[#1]%
+ {\localinterlinespacetrue
+ \let\@@saveditheight \@@itheight
+ \let\@@saveditdepth \@@itdepth
+ \let\@@saveditline \@@itline
+ \let\@@saveditminheight\@@itminheight
+ \let\@@saveditmindepth \@@itmindepth
+ \let\@@saveditdistance \@@itdistance
+ \let\@@savedittop \@@ittop
+ \let\@@saveditbottom \@@itbottom
+ \let\@@saveditstretch \@@itstretch
+ \setupinterlinespace[#1]%
+ \let\@@itheight \@@saveditheight
+ \let\@@itdepth \@@saveditdepth
+ \let\@@itline \@@saveditline
+ \let\@@itminheight\@@saveditminheight
+ \let\@@itmindepth \@@saveditmindepth
+ \let\@@itdistance \@@saveditdistance
+ \let\@@ittop \@@savedittop
+ \let\@@itbottom \@@saveditbottom
+ \let\@@itstretch \@@saveditstretch
+ \localinterlinespacefalse}
+
+\let\switchtointerlinespace\setuplocalinterlinespace
+
\definecomplexorsimple\setupinterlinespace
\def\removelastskip % a redefinition of plain
diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv
index 6fe72a54f..779cf38c9 100644
--- a/tex/context/base/strc-des.mkiv
+++ b/tex/context/base/strc-des.mkiv
@@ -727,29 +727,56 @@
\def\dododescriptioncomponent[#1][#2]% #1=interfaced-settings, #2=optional user data
{\begingroup % similar to structure so we might generalize this
\getparameters[\??dd\currentdescription][#1]%
- \edef\currentdescriptionexpansion{\descriptionparameter\c!expansion}%
+ %
+ \xdef\currentdescriptionexpansion {\descriptionparameter\c!expansion}%
+ \xdef\currentdescriptionxmlsetup {\descriptionparameter\c!xmlsetup}%
+ \xdef\currentdescriptioncatcodes {\descriptionparameter\s!catcodes}%
+ \xdef\currentdescriptionlabel {\descriptionparameter\c!label}%
+ \xdef\currentdescriptionreference {\descriptionparameter\c!reference}%
+ \xdef\currentdescriptionreferenceprefix{\descriptionparameter\c!referenceprefix}%
+ %xdef\currentdescriptionshownumber {\descriptionparameter\c!number}%
+ \xdef\currentdescriptionsaveinlist {\descriptionparameter\c!saveinlist}%
+ \xdef\currentdescriptionincrementnumber{\descriptionparameter\c!incrementnumber}%
+ %
+ \ifx\currentdescriptionexpansion\empty
+ \glet\currentdescriptionexpansion\v!no
+ \fi
+ %
\ifx\currentdescriptionexpansion\s!xml
- \xdef\currentdescriptiontitle {\detokenizeddescriptionparameter\c!title}%
- \xdef\currentdescriptionbookmark{\detokenizeddescriptionparameter\c!bookmark}%
\xmlstartraw
- \xdef\currentdescriptionlisttitle {\descriptionparameter\c!title}%
+ \xdef\currentdescriptiontitle {\descriptionparameter\c!title}%
+ \xdef\currentdescriptionbookmark{\descriptionparameter\c!bookmark}%
+ \xdef\currentdescriptionmarking {\descriptionparameter\c!marking}%
+ \xdef\currentdescriptionlist {\descriptionparameter\c!list}%
\xmlstopraw
+ \ifx\currentdescriptionlist\empty
+ \globallet\currentdescriptionlist\currentdescriptiontitle
+ \fi
\globallet\currentdescriptioncoding\s!xml
\else
\ifx\currentdescriptionexpansion\v!yes
\xdef\currentdescriptiontitle {\descriptionparameter\c!title}%
\xdef\currentdescriptionbookmark{\descriptionparameter\c!bookmark}%
+ \xdef\currentdescriptionmarking {\descriptionparameter\c!marking}%
+ \xdef\currentdescriptionlist {\descriptionparameter\c!list}%
\else
\xdef\currentdescriptiontitle {\detokenizeddescriptionparameter\c!title}%
\xdef\currentdescriptionbookmark{\detokenizeddescriptionparameter\c!bookmark}%
+ \xdef\currentdescriptionmarking {\detokenizeddescriptionparameter\c!marking}%
+ \xdef\currentdescriptionlist {\detokenizeddescriptionparameter\c!list}%
+ \iflocation \ifx\currentdescriptionbookmark\empty
+ \begingroup
+ \simplifycommands
+ \xdef\currentdescriptionbookmark{\detokenize\expandafter{\normalexpanded{\descriptionparameter\c!title}}}%
+ \endgroup
+ \fi \fi
+ \fi
+ \ifx\currentdescriptionlist\empty
+ \globallet\currentdescriptionlist\currentdescriptiontitle
\fi
- \globallet\currentdescriptionlisttitle \currentdescriptiontitle
\globallet\currentdescriptioncoding\s!tex
\fi
- \xdef\currentdescriptionlabel {\descriptionparameter\c!label}%
- \xdef\currentdescriptionreference{\descriptionparameter\c!reference}%
%
-% \doif{\descriptionparameter\c!title}\v!none{\global\nodescriptioncaptiontrue\global\nodescriptionnumbertrue}% will become obsolete
\ifx\currentdescriptiontitle\v!none % will become obsolete
\global\nodescriptioncaptiontrue\global\nodescriptionnumbertrue
\fi
@@ -784,8 +811,8 @@
\ifx\currentdescriptionbookmark\currentdescriptiontitle \else
bookmark = \!!bs\detokenize\expandafter{\currentdescriptionbookmark}\!!es,
\fi
- \ifx\currentdescriptionlisttitle\currentdescriptiontitle \else % \ifx\currentdescriptionsaveinlist\v!no
- list = \!!bs\detokenize\expandafter{\currentdescriptionlisttitle }\!!es,
+ \ifx\currentdescriptionlist\currentdescriptiontitle \else % \ifx\currentdescriptionsaveinlist\v!no
+ list = \!!bs\detokenize\expandafter{\currentdescriptionlist }\!!es,
\fi % \fi
},
\ifconditional\enumerationnumberenabled
@@ -988,6 +1015,18 @@
\c!start=0,
\s!parent=\??dd]
+\setupdescriptions
+ [\c!expansion=\v!no,
+ \c!xmlsetup=,
+ \s!catcodes=,
+ \c!saveinlist=\v!yes]
+
+\setupenumerations
+ [\c!expansion=\v!no,
+ \c!xmlsetup=,
+ \s!catcodes=,
+ \c!saveinlist=\v!yes]
+
\setuplabels
[\s!parent=\??dn]
diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv
index 4598be00c..7a1d97852 100644
--- a/tex/context/base/strc-not.mkiv
+++ b/tex/context/base/strc-not.mkiv
@@ -190,6 +190,12 @@
\c!next=\autoinsertnextspace, % new, experimental with startnotes
\c!n=1]
+\setupnotes
+ [\c!expansion=\v!no,
+ \c!xmlsetup=,
+ \s!catcodes=,
+ \c!saveinlist=\v!yes]
+
\def\@@defaultnotedefloc{\v!inleft}
\def\@@defaultnotedefdis{\!!zeropoint}
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index f702e6b1a..f0f660977 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -823,15 +823,26 @@ end
--
-function jobreferences.get_current_kind()
+function jobreferences.get_current_metadata(tag)
local data = currentreference and currentreference.i
+ data = data and data.metadata and data.metadata[tag]
if data then
- local kind = data.metadata and data.metadata.kind
- if kind then
- texsprint(ctxcatcodes,kind)
- end
+ texsprint(ctxcatcodes,data)
end
end
+local function current_metadata(tag)
+ local data = currentreference and currentreference.i
+ return data and data.metadata and data.metadata[tag]
+end
+jobreferences.current_metadata = current_metadata
+
+function jobreferences.get_current_prefixspec(default)
+ texsprint(ctxcatcodes,"\\getreferencestructureprefix{",
+ current_metadata("kind"), "}{", current_metadata("name"), "}{", default, "}")
+end
+--~ function jobreferences.get_current_prefixspec(default) -- we can consider storing the data at the lua end
+--~ context.getreferencestructureprefix(current_metadata("kind"),current_metadata("name"),default)
+--~ end
--
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index 5b61b48a8..71a4e2cbe 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -1721,6 +1721,72 @@
%D We cannot set up buttons (not yet, this one calls a menu macro):
+%D New (and experimental):
+
+% \starttext
+% \chapter{test}
+% \placefigure[here][xx:1]{}{\framed{one}} \placefigure[here][xx:2]{}{\framed{three}}
+% \placetable [here][xx:3]{}{\framed{two}} \placetable [here][xx:4]{}{\framed{four}}
+% \start
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank \start
+% \setupreferencestructureprefix[default][prefix=no]
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank \start
+% \setupreferencestructureprefix[float][default][prefix=no]
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank \start
+% \setupreferencestructureprefix[figure][default][prefix=no]
+% \in{fig}[xx:1] and \in{fig}[xx:2] \in{tab}[xx:3] and \in{tab}[xx:4]
+% \stop \blank
+% \stoptext
+
+\def\setupreferencestructureprefix
+ {\dotripleargument\dosetupreferencestructureprefix}
+
+\def\getreferencestructureprefix#1#2#3%
+ {{
+ prefix = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefix",
+ separatorset = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixseparatorset",
+ conversion = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconversion",
+ conversionset = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconversionset",
+ set = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixset",
+ segments = "\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixsegments",
+ connector = \!!bs\referencestructureprefixparameter{#1}{#2}{#3}\c!prefixconnector\!!es,
+ }}
+
+\def\setupreferencestructureprefix
+ {\dotripleempty\dosetupreferencestructureprefix}
+
+\def\dosetupreferencestructureprefix[#1][#2][#3]%
+ {\ifthirdargument
+ \getparameters[\??rf:\c!prefix:#1:#2][#3]%
+ \else\ifsecondargument
+ \getparameters[\??rf:\c!prefix::#1][#2]%
+ \fi\fi}
+
+\def\referencestructureprefixparameter#1#2#3#4% kind name category parameter
+ {\ifcsname\??rf:\c!prefix:#2:#3#4\endcsname
+ \csname\??rf:\c!prefix:#2:#3#4\endcsname
+ \else\ifcsname\??rf:\c!prefix:#1:#3#4\endcsname
+ \csname\??rf:\c!prefix:#1:#3#4\endcsname
+ \else\ifcsname\??rf:\c!prefix::#3#4\endcsname
+ \csname\??rf:\c!prefix::#3#4\endcsname
+ \fi\fi\fi}
+
+% \def\getreferencestructureprefixspec#1% we can save one call by moving this to the lua end
+% {\getreferencestructureprefix
+% {\ctxlua{jobreferences.get_current_metadata("kind")}}
+% {\ctxlua{jobreferences.get_current_metadata("name")}}
+% {#1}}
+% \def\currentreferencedefault
+% {\ctxlua{jobreferences.filter("default",\referencestructureprefixspec\v!default)}}
+%
+% this is shortcut for:
+
+\def\currentreferencedefault
+ {\ctxlua{jobreferences.filter("default",\ctxlua{jobreferences.get_current_prefixspec("\v!default")})}}
+
\protect \endinput
% tricky:
diff --git a/tex/context/base/strc-ren.mkiv b/tex/context/base/strc-ren.mkiv
index 4a019837e..30edea322 100644
--- a/tex/context/base/strc-ren.mkiv
+++ b/tex/context/base/strc-ren.mkiv
@@ -324,6 +324,9 @@
{\setvalue{\??ns:#1}{#2}%
\setvalue{\??ns::#1}}
+\def\presetnumberheadalternative
+ {\doifelsevalue{\??ns:\numberheadalternative}\v!horizontal\setfalse\settrue\structureheadisdisplay}
+
% \def\normalplacehead
% {\executeifdefined
% {\??ns::\numberheadalternative}
diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv
index 87e38274b..d2e43138c 100644
--- a/tex/context/base/strc-sec.mkiv
+++ b/tex/context/base/strc-sec.mkiv
@@ -419,6 +419,8 @@
\endgraf
\endgroup}
+\ifdefined \else \let\presetnumberheadalternative\relax \fi
+
\def\dohandlestructurehead#1#2#3% name data userdata
{\xdef\currentstructurehead {#1}%
\xdef\currentstructureheadcoupling{\structuresectionheadcoupling\currentstructurehead}%
@@ -447,6 +449,7 @@
%
\edef\numberheaddistance {\structureheadparameter\c!distance }% compatibility
\edef\numberheadalternative{\structureheadparameter\c!alternative}% compatibility
+ \presetnumberheadalternative
%
\let\getstructureheadnumber\empty
\let\getstructureheadtitle \empty
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index b23f4d70d..f3a2ea70c 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 : 10/28/09 19:32:33
+-- merge date : 10/29/09 21:30:47
do -- begin closure to overcome local limits and interference
@@ -3164,6 +3164,7 @@ fonts.verbose = false -- more verbose cache tables
fonts.ids[0] = { -- nullfont
characters = { },
descriptions = { },
+ name = "nullfont",
}
fonts.methods = fonts.methods or {