diff options
Diffstat (limited to 'tex')
37 files changed, 443 insertions, 215 deletions
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex a13d3088a..63825bb1f 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii index 20cad141b..b85a88918 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{ersteseite} \setinterfaceconstant{focus}{focus} \setinterfaceconstant{focusin}{focusin} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{focusout} \setinterfaceconstant{footer}{fusszeile} \setinterfaceconstant{footerdistance}{fusszeilenabstand} diff --git a/tex/context/base/mkii/mult-en.mkii b/tex/context/base/mkii/mult-en.mkii index 325d5890b..969b9c475 100644 --- a/tex/context/base/mkii/mult-en.mkii +++ b/tex/context/base/mkii/mult-en.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{firstpage} \setinterfaceconstant{focus}{focus} \setinterfaceconstant{focusin}{focusin} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{focusout} \setinterfaceconstant{footer}{footer} \setinterfaceconstant{footerdistance}{footerdistance} diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index efd5f442b..fd848c789 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{premierepage} \setinterfaceconstant{focus}{focus} \setinterfaceconstant{focusin}{focusin} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{focusout} \setinterfaceconstant{footer}{pdp} \setinterfaceconstant{footerdistance}{dsitancepdp} diff --git a/tex/context/base/mkii/mult-it.mkii b/tex/context/base/mkii/mult-it.mkii index 5b2ecaa13..7fa59db62 100644 --- a/tex/context/base/mkii/mult-it.mkii +++ b/tex/context/base/mkii/mult-it.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{primapagina} \setinterfaceconstant{focus}{focus} \setinterfaceconstant{focusin}{focusin} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{focusout} \setinterfaceconstant{footer}{piedipagina} \setinterfaceconstant{footerdistance}{distanzapdp} diff --git a/tex/context/base/mkii/mult-nl.mkii b/tex/context/base/mkii/mult-nl.mkii index dfd241c38..375bbe835 100644 --- a/tex/context/base/mkii/mult-nl.mkii +++ b/tex/context/base/mkii/mult-nl.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{eerstepagina} \setinterfaceconstant{focus}{focus} \setinterfaceconstant{focusin}{focusin} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{focusuit} \setinterfaceconstant{footer}{voet} \setinterfaceconstant{footerdistance}{voetafstand} diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii index 4275e3874..f889726a8 100644 --- a/tex/context/base/mkii/mult-pe.mkii +++ b/tex/context/base/mkii/mult-pe.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{صفحهاول} \setinterfaceconstant{focus}{تمرکز} \setinterfaceconstant{focusin}{تمرکزدرون} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{تمرکزبیرون} \setinterfaceconstant{footer}{تهبرگ} \setinterfaceconstant{footerdistance}{فاصلهتهبرگ} diff --git a/tex/context/base/mkii/mult-ro.mkii b/tex/context/base/mkii/mult-ro.mkii index 9926be0ce..d8d731a05 100644 --- a/tex/context/base/mkii/mult-ro.mkii +++ b/tex/context/base/mkii/mult-ro.mkii @@ -795,6 +795,7 @@ \setinterfaceconstant{firstpage}{primapagina} \setinterfaceconstant{focus}{focus} \setinterfaceconstant{focusin}{focusin} +\setinterfaceconstant{focusoffset}{focusoffset} \setinterfaceconstant{focusout}{focusout} \setinterfaceconstant{footer}{subsol} \setinterfaceconstant{footerdistance}{distantasubsol} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 8687bf616..0ca1ff640 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.03.02 16:55} +\newcontextversion{2016.03.03 23:31} %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 d8a2e57de..63c95ce2a 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.03.02 16:55} +\edef\contextversion{2016.03.03 23:31} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-syn.lua b/tex/context/base/mkiv/font-syn.lua index 3bfc62d41..f750f92e9 100644 --- a/tex/context/base/mkiv/font-syn.lua +++ b/tex/context/base/mkiv/font-syn.lua @@ -607,8 +607,8 @@ local function check_name(data,result,filename,modification,suffix,subfont) -- we do these sparse -- todo: check table type or change names in ff loader local units = result.units or 1000 -- can be zero too local designsize = result.designsize or 0 - local minsize = result.mindesign or 0 - local maxsize = result.maxdesign or 0 + local minsize = result.minsize or 0 + local maxsize = result.maxsize or 0 local angle = result.italicangle or 0 local pfmwidth = result.pfmwidth or 0 local pfmweight = result.pfmweight or 0 diff --git a/tex/context/base/mkiv/lpdf-ano.lua b/tex/context/base/mkiv/lpdf-ano.lua index 657ff17e5..72800bc64 100644 --- a/tex/context/base/mkiv/lpdf-ano.lua +++ b/tex/context/base/mkiv/lpdf-ano.lua @@ -350,21 +350,39 @@ local v_tight = variables.tight -- todo: scaling +-- local destinationactions = { +-- [v_standard] = function(r,w,h,d) return f_xyz (r,gethpos()*factor,(getvpos()+h)*factor) end, -- local left,top with no zoom +-- [v_frame] = function(r,w,h,d) return f_fitr (r,pdfrectangle(w,h,d)) end, -- fit rectangle in window +-- [v_width] = function(r,w,h,d) return f_fith (r,(getvpos()+h)*factor) end, -- top coordinate, fit width of page in window +-- [v_minwidth] = function(r,w,h,d) return f_fitbh(r,(getvpos()+h)*factor) end, -- top coordinate, fit width of content in window +-- [v_height] = function(r,w,h,d) return f_fitv (r,gethpos()*factor) end, -- left coordinate, fit height of page 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 +-- [v_fit] = f_fit, +-- } + local destinationactions = { - -- [v_standard] = function(r,w,h,d) return f_xyz (r,pdfrectangle(w,h,d)) end, -- local left,top with zoom (0 in our case) - [v_standard] = function(r,w,h,d) return f_xyz (r,gethpos()*factor,(getvpos()+h)*factor) end, -- local left,top with no zoom - [v_frame] = function(r,w,h,d) return f_fitr (r,pdfrectangle(w,h,d)) end, -- fit rectangle in window - -- [v_width] = function(r,w,h,d) return f_fith (r,gethpos()*factor) end, -- top coordinate, fit width of page in window - [v_width] = function(r,w,h,d) return f_fith (r,(getvpos()+h)*factor) end, -- top coordinate, fit width of page in window - -- [v_minwidth] = function(r,w,h,d) return f_fitbh(r,gethpos()*factor) end, -- top coordinate, fit width of content in window - [v_minwidth] = function(r,w,h,d) return f_fitbh(r,(getvpos()+h)*factor) end, -- top coordinate, fit width of content in window - -- [v_height] = function(r,w,h,d) return f_fitv (r,(getvpos()+h)*factor) end, -- left coordinate, fit height of page in window - [v_height] = function(r,w,h,d) return f_fitv (r,gethpos()*factor) end, -- left coordinate, fit height of page in window - -- [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, + [v_standard] = function(r,w,h,d,o) -- local left,top with no zoom + local tx, ty = getpos() + return f_xyz(r,tx*factor,(ty+h+2*o)*factor) -- we can assume margins + end, + [v_frame] = function(r,w,h,d,o) -- fit rectangle in window + return f_fitr(r,pdfrectangle(w,h,d,o)) + end, + [v_width] = function(r,w,h,d,o) -- top coordinate, fit width of page in window + return f_fith(r,(getvpos()+h+o)*factor) + end, + [v_minwidth] = function(r,w,h,d,o) -- top coordinate, fit width of content in window + return f_fitbh(r,(getvpos()+h+o)*factor) + end, + [v_height] = function(r,w,h,d,o) -- left coordinate, fit height of page in window + return f_fitv(r,(gethpos())*factor) + end, + [v_minheight] = function(r,w,h,d,o) -- left coordinate, fit height of content in window + return f_fitbv(r,(gethpos())*factor) + end, + [v_tight] = f_fitb, -- fit content in window + [v_fit] = f_fit, -- fit content in window } local mapping = { @@ -380,6 +398,11 @@ local mapping = { local defaultview = v_fit local defaultaction = destinationactions[defaultview] +local offset = 0 -- 65536*5 + +directives.register("destinations.offset", function(v) + offset = string.todimen(v) or 0 +end) -- 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 now @@ -397,7 +420,7 @@ local function flushdestination(width,height,depth,names,view) r = pagedestinations[r] else local action = view and destinationactions[view] or defaultaction - r = pdfdelayedobject(action(r,width,height,depth)) + r = pdfdelayedobject(action(r,width,height,depth,offset)) end for n=1,#names do local name = names[n] @@ -422,7 +445,8 @@ function nodeinjections.destination(width,height,depth,names,view) if method == v_page then for n=1,#names do local name = names[n] - if usedviews[name] then + local used = usedviews[name] + if used and used ~= true then -- already done, maybe a warning elseif type(name) == "number" then -- if noview then @@ -439,7 +463,8 @@ function nodeinjections.destination(width,height,depth,names,view) elseif method == v_name then for n=1,#names do local name = names[n] - if usedviews[name] then + local used = usedviews[name] + if used and used ~= true then -- already done, maybe a warning elseif type(name) == "number" then local used = usedinternals[name] @@ -668,7 +693,7 @@ local share = true 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) +directives.register("references.sharelinks", function(v) share = v end) setmetatableindex(hashed,function(t,k) local v = pdfdelayedobject(k) diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua index fabb45286..e2a85bccf 100644 --- a/tex/context/base/mkiv/lpdf-ini.lua +++ b/tex/context/base/mkiv/lpdf-ini.lua @@ -213,8 +213,15 @@ end -- funny values for tx and ty -function lpdf.rectangle(width,height,depth) +function lpdf.rectangle(width,height,depth,offset) local tx, ty = pdfgetpos() + if offset then + tx = tx - offset + ty = ty + offset + width = width + 2*offset + height = height + offset + depth = depth + offset + end if pdfhasmatrix() then local rx, sx, sy, ry = pdfgetmatrix() return diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua index f4d0a01a9..7a6268876 100644 --- a/tex/context/base/mkiv/mult-def.lua +++ b/tex/context/base/mkiv/mult-def.lua @@ -7859,6 +7859,10 @@ return { ["pe"]="تمرکزبیرون", ["ro"]="focusout", }, + ["focusoffset"]={ + ["en"]="focusoffset", + ["nl"]="focusoffset", + }, ["footer"]={ ["cs"]="upati", ["de"]="fusszeile", diff --git a/tex/context/base/mkiv/node-ref.lua b/tex/context/base/mkiv/node-ref.lua index ca408b44d..9f2d0918c 100644 --- a/tex/context/base/mkiv/node-ref.lua +++ b/tex/context/base/mkiv/node-ref.lua @@ -832,8 +832,6 @@ function references.inject(prefix,reference,specification) -- todo: use currentr if bug or #set == 0 then -- unknown ref, just don't set it and issue an error else - -- nil prefix when "" - -- check set.highlight = specification.highlight set.newwindow = specification.newwindow set.layer = specification.layer @@ -841,20 +839,19 @@ function references.inject(prefix,reference,specification) -- todo: use currentr end end -function references.injectinternal(internal,specification) -- todo: use currentreference is possible - local set = references.internals[internal] - if set then - -- unknown ref, just don't set it and issue an error - else - -- nil prefix when "" - -- check - set = { set } - set.highlight = specification.highlight - set.newwindow = specification.newwindow - set.layer = specification.layer - setreference(specification.height,specification.depth,set) -- sets attribute / todo: for set[*].error - end -end +-- function references.injectinternal(internal,specification) +-- references.inject("","internal("..internal..")",specification) +-- if bug or #set == 0 then +-- -- unknown ref, just don't set it and issue an error +-- else +-- -- nil prefix when "" +-- -- check +-- set.highlight = specification.highlight +-- set.newwindow = specification.newwindow +-- set.layer = specification.layer +-- setreference(specification.height,specification.depth,set) -- sets attribute / todo: for set[*].error +-- end +-- end function references.injectcurrentset(h,d) -- used inside doifelse local currentset = references.currentset @@ -875,24 +872,26 @@ implement { { "layer" }, { "height", "dimen" }, { "depth", "dimen" }, + { "view" }, } } } -implement { - name = "injectinternalreference", - actions = references.injectinternal, - arguments = { - "integer", - { - { "highlight", "boolean" }, - { "newwindow", "boolean" }, - { "layer" }, - { "height", "dimen" }, - { "depth", "dimen" }, - } - } -} +-- implement { +-- name = "injectinternalreference", +-- actions = references.injectinternal, +-- arguments = { +-- "integer", +-- { +-- { "highlight", "boolean" }, +-- { "newwindow", "boolean" }, +-- { "layer" }, +-- { "height", "dimen" }, +-- { "depth", "dimen" }, +-- { "view" }, +-- } +-- } +-- } implement { name = "injectcurrentreference", diff --git a/tex/context/base/mkiv/page-txt.mkvi b/tex/context/base/mkiv/page-txt.mkvi index ed1104312..515d16e13 100644 --- a/tex/context/base/mkiv/page-txt.mkvi +++ b/tex/context/base/mkiv/page-txt.mkvi @@ -177,77 +177,160 @@ % An alternative approach is to have more variables but that does not % make the code less complex (probably more). -\def\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c][#d]% - {\ifsixthargument - \edef\currentlayoutelement{#vertical:#horizontal}% - \setlayoutelementparameter\c!lefttext - {\page_layouts_process_element_double - \c!leftstyle \c!leftcolor \c!leftwidth {#a}% - \c!rightstyle\c!rightcolor\c!rightwidth{#d}}% - \setlayoutelementparameter\c!righttext - {\page_layouts_process_element_double - \c!rightstyle\c!rightcolor\c!rightwidth{#b}% - \c!leftstyle \c!leftcolor \c!leftwidth {#c}}% - \else\iffifthargument - \edef\currentlayoutelement{#vertical:\v!text}% - \setlayoutelementparameter\c!lefttext - {\page_layouts_process_element_double - \c!leftstyle \c!leftcolor \c!leftwidth {#horizontal}% - \c!rightstyle\c!rightcolor\c!rightwidth{#c}}% - \setlayoutelementparameter\c!righttext - {\page_layouts_process_element_double - \c!rightstyle\c!rightcolor\c!rightwidth{#a}% - \c!leftstyle \c!leftcolor \c!leftwidth {#b}}% - \else\iffourthargument - \edef\currentlayoutelement{#vertical:#horizontal}% - \doifelsenothing{\detokenize{#a}} - {\resetlayoutelementparameter\c!lefttext} - {\setlayoutelementparameter\c!lefttext - {\page_layouts_process_element_double - \c!leftstyle\c!leftcolor\c!leftwidth{#a}% - \c!leftstyle\c!leftcolor\c!leftwidth{#a}}}% - \doifelsenothing{\detokenize{#b}} - {\resetlayoutelementparameter\c!righttext} - {\setlayoutelementparameter\c!righttext - {\page_layouts_process_element_double - \c!rightstyle\c!rightcolor\c!rightwidth{#b}% - \c!rightstyle\c!rightcolor\c!rightwidth{#b}}}% - \else\ifthirdargument - \edef\currentlayoutelement{#vertical:\v!text}% - \doifelsenothing{\detokenize{#horizontal}} - {\resetlayoutelementparameter\c!lefttext} - {\setlayoutelementparameter\c!lefttext - {\page_layouts_process_element_double - \c!leftstyle\c!leftcolor\c!leftwidth{#horizontal}% - \c!leftstyle\c!leftcolor\c!leftwidth{#horizontal}}}% - \doifelsenothing{\detokenize{#a}} - {\resetlayoutelementparameter\c!righttext} - {\setlayoutelementparameter\c!righttext - {\page_layouts_process_element_double - \c!rightstyle\c!rightcolor\c!rightwidth{#a}% - \c!rightstyle\c!rightcolor\c!rightwidth{#a}}}% - \else\ifsecondargument - \edef\currentlayoutelement{#vertical:\v!text}% - \resetlayoutelementparameter\c!lefttext - \resetlayoutelementparameter\c!righttext - \doifelsenothing{\detokenize{#horizontal}} - {\resetlayoutelementparameter\c!middletext} - {\setlayoutelementparameter\c!middletext - {\page_layouts_process_element_single\c!style\c!color\c!width{#horizontal}}}% - \else - \edef\currentlayoutelement{#vertical:\v!text}% - \resetlayoutelementparameter\c!lefttext - \resetlayoutelementparameter\c!righttext - \resetlayoutelementparameter\c!middletext - \edef\currentlayoutelement{#vertical:\v!margin}% - \resetlayoutelementparameter\c!lefttext - \resetlayoutelementparameter\c!righttext - \resetlayoutelementparameter\c!middletext - \edef\currentlayoutelement{#vertical:\v!edge}% - \resetlayoutelementparameter\c!lefttext - \resetlayoutelementparameter\c!righttext - \resetlayoutelementparameter\c!middletext - \fi\fi\fi\fi\fi} +% \unexpanded\def\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c][#d]% +% {\ifsixthargument +% \edef\currentlayoutelement{#vertical:#horizontal}% +% \setlayoutelementparameter\c!lefttext +% {\page_layouts_process_element_double +% \c!leftstyle \c!leftcolor \c!leftwidth {#a}% +% \c!rightstyle\c!rightcolor\c!rightwidth{#d}}% +% \setlayoutelementparameter\c!righttext +% {\page_layouts_process_element_double +% \c!rightstyle\c!rightcolor\c!rightwidth{#b}% +% \c!leftstyle \c!leftcolor \c!leftwidth {#c}}% +% \else\iffifthargument +% \edef\currentlayoutelement{#vertical:\v!text}% +% \setlayoutelementparameter\c!lefttext +% {\page_layouts_process_element_double +% \c!leftstyle \c!leftcolor \c!leftwidth {#horizontal}% +% \c!rightstyle\c!rightcolor\c!rightwidth{#c}}% +% \setlayoutelementparameter\c!righttext +% {\page_layouts_process_element_double +% \c!rightstyle\c!rightcolor\c!rightwidth{#a}% +% \c!leftstyle \c!leftcolor \c!leftwidth {#b}}% +% \else\iffourthargument +% \edef\currentlayoutelement{#vertical:#horizontal}% +% \doifelsenothing{\detokenize{#a}} +% {\resetlayoutelementparameter\c!lefttext} +% {\setlayoutelementparameter\c!lefttext +% {\page_layouts_process_element_double +% \c!leftstyle\c!leftcolor\c!leftwidth{#a}% +% \c!leftstyle\c!leftcolor\c!leftwidth{#a}}}% +% \doifelsenothing{\detokenize{#b}} +% {\resetlayoutelementparameter\c!righttext} +% {\setlayoutelementparameter\c!righttext +% {\page_layouts_process_element_double +% \c!rightstyle\c!rightcolor\c!rightwidth{#b}% +% \c!rightstyle\c!rightcolor\c!rightwidth{#b}}}% +% \else\ifthirdargument +% \edef\currentlayoutelement{#vertical:\v!text}% +% \doifelsenothing{\detokenize{#horizontal}} +% {\resetlayoutelementparameter\c!lefttext} +% {\setlayoutelementparameter\c!lefttext +% {\page_layouts_process_element_double +% \c!leftstyle\c!leftcolor\c!leftwidth{#horizontal}% +% \c!leftstyle\c!leftcolor\c!leftwidth{#horizontal}}}% +% \doifelsenothing{\detokenize{#a}} +% {\resetlayoutelementparameter\c!righttext} +% {\setlayoutelementparameter\c!righttext +% {\page_layouts_process_element_double +% \c!rightstyle\c!rightcolor\c!rightwidth{#a}% +% \c!rightstyle\c!rightcolor\c!rightwidth{#a}}}% +% \else\ifsecondargument +% \edef\currentlayoutelement{#vertical:\v!text}% +% \resetlayoutelementparameter\c!lefttext +% \resetlayoutelementparameter\c!righttext +% \doifelsenothing{\detokenize{#horizontal}} +% {\resetlayoutelementparameter\c!middletext} +% {\setlayoutelementparameter\c!middletext +% {\page_layouts_process_element_single\c!style\c!color\c!width{#horizontal}}}% +% \else +% \edef\currentlayoutelement{#vertical:\v!text}% +% \resetlayoutelementparameter\c!lefttext +% \resetlayoutelementparameter\c!righttext +% \resetlayoutelementparameter\c!middletext +% \edef\currentlayoutelement{#vertical:\v!margin}% +% \resetlayoutelementparameter\c!lefttext +% \resetlayoutelementparameter\c!righttext +% \resetlayoutelementparameter\c!middletext +% \edef\currentlayoutelement{#vertical:\v!edge}% +% \resetlayoutelementparameter\c!lefttext +% \resetlayoutelementparameter\c!righttext +% \resetlayoutelementparameter\c!middletext +% \fi\fi\fi\fi\fi} + +\unexpanded\def\page_layouts_setup_text_six#vertical#horizontal#a#b#c#d% + {\edef\currentlayoutelement{#vertical:#horizontal}% + \setlayoutelementparameter\c!lefttext + {\page_layouts_process_element_double + \c!leftstyle \c!leftcolor \c!leftwidth {#a}% + \c!rightstyle\c!rightcolor\c!rightwidth{#d}}% + \setlayoutelementparameter\c!righttext + {\page_layouts_process_element_double + \c!rightstyle\c!rightcolor\c!rightwidth{#b}% + \c!leftstyle \c!leftcolor \c!leftwidth {#c}}} + +\unexpanded\def\page_layouts_setup_text_five#vertical#horizontal#a#b#c% + {\edef\currentlayoutelement{#vertical:\v!text}% + \setlayoutelementparameter\c!lefttext + {\page_layouts_process_element_double + \c!leftstyle \c!leftcolor \c!leftwidth {#horizontal}% + \c!rightstyle\c!rightcolor\c!rightwidth{#c}}% + \setlayoutelementparameter\c!righttext + {\page_layouts_process_element_double + \c!rightstyle\c!rightcolor\c!rightwidth{#a}% + \c!leftstyle \c!leftcolor \c!leftwidth {#b}}} + +\unexpanded\def\page_layouts_setup_text_four#vertical#horizontal#a#b% + {\edef\currentlayoutelement{#vertical:#horizontal}% + \doifelsenothing{\detokenize{#a}} + {\resetlayoutelementparameter\c!lefttext} + {\setlayoutelementparameter\c!lefttext + {\page_layouts_process_element_double + \c!leftstyle\c!leftcolor\c!leftwidth{#a}% + \c!leftstyle\c!leftcolor\c!leftwidth{#a}}}% + \doifelsenothing{\detokenize{#b}} + {\resetlayoutelementparameter\c!righttext} + {\setlayoutelementparameter\c!righttext + {\page_layouts_process_element_double + \c!rightstyle\c!rightcolor\c!rightwidth{#b}% + \c!rightstyle\c!rightcolor\c!rightwidth{#b}}}} + +\unexpanded\def\page_layouts_setup_text_three#vertical#horizontal#a% + {\edef\currentlayoutelement{#vertical:\v!text}% + \doifelsenothing{\detokenize{#horizontal}} + {\resetlayoutelementparameter\c!lefttext} + {\setlayoutelementparameter\c!lefttext + {\page_layouts_process_element_double + \c!leftstyle\c!leftcolor\c!leftwidth{#horizontal}% + \c!leftstyle\c!leftcolor\c!leftwidth{#horizontal}}}% + \doifelsenothing{\detokenize{#a}} + {\resetlayoutelementparameter\c!righttext} + {\setlayoutelementparameter\c!righttext + {\page_layouts_process_element_double + \c!rightstyle\c!rightcolor\c!rightwidth{#a}% + \c!rightstyle\c!rightcolor\c!rightwidth{#a}}}} + +\unexpanded\def\page_layouts_setup_text_two#vertical#horizontal% + {\edef\currentlayoutelement{#vertical:\v!text}% + \resetlayoutelementparameter\c!lefttext + \resetlayoutelementparameter\c!righttext + \doifelsenothing{\detokenize{#horizontal}} + {\resetlayoutelementparameter\c!middletext} + {\setlayoutelementparameter\c!middletext + {\page_layouts_process_element_single\c!style\c!color\c!width{#horizontal}}}} + +\unexpanded\def\page_layouts_setup_text_one#vertical% + {\edef\currentlayoutelement{#vertical:\v!text}% + \resetlayoutelementparameter\c!lefttext + \resetlayoutelementparameter\c!righttext + \resetlayoutelementparameter\c!middletext + \edef\currentlayoutelement{#vertical:\v!margin}% + \resetlayoutelementparameter\c!lefttext + \resetlayoutelementparameter\c!righttext + \resetlayoutelementparameter\c!middletext + \edef\currentlayoutelement{#vertical:\v!edge}% + \resetlayoutelementparameter\c!lefttext + \resetlayoutelementparameter\c!righttext + \resetlayoutelementparameter\c!middletext} + +\unexpanded\def\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c][#d]% + {\ifsixthargument \page_layouts_setup_text_six {#vertical}{#horizontal}{#a}{#b}{#c}{#d}\else + \iffifthargument \page_layouts_setup_text_five {#vertical}{#horizontal}{#a}{#b}{#c}\else + \iffourthargument\page_layouts_setup_text_four {#vertical}{#horizontal}{#a}{#b}\else + \ifthirdargument \page_layouts_setup_text_three{#vertical}{#horizontal}{#a}\else + \ifsecondargument\page_layouts_setup_text_two {#vertical}{#horizontal}\else + \page_layouts_setup_text_one {#vertical}\fi\fi\fi\fi\fi} %D Left and right texts are swapped on odd and even pages, but %D only when double sided typesetting is enabled. @@ -655,22 +738,35 @@ \unexpanded\def\definetext {\doseventupleempty\page_layouts_define_text} +% \def\page_layouts_define_text[#tag][#vertical][#horizontal][#a][#b][#c][#d]% +% {\ifseventhargument +% \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}% +% {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c][#d]}% +% \else\ifsixthargument +% \setvalue{\namedlayoutelementhash{#vertical}#tag}% +% {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c]}% +% \else\iffifthargument +% \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}% +% {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a][#b]}% +% \else\iffourthargument +% \setvalue{\namedlayoutelementhash{#vertical}#tag}% +% {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a]}% +% \else +% \setvalue{\namedlayoutelementhash{#vertical}#tag}% +% {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal]}% +% \fi\fi\fi\fi} + \def\page_layouts_define_text[#tag][#vertical][#horizontal][#a][#b][#c][#d]% {\ifseventhargument - \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}% - {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c][#d]}% + \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}{\page_layouts_setup_text_six {#vertical}{#horizontal}{#a}{#b}{#c}{#d}}% \else\ifsixthargument - \setvalue{\namedlayoutelementhash{#vertical}#tag}% - {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a][#b][#c]}% + \setvalue{\namedlayoutelementhash {#vertical}#tag}{\page_layouts_setup_text_five {#vertical}{#horizontal}{#a}{#b}{#c}}% \else\iffifthargument - \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}% - {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a][#b]}% + \setvalue{\namedlayoutelementhash{#vertical:#horizontal}#tag}{\page_layouts_setup_text_four {#vertical}{#horizontal}{#a}{#b}}% \else\iffourthargument - \setvalue{\namedlayoutelementhash{#vertical}#tag}% - {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal][#a]}% + \setvalue{\namedlayoutelementhash {#vertical}#tag}{\page_layouts_setup_text_three{#vertical}{#horizontal}{#a}}% \else - \setvalue{\namedlayoutelementhash{#vertical}#tag}% - {\dosixtupleempty\page_layouts_setup_texts[#vertical][#horizontal]}% + \setvalue{\namedlayoutelementhash {#vertical}#tag}{\page_layouts_setup_text_two {#vertical}{#horizontal}}% \fi\fi\fi\fi} %D A few more page breakers: diff --git a/tex/context/base/mkiv/scrn-ref.mkvi b/tex/context/base/mkiv/scrn-ref.mkvi index 9a3f0c264..a52133306 100644 --- a/tex/context/base/mkiv/scrn-ref.mkvi +++ b/tex/context/base/mkiv/scrn-ref.mkvi @@ -36,6 +36,7 @@ \c!click=\v!yes, \c!display=\v!normal, \c!focus=\v!fit, + \c!focusoffset=\zeropoint, % when tested with al views it will become 5\points \c!calculate=, % rendering: \c!width=\emwidth, @@ -43,6 +44,12 @@ \c!depth=\zeropoint, \c!symbolset=] +% for now here, might become per link + +\appendtoks + \enabledirectives[destinations.offset=\the\dimexpr\interactionparameter\c!focusoffset\relax]% +\to \everysetupinteraction + %D We have to make sure of some settings: \def\scrn_reference_set_text_actions diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex e84b45754..efcccd539 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex adb87eeaa..91828160c 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-itm.mkvi b/tex/context/base/mkiv/strc-itm.mkvi index e8b47babe..fc9d31d87 100644 --- a/tex/context/base/mkiv/strc-itm.mkvi +++ b/tex/context/base/mkiv/strc-itm.mkvi @@ -255,7 +255,7 @@ % no need to collect nodes in \b_strc_destination_nodes here ... maybe at some point \strc_references_start_destination_nodes % this is somewhat over the top ... we should use the counter's reference - \clf_setreferenceattribute + \clf_setdestinationattribute {% metadata {% kind {item}% was item, why? diff --git a/tex/context/base/mkiv/strc-lst.mkvi b/tex/context/base/mkiv/strc-lst.mkvi index 90b121399..78e55b874 100644 --- a/tex/context/base/mkiv/strc-lst.mkvi +++ b/tex/context/base/mkiv/strc-lst.mkvi @@ -153,7 +153,10 @@ \ifx\p_location\v!here % this branch injects nodes ! \strc_lists_inject_enhance{\currentlistnumber}{\nextinternalreference}% - \clf_setinternalreference internal \nextinternalreference\relax % this will change + \clf_setinternalreference + internal \nextinternalreference + view {\interactionparameter\c!focus}% + \relax % this will change \xdef\currentstructurelistattribute{\the\lastdestinationattribute}% \dontleavehmode\hbox attr \destinationattribute \lastdestinationattribute{}% todo \else @@ -1373,7 +1376,7 @@ % {\edef\p_interaction_forward{\listparameter\c!interaction}% % \ifcsname\??listinteractions\p_interaction_forward\endcsname % \expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname -% \strc_references_get_simple_page_reference{internal(\currentlistentrylocation)}% +% \strc_references_get_simple_reference{internal(\currentlistentrylocation)}% % \a_strc_lists_reference\currentreferenceattribute % \else % \a_strc_lists_reference\attributeunsetvalue @@ -1389,7 +1392,7 @@ % \fi % \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter ! % \ifx\p_interaction_backward\v!list -% \strc_references_set_simple_page_reference{bck:\currentlistentrylocation}% +% \strc_references_set_simple_page_reference{*\currentlistentrylocation}% % \a_strc_lists_destination\currentdestinationattribute % \else % \a_strc_lists_destination\attributeunsetvalue @@ -1407,7 +1410,7 @@ \ifcsname\??listinteractions\p_interaction_forward\endcsname %\expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname \expandafter\let\expandafter\p_interaction_forward\lastnamedcs - \strc_references_get_simple_page_reference{internal(\currentlistentrylocation)}% + \strc_references_get_simple_reference{internal(\currentlistentrylocation)}% \a_strc_lists_reference\currentreferenceattribute \else \a_strc_lists_reference\attributeunsetvalue @@ -1423,7 +1426,7 @@ \fi \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter ! \ifx\p_interaction_backward\v!list - \strc_references_set_simple_page_reference{bck:\currentlistentrylocation}% + \strc_references_set_simple_page_reference{*\currentlistentrylocation}% \a_strc_lists_destination\currentdestinationattribute \else \a_strc_lists_destination\attributeunsetvalue diff --git a/tex/context/base/mkiv/strc-not.mkvi b/tex/context/base/mkiv/strc-not.mkvi index f0e7ccbab..e1107ff99 100644 --- a/tex/context/base/mkiv/strc-not.mkvi +++ b/tex/context/base/mkiv/strc-not.mkvi @@ -522,16 +522,16 @@ \let\strc_notes_set_style_color_inline\strc_notes_set_style_color_inline_nop} % \def\strc_references_prepare_inline_references_yes -% {\strc_references_set_simple_page_reference{symb:\currentnote:\currentnotenumber}% destination -% \strc_references_get_simple_page_reference{internal(\clf_noteinternal{\currentnote}\currentnotenumber)}% reference +% {\strc_references_set_simple_reference{symb:\currentnote:\currentnotenumber}% destination +% \strc_references_get_simple_reference{internal(\clf_noteinternal{\currentnote}\currentnotenumber)}% reference % \edef\strc_notes_get_destination_attribute_symbol{attr\destinationattribute\currentdestinationattribute}% % \edef\strc_notes_get_reference_attribute_symbol{attr\referenceattribute\currentreferenceattribute}% % \let\strc_notes_set_style_color_inline\strc_notes_set_style_color_inline_yes} \def\strc_references_prepare_inline_references_yes {\edef\currentnoteinternal{\clf_noteinternal{\currentnote}\currentnotenumber}% - \strc_references_set_simple_page_reference{*\currentnoteinternal}% destination - \strc_references_get_simple_page_reference{internal(\currentnoteinternal)}% reference + \strc_references_set_simple_reference{*\currentnoteinternal}% destination + \strc_references_get_simple_reference{internal(\currentnoteinternal)}% reference \edef\strc_notes_get_destination_attribute_symbol{attr\destinationattribute\currentdestinationattribute}% \edef\strc_notes_get_reference_attribute_symbol{attr\referenceattribute\currentreferenceattribute}% \let\strc_notes_set_style_color_inline\strc_notes_set_style_color_inline_yes} @@ -554,20 +554,20 @@ % \def\strc_references_prepare_display_references_yes_number % {\let\strc_notes_set_reference_attribute_text\donothing -% \strc_references_get_simple_page_reference{symb:\currentnote:\currentnotenumber}% reference +% \strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference % \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}% % \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes} % \def\strc_references_prepare_display_references_yes_text -% {\strc_references_get_simple_page_reference{symb:\currentnote:\currentnotenumber}% reference +% {\strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference % \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}% % \let\strc_notes_set_reference_attribute_number\donothing % \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes} % \def\strc_references_prepare_display_references_yes_all -% {\strc_references_get_simple_page_reference{symb:\currentnote:\currentnotenumber}% reference +% {\strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference % \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}% -% \strc_references_get_simple_page_reference{symb:\currentnote:\currentnotenumber}% reference +% \strc_references_get_simple_reference{symb:\currentnote:\currentnotenumber}% reference % \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}% % \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes} @@ -577,7 +577,7 @@ \strc_references_prepare_display_references_nop \else \let\strc_notes_set_reference_attribute_text\donothing - \strc_references_get_simple_page_reference{*\currentnoteinternal}% reference + \strc_references_get_simple_reference{*\currentnoteinternal}% reference \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}% \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes \fi} @@ -587,7 +587,7 @@ \ifcase\currentnoteinternal\relax \strc_references_prepare_display_references_nop \else - \strc_references_get_simple_page_reference{*\currentnoteinternal}% reference + \strc_references_get_simple_reference{*\currentnoteinternal}% reference \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}% \let\strc_notes_set_reference_attribute_number\donothing \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes @@ -598,9 +598,9 @@ \ifcase\currentnoteinternal\relax \strc_references_prepare_display_references_nop \else - \strc_references_get_simple_page_reference{*\currentnoteinternal}% reference + \strc_references_get_simple_reference{*\currentnoteinternal}% reference \edef\strc_notes_set_reference_attribute_text{\attribute\referenceattribute\currentreferenceattribute}% - \strc_references_get_simple_page_reference{*\currentnoteinternal}% reference + \strc_references_get_simple_reference{*\currentnoteinternal}% reference \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}% \let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes \fi} diff --git a/tex/context/base/mkiv/strc-num.mkiv b/tex/context/base/mkiv/strc-num.mkiv index e9eaca11b..2418130f9 100644 --- a/tex/context/base/mkiv/strc-num.mkiv +++ b/tex/context/base/mkiv/strc-num.mkiv @@ -542,7 +542,7 @@ \xdef\currentstructurecomponentreferenceprefix{#1\c!referenceprefix}% \strc_counters_register_component_check_prefix \setnextinternalreference - \clf_setreferenceattribute + \clf_setdestinationattribute {% references {% internal \nextinternalreference @@ -626,6 +626,7 @@ reference {\currentstructurecomponentreference} prefix {\currentstructurecomponentreferenceprefix} % section structures.sections.currentid() + view {\interactionparameter\c!focus}% } titledata { label {\detokenize\expandafter{\currentstructurecomponentlabel}} @@ -668,7 +669,9 @@ %} \relax \xdef\m_strc_counters_last_registered_index{\the\scratchcounter}% - \clf_setinternalreference internal \nextinternalreference\relax + \clf_setinternalreference + internal \nextinternalreference + \relax \xdef\m_strc_counters_last_registered_attribute {\the\lastdestinationattribute}% \xdef\m_strc_counters_last_registered_synchronize{\strc_lists_inject_enhance{\m_strc_counters_last_registered_index}{\nextinternalreference}}} diff --git a/tex/context/base/mkiv/strc-ref.lua b/tex/context/base/mkiv/strc-ref.lua index b42727bce..c3b852e89 100644 --- a/tex/context/base/mkiv/strc-ref.lua +++ b/tex/context/base/mkiv/strc-ref.lua @@ -1905,7 +1905,8 @@ directives.register("references.linkmethod", function(v) -- page auto references.setinnermethod(v) end) --- this is inconsistent +-- we can call setinternalreference with an already known internal or with +-- a reference/prefix specification local destinationattributes = { } @@ -1915,6 +1916,7 @@ local function setinternalreference(specification) if innermethod == v_auto or innermethod == v_name then local t, tn = { }, 0 -- maybe add to current (now only used for tracing) local reference = specification.reference + local view = specification.view if reference then local prefix = specification.prefix if prefix and prefix ~= "" then @@ -1934,13 +1936,20 @@ local function setinternalreference(specification) end -- ugly .. later we decide to ignore it when we have a real one -- but for testing we might want to see them all - - 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 + if internal then + if innermethod ~= v_name then -- so page and auto + -- we don't want too many #1 #2 #3 etc + tn = tn + 1 + t[tn] = internal -- when number it's internal + end + if not view then + local i = references.internals[internal] + if i then + view = i.references.view + end + end end - destination = references.mark(t,nil,nil,specification.view) -- returns an attribute + destination = references.mark(t,nil,nil,view) -- returns an attribute end if internal then -- new destinationattributes[internal] = destination @@ -2017,7 +2026,7 @@ function references.setandgetattribute(data) -- maybe do internal automatically end implement { - name = "setreferenceattribute", + name = "setdestinationattribute", actions = references.setandgetattribute, arguments = { { @@ -2581,14 +2590,16 @@ end runners["special operation"] = runners["special"] runners["special operation with arguments"] = runners["special"] --- These are the testspecials not the real ones. They are used to --- check the validity. - function specials.internal(var,actions) local v = internals[tonumber(var.operation)] - local r = v and v.references.realpage + local r = v and v.references if r then - actions.realpage = r + local p = r.realpage + if p then +-- setmetatableindex(actions,r) + actions.realpage = p + actions.view = r.view + end end end diff --git a/tex/context/base/mkiv/strc-ref.mkvi b/tex/context/base/mkiv/strc-ref.mkvi index 0bf6623a0..4821c6832 100644 --- a/tex/context/base/mkiv/strc-ref.mkvi +++ b/tex/context/base/mkiv/strc-ref.mkvi @@ -216,7 +216,7 @@ % beware, the structures.references.set writes a \setnextinternalreference \strc_references_start_destination_nodes - \clf_setreferenceattribute + \clf_setdestinationattribute {% references {% internal \nextinternalreference @@ -278,7 +278,7 @@ \else \strc_references_start_destination_nodes \setnextinternalreference - \clf_setreferenceattribute + \clf_setdestinationattribute {% references {% internal \nextinternalreference @@ -307,7 +307,7 @@ \setnextinternalreference \edef\m_strc_references_user{#user}% \edef\m_strc_references_text{#text}% - \clf_setreferenceattribute + \clf_setdestinationattribute {% references {% internal \nextinternalreference @@ -393,10 +393,9 @@ {\iflocation \strc_references_start_destination_nodes \setnextinternalreference - \clf_setreferenceattribute + \clf_setdestinationattribute {% references {% - % block {\currentsectionblock}% view {\interactionparameter\c!focus}% \ifx\referenceprefix\empty\else prefix {\referenceprefix}% @@ -420,7 +419,7 @@ {\iflocation \strc_references_start_destination_nodes \setnextinternalreference - \clf_setreferenceattribute + \clf_setdestinationattribute {% references {% view {\interactionparameter\c!focus}% @@ -439,7 +438,7 @@ \xdef\currentdestinationattribute{\number\attributeunsetvalue}% \fi} -\def\strc_references_get_simple_page_reference#label% +\def\strc_references_get_simple_reference#label% {\iflocation \clf_injectreference {\referenceprefix}% @@ -455,21 +454,6 @@ \xdef\currentreferenceattribute{\number\attributeunsetvalue}% \fi} -\def\strc_references_get_simple_internal_reference#internal% - {\iflocation - \clf_injectinternalreference - #internal - {% - height \ht\strutbox - depth \dp\strutbox - \extrareferencearguments - }% - \relax - \xdef\currentreferenceattribute{\number\lastreferenceattribute}% - \else - \xdef\currentreferenceattribute{\number\attributeunsetvalue}% - \fi} - %D \macros %D {contentreference} %D @@ -850,9 +834,11 @@ \def\getinternalorderreference#kind#name% {\clf_currentreferenceorder{#kind}{#name}} -\def\thisissomeinternal#kind#name% only for old time sake +\def\thisissomeinternal#kind#name% only for old time sake, will go away {\begingroup - \clf_setinternalreference reference {#kind:#name}\relax + \clf_setinternalreference + reference {#kind:#name}% no view + \relax \hbox attr \destinationattribute\lastdestinationattribute{}% \endgroup} @@ -1600,6 +1586,25 @@ %\egroup\unhbox\referencebox} \endgroup} +\def\strc_references_goto_internal#content#dummy[#internal]% #dummy gobbles spaces + {\dontleavehmode + \begingroup + \global\lastsavedreferenceattribute\attributeunsetvalue + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \setstrut % can be option + \strc_references_get_simple_reference{internal(#internal)}% + \global\lastsavedreferenceattribute\currentreferenceattribute + \attribute\referenceattribute\currentreferenceattribute + \setlocationattributes + \dostarttagged\t!link\empty + #content% + \dostoptagged + \else + #content% + \fi + \endgroup} + \unexpanded\def\startgoto[#label]% {\dontleavehmode \begingroup diff --git a/tex/context/base/mkiv/strc-reg.lua b/tex/context/base/mkiv/strc-reg.lua index ed3292195..4efbe038b 100644 --- a/tex/context/base/mkiv/strc-reg.lua +++ b/tex/context/base/mkiv/strc-reg.lua @@ -391,13 +391,18 @@ end local function finalizer() local flaginternals = references.flaginternals + local usedviews = references.usedviews for k, v in next, tobesaved do local entries = v.entries if entries then for i=1,#entries do local r = entries[i].references - if r and flaginternals[r.internal] then - r.used = true + if r then + local i = r.internal + local f = flaginternals[i] + if f then + r.used = usedviews[i] or true + end end end end @@ -539,7 +544,7 @@ local function storeregister(rawdata) -- metadata, references, entries end -- if notsaved then - usedinternals[internal] = true -- todo view (we assume that forward references index entries are used) + usedinternals[internal] = references.used -- todo view (we assume that forward references index entries are used) end -- if not references.realpage then @@ -641,11 +646,12 @@ implement { implement { name = "storeregister", - actions = function(rawdata) - local nofentries = storeregister(rawdata) - setinternalreference { internal = rawdata.references.internal } - context(nofentries) - end, + -- actions = function(rawdata) + -- local nofentries = storeregister(rawdata) + -- setinternalreference { internal = rawdata.references.internal } + -- context(nofentries) + -- end, + actions = { storeregister, context }, arguments = { { { "metadata", { @@ -669,6 +675,7 @@ implement { { "references", { { "internal", "integer" }, { "section", "integer" }, + { "view" }, { "label" } } }, diff --git a/tex/context/base/mkiv/strc-reg.mkiv b/tex/context/base/mkiv/strc-reg.mkiv index fd4a81657..1d28db8df 100644 --- a/tex/context/base/mkiv/strc-reg.mkiv +++ b/tex/context/base/mkiv/strc-reg.mkiv @@ -268,6 +268,7 @@ \ifx\currentregisterlabel\empty \else label {\currentregisterlabel}% \fi +% view {\interactionparameter\c!focus}% }% entries {% % we need a special one for xml, this is just a single one @@ -292,7 +293,10 @@ }% userdata {\detokenize\expandafter{\normalexpanded{#3}}} }% - % \clf_setinternalreference internal \nextinternalreference\relax % in previous + \clf_setinternalreference + internal \nextinternalreference + view {\interactionparameter\c!focus}% + \relax % this will change \ifx\currentregisterownnumber\v!yes \glet\currentregistersynchronize\relax \else @@ -327,6 +331,10 @@ }% }% % overlap with the above + % \clf_setinternalreference + % internal \nextinternalreference + % view {\interactionparameter\c!focus}% + \relax % this will change \xdef\currentregistersynchronize{\ctxlatecommand{enhanceregister("\currentregister",\currentregisternumber)}}% \currentregistersynchronize % here? \dostarttagged\t!registerlocation\currentregister @@ -493,14 +501,13 @@ \fi \setnextinternalreference % we could consider storing register entries in list - \edef\temp{\clf_storeregister{ + \edef\temp{\clf_storeregister{% \temp grabs the nofentries metadata {% kind {see}% name {\currentregister}% }% references {% - % internal = \nextinternalreference, - % section = structures.sections.currentid(), +% view {\interactionparameter\c!focus}% }% entries {% % we need a special one for xml, this is just a single one @@ -511,6 +518,10 @@ text {\currentregisterseeword}% }% }}% + \clf_setinternalreference + internal \nextinternalreference + view {\interactionparameter\c!focus}% + \relax % this will change \dostarttagged\t!registerlocation\currentregister \attribute\destinationattribute\lastdestinationattribute \signalcharacter % no \strut as it will be removed during cleanup \dotagregisterlocation @@ -573,8 +584,12 @@ \endgroup \fi} +\newconditional\c_strc_registers_text_interaction + \def\strc_registers_place_indeed - {\clf_processregister + {\doifelse{\registerparameter\c!interaction}\v!text + \settrue\setfalse\c_strc_registers_text_interaction + \clf_processregister {\currentregister}% {% language {\registerparameter\s!language}% @@ -837,10 +852,18 @@ \unexpanded\def\registeronepagerangeseparator {|\endash|} % todo use \prewordbreak -\def\withregisterpagecommand#1#2#3#4% +% \unexpanded\def\withregisterpagecommand#1#2#3#4% +% {\def\currentregisterpageindex{#2}% +% \iflocation +% \goto{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[internal(#2)]% +% \else +% \applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}% +% \fi} + +\unexpanded\def\withregisterpagecommand#1#2#3#4% {\def\currentregisterpageindex{#2}% \iflocation - \goto{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[internal(#2)]% + \strc_references_goto_internal{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[#2]% \else \applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}% \fi} @@ -865,13 +888,27 @@ \dostoptagged \dostoptagged} +% \unexpanded\def\defaultregisterentry#1#2#3#4% #1:processor #2:internal #3:seeindex #4:word +% {\def\currentregisterpageindex{#2}% +% \iflocation +% \def\currentregisterseeindex{#3}% +% \doifelse{\registerparameter\c!interaction}\v!text +% {\directgoto{\setlocationcolor\doapplyregisterentrycommand{#1}{#4}}[internal(#2)]} +% {\doapplyregisterentrycommand{#1}{#4}}% +% \else +% \let\currentregisterseeindex\empty +% \doapplyregisterentrycommand{#1}{#4}% +% \fi} + \unexpanded\def\defaultregisterentry#1#2#3#4% #1:processor #2:internal #3:seeindex #4:word {\def\currentregisterpageindex{#2}% \iflocation \def\currentregisterseeindex{#3}% - \doifelse{\registerparameter\c!interaction}\v!text - {\directgoto{\setlocationcolor\doapplyregisterentrycommand{#1}{#4}}[internal(#2)]} - {\doapplyregisterentrycommand{#1}{#4}}% + \ifconditional\c_strc_registers_text_interaction + \strc_references_goto_internal{\setlocationcolor\doapplyregisterentrycommand{#1}{#4}}[internal(#2)]% + \else + \doapplyregisterentrycommand{#1}{#4}% + \fi \else \let\currentregisterseeindex\empty \doapplyregisterentrycommand{#1}{#4}% @@ -886,13 +923,22 @@ \applyprocessor{#1}{\registerparameter\c!textcommand{\limitedregisterentry{\registerparameter\c!deeptextcommand{#2}}}}% \dostoptagged} +% \unexpanded\def\doapplyregisterseecommand#1#2% +% {\ifx\currentregisterseeindex\empty +% % \dontleavehmode +% \applyprocessor{#1}{#2}% +% \else +% \goto{\applyprocessor{#1}{#2}}[seeindex:\currentregisterseeindex]% +% \fi} + \unexpanded\def\doapplyregisterseecommand#1#2% {\ifx\currentregisterseeindex\empty - % \dontleavehmode \applyprocessor{#1}{#2}% + \else\iflocation + \strc_references_goto_internal{\applyprocessor{#1}{#2}}[seeindex:\currentregisterseeindex]% \else - \goto{\applyprocessor{#1}{#2}}[seeindex:\currentregisterseeindex]% - \fi} + \applyprocessor{#1}{#2}% + \fi\fi} \unexpanded\def\defaultregisterseeword#1#2#3#4#5#6% i n #3:processor #4:internal #5:seeindex #6:word {\registerpageseparator diff --git a/tex/context/base/mkiv/strc-ren.mkiv b/tex/context/base/mkiv/strc-ren.mkiv index f68a79aa9..6bdd05de9 100644 --- a/tex/context/base/mkiv/strc-ren.mkiv +++ b/tex/context/base/mkiv/strc-ren.mkiv @@ -99,13 +99,13 @@ {\edef\currentheadinteraction{\headparameter\c!interaction}% \ifx\currentheadinteraction\v!list % setuphead[<section>][interaction=list,...] - \strc_references_get_simple_page_reference{bck:\nextinternalreference}% + \strc_references_get_simple_reference{*\nextinternalreference}% \let\currentstructurereferenceattribute\currentreferenceattribute \else\ifx\currentheadinteraction\v!reference % setuphead[<section>][interaction=reference,...] start<section>[backreference=abc,...] \edef\currentheadbackreference{\structurevariable\c!backreference}% weird, was references.backreference \ifx\currentheadbackreference\empty \else - \strc_references_get_simple_page_reference\currentheadbackreference + \strc_references_get_simple_reference\currentheadbackreference \let\currentstructurereferenceattribute\currentreferenceattribute \fi \else diff --git a/tex/context/interface/common/keys-cs.xml b/tex/context/interface/common/keys-cs.xml index b69efb667..ea492e3d0 100644 --- a/tex/context/interface/common/keys-cs.xml +++ b/tex/context/interface/common/keys-cs.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='prvnistranka'/> <cd:constant name='focus' value='zaostreni'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusout'/> <cd:constant name='footer' value='upati'/> <cd:constant name='footerdistance' value='vzdalenostupati'/> diff --git a/tex/context/interface/common/keys-de.xml b/tex/context/interface/common/keys-de.xml index 1268ed988..26c226166 100644 --- a/tex/context/interface/common/keys-de.xml +++ b/tex/context/interface/common/keys-de.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='ersteseite'/> <cd:constant name='focus' value='focus'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusout'/> <cd:constant name='footer' value='fusszeile'/> <cd:constant name='footerdistance' value='fusszeilenabstand'/> diff --git a/tex/context/interface/common/keys-en.xml b/tex/context/interface/common/keys-en.xml index 0d3be2223..709e393a7 100644 --- a/tex/context/interface/common/keys-en.xml +++ b/tex/context/interface/common/keys-en.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='firstpage'/> <cd:constant name='focus' value='focus'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusout'/> <cd:constant name='footer' value='footer'/> <cd:constant name='footerdistance' value='footerdistance'/> diff --git a/tex/context/interface/common/keys-fr.xml b/tex/context/interface/common/keys-fr.xml index 5b764f99a..442d9c91d 100644 --- a/tex/context/interface/common/keys-fr.xml +++ b/tex/context/interface/common/keys-fr.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='premierepage'/> <cd:constant name='focus' value='focus'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusout'/> <cd:constant name='footer' value='pdp'/> <cd:constant name='footerdistance' value='dsitancepdp'/> diff --git a/tex/context/interface/common/keys-it.xml b/tex/context/interface/common/keys-it.xml index 3278d2c58..0860dc302 100644 --- a/tex/context/interface/common/keys-it.xml +++ b/tex/context/interface/common/keys-it.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='primapagina'/> <cd:constant name='focus' value='focus'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusout'/> <cd:constant name='footer' value='piedipagina'/> <cd:constant name='footerdistance' value='distanzapdp'/> diff --git a/tex/context/interface/common/keys-nl.xml b/tex/context/interface/common/keys-nl.xml index b64176707..50d18abb5 100644 --- a/tex/context/interface/common/keys-nl.xml +++ b/tex/context/interface/common/keys-nl.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='eerstepagina'/> <cd:constant name='focus' value='focus'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusuit'/> <cd:constant name='footer' value='voet'/> <cd:constant name='footerdistance' value='voetafstand'/> diff --git a/tex/context/interface/common/keys-pe.xml b/tex/context/interface/common/keys-pe.xml index feab7b509..297b22ce4 100644 --- a/tex/context/interface/common/keys-pe.xml +++ b/tex/context/interface/common/keys-pe.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='صفحهاول'/> <cd:constant name='focus' value='تمرکز'/> <cd:constant name='focusin' value='تمرکزدرون'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='تمرکزبیرون'/> <cd:constant name='footer' value='تهبرگ'/> <cd:constant name='footerdistance' value='فاصلهتهبرگ'/> diff --git a/tex/context/interface/common/keys-ro.xml b/tex/context/interface/common/keys-ro.xml index f801b0be2..21a10c7c2 100644 --- a/tex/context/interface/common/keys-ro.xml +++ b/tex/context/interface/common/keys-ro.xml @@ -801,6 +801,7 @@ <cd:constant name='firstpage' value='primapagina'/> <cd:constant name='focus' value='focus'/> <cd:constant name='focusin' value='focusin'/> + <cd:constant name='focusoffset' value='focusoffset'/> <cd:constant name='focusout' value='focusout'/> <cd:constant name='footer' value='subsol'/> <cd:constant name='footerdistance' value='distantasubsol'/> diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 85cf556b5..8d60db765 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 : 03/02/16 16:55:49 +-- merge date : 03/03/16 23:31:11 do -- begin closure to overcome local limits and interference |