diff options
author | Marius <mariausol@gmail.com> | 2012-04-07 00:20:13 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-04-07 00:20:13 +0300 |
commit | 585cbdbdbe50e0fb845fdbcb7276d9fe5c336106 (patch) | |
tree | abbfa2ccf38eed8953d911fc5d693fa61bfd7978 | |
parent | bb48cb77d3a04f6b5ab1bcb25ab64ef887d320eb (diff) | |
download | context-585cbdbdbe50e0fb845fdbcb7276d9fe5c336106.tar.gz |
beta 2012.04.06 23:08
45 files changed, 342 insertions, 264 deletions
diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 013946df6..603dcdae2 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -241,7 +241,7 @@ % \setfalse\c_colo_convert_gray \getvalue{\??colorconversions\directcolorsparameter\c!conversion}% could be a nice \ifcsname - % + % too often: \ifconditional\c_colo_rgb_supported \colo_helpers_show_message\m!colors9\v!rgb \fi \ifconditional\c_colo_cmyk_supported\colo_helpers_show_message\m!colors9\v!cmyk\fi \colo_helpers_set_current_model diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index ce0489849..4d6bbd111 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.04.02 22:23} +\newcontextversion{2012.04.06 23:08} %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/cont-new.mkiv b/tex/context/base/cont-new.mkiv index aec70fbfd..ea36c4bc4 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2012.04.02 22:23} +\newcontextversion{2012.04.06 23:08} %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-version.pdf b/tex/context/base/context-version.pdf Binary files differindex f9ae11862..178a138e7 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png Binary files differindex 092ca2d98..864ac45d3 100644 --- a/tex/context/base/context-version.png +++ b/tex/context/base/context-version.png diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index cdc448089..25c4c8a1b 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2012.04.02 22:23} +\edef\contextversion{2012.04.06 23:08} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 5ab614885..6c3fefcfc 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -23,7 +23,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2012.04.02 22:23} +\edef\contextversion{2012.04.06 23:08} %D For those who want to use this: diff --git a/tex/context/base/grph-fig.mkiv b/tex/context/base/grph-fig.mkiv index 593e0f18a..1908e6445 100644 --- a/tex/context/base/grph-fig.mkiv +++ b/tex/context/base/grph-fig.mkiv @@ -58,9 +58,7 @@ \egroup} \def\externalfigurereplacement#1#2#3% - {\setupcolors - [\c!state=\v!local]% - \normalexpanded{\localframed + {\normalexpanded{\localframed [\??ef] [\c!width=\figurewidth, \c!height=\figureheight, diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index 4e8f89298..a7c7bd86b 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -143,6 +143,7 @@ figures.programs = allocate() local programs = figures.programs figures.localpaths = allocate { ".", "..", "../.." } + figures.cachepaths = allocate { prefix = "", path = ".", @@ -756,7 +757,10 @@ local function locate(request) -- name, format, cache end end end - return register(askedname) + return register(askedname, { -- these two are needed for hashing 'found' + conversion = askedconversion, + resolution = askedresolution, + }) end -- -- -- plugins -- -- -- diff --git a/tex/context/base/mult-de.mkii b/tex/context/base/mult-de.mkii index 9659a4a7c..e99d1fade 100644 --- a/tex/context/base/mult-de.mkii +++ b/tex/context/base/mult-de.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{autohang} \setinterfaceconstant{autostrut}{autostrut} \setinterfaceconstant{autowidth}{autobreite} +\setinterfaceconstant{availableheight}{availableheight} +\setinterfaceconstant{availablewidth}{availablewidth} \setinterfaceconstant{axis}{achsen} \setinterfaceconstant{background}{hintergrund} \setinterfaceconstant{backgroundcolor}{hintergrundfarbe} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index d65d96ab4..c7793ca81 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -7784,6 +7784,14 @@ return { ["filtercommand"]={ ["en"]="filtercommand", }, + ["availablewidth"]={ + ["en"]="availablewidth", + ["nl"]="beschikbarebreedte", + }, + ["availableheight"]={ + ["en"]="availableheight", + ["nl"]="beschikbarehoogte", + }, ["focus"]={ ["cs"]="zaostreni", ["de"]="focus", diff --git a/tex/context/base/mult-en.mkii b/tex/context/base/mult-en.mkii index 37209110b..9745daad2 100644 --- a/tex/context/base/mult-en.mkii +++ b/tex/context/base/mult-en.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{autohang} \setinterfaceconstant{autostrut}{autostrut} \setinterfaceconstant{autowidth}{autowidth} +\setinterfaceconstant{availableheight}{availableheight} +\setinterfaceconstant{availablewidth}{availablewidth} \setinterfaceconstant{axis}{axis} \setinterfaceconstant{background}{background} \setinterfaceconstant{backgroundcolor}{backgroundcolor} diff --git a/tex/context/base/mult-fr.mkii b/tex/context/base/mult-fr.mkii index ed75db73e..d1c5091c3 100644 --- a/tex/context/base/mult-fr.mkii +++ b/tex/context/base/mult-fr.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{autohang} \setinterfaceconstant{autostrut}{autostrut} \setinterfaceconstant{autowidth}{autolargeur} +\setinterfaceconstant{availableheight}{availableheight} +\setinterfaceconstant{availablewidth}{availablewidth} \setinterfaceconstant{axis}{axe} \setinterfaceconstant{background}{arriereplan} \setinterfaceconstant{backgroundcolor}{couleurarriereplan} diff --git a/tex/context/base/mult-it.mkii b/tex/context/base/mult-it.mkii index a7a598485..26db716e3 100644 --- a/tex/context/base/mult-it.mkii +++ b/tex/context/base/mult-it.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{autohang} \setinterfaceconstant{autostrut}{autostrut} \setinterfaceconstant{autowidth}{autoampiezza} +\setinterfaceconstant{availableheight}{availableheight} +\setinterfaceconstant{availablewidth}{availablewidth} \setinterfaceconstant{axis}{asse} \setinterfaceconstant{background}{sfondo} \setinterfaceconstant{backgroundcolor}{coloresfondo} diff --git a/tex/context/base/mult-nl.mkii b/tex/context/base/mult-nl.mkii index cc3dc1629..b962e8fcf 100644 --- a/tex/context/base/mult-nl.mkii +++ b/tex/context/base/mult-nl.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{autohang} \setinterfaceconstant{autostrut}{autostrut} \setinterfaceconstant{autowidth}{autobreedte} +\setinterfaceconstant{availableheight}{beschikbarehoogte} +\setinterfaceconstant{availablewidth}{beschikbarebreedte} \setinterfaceconstant{axis}{assenstelsel} \setinterfaceconstant{background}{achtergrond} \setinterfaceconstant{backgroundcolor}{achtergrondkleur} diff --git a/tex/context/base/mult-pe.mkii b/tex/context/base/mult-pe.mkii index 1c4e03900..713b15a47 100644 --- a/tex/context/base/mult-pe.mkii +++ b/tex/context/base/mult-pe.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{آویزانخودکار} \setinterfaceconstant{autostrut}{بستخودکار} \setinterfaceconstant{autowidth}{عرضخودکار} +\setinterfaceconstant{availableheight}{availableheight} +\setinterfaceconstant{availablewidth}{availablewidth} \setinterfaceconstant{axis}{محورها} \setinterfaceconstant{background}{پسزمینه} \setinterfaceconstant{backgroundcolor}{رنگپسزمینه} diff --git a/tex/context/base/mult-ro.mkii b/tex/context/base/mult-ro.mkii index c46f629c3..5ff6e0980 100644 --- a/tex/context/base/mult-ro.mkii +++ b/tex/context/base/mult-ro.mkii @@ -558,6 +558,8 @@ \setinterfaceconstant{autohang}{autohang} \setinterfaceconstant{autostrut}{autostrut} \setinterfaceconstant{autowidth}{autolatime} +\setinterfaceconstant{availableheight}{availableheight} +\setinterfaceconstant{availablewidth}{availablewidth} \setinterfaceconstant{axis}{axa} \setinterfaceconstant{background}{fundal} \setinterfaceconstant{backgroundcolor}{culoarefundal} diff --git a/tex/context/base/page-flt.mkiv b/tex/context/base/page-flt.mkiv index a4f510d8c..18c0ad263 100644 --- a/tex/context/base/page-flt.mkiv +++ b/tex/context/base/page-flt.mkiv @@ -208,7 +208,7 @@ \def\doreversesavefloat {\dofloatsresave\s!text} -\def\doflushsavedfloats % simplified \OTRONEdodoflushfloats .. nothing special in otr ... in place +\def\doflushsavedfloats {\doloop {\ifsomefloatwaiting \page_otr_command_check_if_float_fits @@ -219,7 +219,11 @@ \exitloop \fi \else - \exitloop +% \ifconditional\c_page_margin_blocks_present % not here, here just as many floats as fit +% \page_otr_command_flush_margin_blocks +% \else + \exitloop +% \fi \fi}} %D Page floats use different stacks. diff --git a/tex/context/base/page-ins.mkiv b/tex/context/base/page-ins.mkiv index 934ce19ab..793e28d4c 100644 --- a/tex/context/base/page-ins.mkiv +++ b/tex/context/base/page-ins.mkiv @@ -38,7 +38,6 @@ \appendtoks\doprocessinsert#1\to\@@insertionlist \fi} - \def\synchronizeinsertions {\def\doprocessinsert##1{\ifvoid##1\else\insert##1{\unvbox##1}\fi}% \processinsertions} diff --git a/tex/context/base/page-mbk.mkvi b/tex/context/base/page-mbk.mkvi index 68883aa61..eb8061bf3 100644 --- a/tex/context/base/page-mbk.mkvi +++ b/tex/context/base/page-mbk.mkvi @@ -44,11 +44,15 @@ \let\setupmarginblocks\setupmarginblock -\newconditional\c_page_margin_blocks % not really needed as we can check each time +\newconditional\c_page_margin_blocks_enabled % not really needed as we can check each time +\newconditional\c_page_margin_blocks_present + +\newbox \b_page_margin_blocks +\newbox \b_page_margin_blocks_prepared \appendtoks \doifelse{\rootmarginblockparameter\c!state}\v!start - \settrue\setfalse\c_page_margin_blocks + \settrue\setfalse\c_page_margin_blocks_enabled \to \everysetupmarginblock \setupmarginblocks @@ -67,30 +71,31 @@ \c!bottom=\vfill] \unexpanded\def\startmarginblock - {\dosingleempty\page_margin_start_block} + {\dosingleempty\page_margin_blocks_start_block} \unexpanded\def\stopmarginblock - {\page_margin_stop_block} + {\page_margin_blocks_stop_block} -\def\page_margin_start_block[#tag]% +\def\page_margin_blocks_start_block[#tag]% {\begingroup \edef\currentmarginblock{#tag}% \doifelse{\marginblockparameter\c!state}\v!start - \page_margin_start_block_yes - \page_margin_start_block_nop} + \page_margin_blocks_start_block_yes + \page_margin_blocks_start_block_nop} -\def\page_margin_stop_block +\def\page_margin_blocks_stop_block {\doifelse{\marginblockparameter\c!state}\v!start - \page_margin_stop_block_yes - \page_margin_stop_block_nop + \page_margin_blocks_stop_block_yes + \page_margin_blocks_stop_block_nop \endgroup} -\def\page_margin_start_block_yes % 2 maal \vbox ivm \unvbox elders +\def\page_margin_blocks_start_block_yes % 2 maal \vbox ivm \unvbox elders {\showmessage\m!layouts4\empty - \global\setbox\b_page_margin\vtop\bgroup\vbox\bgroup + \global\settrue\c_page_margin_blocks_present + \global\setbox\b_page_margin_blocks\vtop\bgroup\vbox\bgroup \hsize\marginblockparameter\c!width - \ifvoid\b_page_margin\else - \unvbox\b_page_margin + \ifvoid\b_page_margin_blocks\else + \unvbox\b_page_margin_blocks \marginblockparameter\c!inbetween \fi \setupalign[\marginblockparameter\c!align]% @@ -98,145 +103,148 @@ \begstrut \ignorespaces} -\def\page_margin_stop_block_yes +\def\page_margin_blocks_stop_block_yes {\removeunwantedspaces \endstrut \egroup \egroup} -\def\page_margin_start_block_nop +\def\page_margin_blocks_start_block_nop {\showmessage\m!layouts5\empty \marginblockparameter\c!before \bgroup \usemarginblockstyleandcolor\c!style\c!color} -\def\page_margin_stop_block_nop +\def\page_margin_blocks_stop_block_nop {\egroup \marginblockparameter\c!after} -\newbox\b_page_margin -\newbox\b_page_margin_prepared - -\def\page_margin_reshape - {\ifdim\ht\b_page_margin_prepared>\zeropoint +\def\page_margin_blocks_reshape + {\ifdim\ht\b_page_margin_blocks_prepared>\zeropoint \beginofshapebox - \unvbox\b_page_margin_prepared + \unvbox\b_page_margin_blocks_prepared \endofshapebox \reshapebox {\box\shapebox}% - \setbox\b_page_margin_prepared\vbox to \textheight + \setbox\b_page_margin_blocks_prepared\vbox to \textheight {\marginblockparameter\c!top \flushshapebox \marginblockparameter\c!bottom}% \fi} \unexpanded\def\checkmarginblocks - {\ifvoid\b_page_margin \else - \page_margin_check_indeed + {\ifvoid\b_page_margin_blocks + \global\setfalse\c_page_margin_blocks_present + \else + \page_margin_blocks_check_indeed \fi} -\def\page_margin_check_indeed +\def\page_margin_blocks_check_indeed {\ifcsname\??marginblocklocation\marginblockparameter\c!location\endcsname - \page_margin_prepare_box + \page_margin_blocks_prepare_box \csname\??marginblocklocation\marginblockparameter\c!location\endcsname \else - \global\setbox\b_page_margin\emptybox + \global\setbox\b_page_margin_blocks\emptybox + \global\setfalse\c_page_margin_blocks_present \fi} -\def\page_margin_prepare_box - {\setbox\b_page_margin_prepared\vbox +\def\page_margin_blocks_prepare_box + {\setbox\b_page_margin_blocks_prepared\vbox {\forgetall \splittopskip\topskip - \ifvoid\b_page_margin\else - \ifdim\ht\b_page_margin>\textheight - \vsplit\b_page_margin to \textheight + \ifvoid\b_page_margin_blocks\else + \ifdim\ht\b_page_margin_blocks>\textheight + \vsplit\b_page_margin_blocks to \textheight \else - \unvbox\b_page_margin + \unvbox\b_page_margin_blocks \fi \fi}% - \page_margin_reshape - \setbox\b_page_margin_prepared\vbox + \page_margin_blocks_reshape + \setbox\b_page_margin_blocks_prepared\vbox {\marginblockparameter\c!before - \box\b_page_margin_prepared + \box\b_page_margin_blocks_prepared \marginblockparameter\c!after}} % inner outer -\setvalue{\??marginblocklocation\v!left }{\page_margin_set_l_box} -\setvalue{\??marginblocklocation\v!right }{\page_margin_set_r_box} +\setvalue{\??marginblocklocation\v!left }{\page_margin_blocks_set_l_box} +\setvalue{\??marginblocklocation\v!right }{\page_margin_blocks_set_r_box} \setvalue{\??marginblocklocation\v!inmargin}{\doifbothsidesoverruled - \page_margin_set_r_box - \page_margin_set_r_box - \page_margin_set_l_box} + \page_margin_blocks_set_r_box + \page_margin_blocks_set_r_box + \page_margin_blocks_set_l_box} \setvalue{\??marginblocklocation\v!middle }{\doifbothsidesoverruled - \page_margin_set_r_box - \page_margin_set_l_box - \page_margin_set_r_box} + \page_margin_blocks_set_r_box + \page_margin_blocks_set_l_box + \page_margin_blocks_set_r_box} -\unexpanded\def\page_margin_place_block_r_yes - {\setbox\b_page_margin_prepared\hbox to \rightmarginwidth +\unexpanded\def\page_margin_blocks_place_r_yes + {\setbox\b_page_margin_blocks_prepared\hbox to \rightmarginwidth {\marginblockparameter\c!left - \box\b_page_margin_prepared + \box\b_page_margin_blocks_prepared \marginblockparameter\c!right}% - \vsmashbox\b_page_margin_prepared - \box\b_page_margin_prepared} + \vsmashbox\b_page_margin_blocks_prepared + \box\b_page_margin_blocks_prepared} -\unexpanded\def\page_margin_place_block_l_yes - {\setbox\b_page_margin_prepared\hbox to \leftmarginwidth +\unexpanded\def\page_margin_blocks_place_l_yes + {\setbox\b_page_margin_blocks_prepared\hbox to \leftmarginwidth {\marginblockparameter\c!right - \box\b_page_margin_prepared + \box\b_page_margin_blocks_prepared \marginblockparameter\c!left}% - \vsmashbox\b_page_margin_prepared - \box\b_page_margin_prepared} + \vsmashbox\b_page_margin_blocks_prepared + \box\b_page_margin_blocks_prepared} -\unexpanded\def\page_margin_place_block_r_nop{\hskip\rightmarginwidth} -\unexpanded\def\page_margin_place_block_l_nop{\hskip\leftmarginwidth} +\unexpanded\def\page_margin_blocks_place_r_nop{\hskip\rightmarginwidth} +\unexpanded\def\page_margin_blocks_place_l_nop{\hskip\leftmarginwidth} -\let\placerightmarginblock\page_margin_place_block_r_nop -\let\placeleftmarginblock \page_margin_place_block_l_nop +\let\placerightmarginblock\page_margin_blocks_place_r_nop +\let\placeleftmarginblock \page_margin_blocks_place_l_nop -\def\page_margin_set_r_box{\let\placerightmarginblock\page_margin_place_block_r_yes} -\def\page_margin_set_l_box{\let\placeleftmarginblock \page_margin_place_block_l_yes} +\def\page_margin_blocks_set_r_box{\let\placerightmarginblock\page_margin_blocks_place_r_yes} +\def\page_margin_blocks_set_l_box{\let\placeleftmarginblock \page_margin_blocks_place_l_yes} % margin floats (keyword 'margin' in option list) -\unexpanded\def\page_margin_process_float +\unexpanded\def\page_margin_blocks_process_float {\doifelse{\marginblockparameter\c!state}\v!start - \page_margin_process_float_yes - \page_margin_process_float_nop} + \page_margin_blocks_process_float_yes + \page_margin_blocks_process_float_nop} -\def\page_margin_process_float_yes#options% - {\global\setbox\b_page_margin\vbox +\def\page_margin_blocks_process_float_yes + {\global\setbox\b_page_margin_blocks\vbox {\hsize\marginblockparameter\c!width - \unvcopy\b_page_margin - \ifvoid\b_page_margin\else + \unvcopy\b_page_margin_blocks + \ifvoid\b_page_margin_blocks\else \expandafter\marginblockparameter\expandafter\c!inbetween \fi \box\floatbox \filbreak}% - \ifdim\ht\b_page_margin>\textheight + \ifdim\ht\b_page_margin_blocks>\textheight % \dosavefloatinfo % no saving done anyway \else \doinsertfloatinfo \fi} -\def\page_margin_process_float_nop#options% - {\someelsefloat[#options,\v!here]} % still an old name +\def\page_margin_blocks_process_float_nop + {\handlefloatmethod\v!here} -\def\page_margin_float_before - {\ifconditional\c_page_margin_blocks +\def\page_margin_blocks_float_before + {\ifconditional\c_page_margin_blocks_enabled \doifinset\v!margin\floatlocation\endgraf \fi} -\def\page_margin_float_set_hsize - {\ifconditional\c_page_margin_blocks +\def\page_margin_blocks_float_set_hsize + {\ifconditional\c_page_margin_blocks_enabled \doifinset\v!margin\floatlocation{\hsize\rootmarginblockparameter\c!width}% \fi} \appendtoks - \ifvoid\b_page_margin \else + \ifvoid\b_page_margin_blocks \else \writestatus\m!layouts{beware: there are left-over margin floats!}% \fi \to \everystoptext +\unexpanded\def\flushmarginblocks + {\page_otr_command_flush_margin_blocks} + \protect \endinput diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv index 948ef0bcc..3792f06ee 100644 --- a/tex/context/base/page-mul.mkiv +++ b/tex/context/base/page-mul.mkiv @@ -1670,6 +1670,7 @@ \s!page_otr_command_flush_floats =\page_mul_command_flush_floats, \s!page_otr_command_flush_side_floats =\page_mul_command_flush_side_floats, \s!page_otr_command_flush_saved_floats =\page_mul_command_flush_saved_floats + % \s!page_otr_command_flush_margin_blocks =\page_mul_command_flush_margin_blocks, % not used ] \protect \endinput diff --git a/tex/context/base/page-one.mkiv b/tex/context/base/page-one.mkiv index c2346b621..89fd7d4a8 100644 --- a/tex/context/base/page-one.mkiv +++ b/tex/context/base/page-one.mkiv @@ -182,6 +182,31 @@ %D Insertions \newconditional\c_page_one_top_of_insert +\newconditional\c_page_one_correct_top_insert \settrue\c_page_one_correct_top_insert % false moves up (tight) +\newskip \s_page_one_between_top_insert + +\def\page_one_prepare_top_float + {\ifdim\topinserted=\zeropoint + \settrue\c_page_one_top_of_insert + \else + \setfalse\c_page_one_top_of_insert + \fi + \s_page_one_between_top_insert\ifdim\floattopskip>\floatbottomskip\floattopskip\else\floatbottomskip\fi\relax + \global\advance\topinserted\dimexpr\ht\floatbox+\dp\floatbox+\s_page_one_between_top_insert\relax} + +\def\page_one_insert_top_float % maybe remember last beforeskip + {\insert\topins + {\forgetall + \ifconditional\c_page_one_top_of_insert + \ifconditional\c_page_one_correct_top_insert + \topskipcorrection % [xx] new: see icare topbleed + \kern-\lineskip + \par + \prevdepth\maxdimen + \fi + \fi + \page_otr_command_flush_float_box + \vskip\s_page_one_between_top_insert}} \unexpanded\def\page_one_command_set_top_insertions {\bgroup @@ -205,26 +230,10 @@ \def\page_one_command_set_top_insertions_indeed {\ifnum\noffloatinserts<\noftopfloats \dogetfloat - \ifdim\topinserted=\zeropoint - \settrue\c_page_one_top_of_insert - \else - \setfalse\c_page_one_top_of_insert - \fi - \global\advance\topinserted\dimexpr\ht\floatbox+\dp\floatbox+\floatbottomskip\relax + \page_one_prepare_top_float \ifdim\topinserted<\textheight\relax \xdef\totaltopinserted{\the\topinserted}% - \insert\topins - {\forgetall - \ifconditional\c_page_one_top_of_insert - \topskipcorrection % [xx] new: see icare topbleed - \kern-\lineskip\par - \prevdepth\maxdimen - \else - %\blank[-\rootfloatparameter\c!spaceafter,\rootfloatparameter\c!spacebefore]% inserts can't look back - \betweenfloatblanko - \fi - \page_otr_command_flush_float_box - \blank[\rootfloatparameter\c!spaceafter]}% + \page_one_insert_top_float \ifsomefloatwaiting \advance\noffloatinserts \plusone \else @@ -371,6 +380,19 @@ \expandafter\page_one_command_flush_floats_indeed \fi} +\unexpanded\def\page_one_command_flush_margin_blocks + {\ifconditional\c_page_margin_blocks_present % \ifvoid\b_page_margin_blocks \else + \ifdim\pagetotal=\zeropoint + \null % \fixedspace + \fi + \page_otr_command_next_page % \page + \ifvoid\b_page_margin_blocks + \global\setfalse\c_page_margin_blocks_present + \else + \doubleexpandafter\page_one_command_flush_margin_blocks + \fi + \fi} + \unexpanded\def\page_one_command_check_if_float_fits {\ifnofloatpermitted \global\roomforfloatfalse @@ -411,7 +433,9 @@ \page_one_command_set_bottom_insertions \ifsomefloatwaiting \doif{\rootfloatparameter\c!cache}\v!no\page_one_command_flush_floats % could be _otr_ - \fi + \else\ifconditional\c_page_margin_blocks_present + \page_one_command_flush_floats + \fi\fi \fi} \def\page_one_place_float_here_indeed @@ -443,7 +467,7 @@ \def\page_one_place_float_cutspace {\page_one_place_float_side_indeed\page_sides_process_float_cutspace} %def\page_one_place_float_margin {\page_one_place_float_side_indeed\page_sides_process_float_margin\nonoindentation} % wil be overloaded -\def\page_one_place_float_margin {\page_margin_process_float} +\def\page_one_place_float_margin {\page_margin_blocks_process_float} \def\page_one_place_float_page {\dofloatssavepagefloat \s!page \floatlocationmethod} \def\page_one_place_float_leftpage {\dofloatssavepagefloat \s!leftpage \floatlocationmethod} @@ -517,24 +541,9 @@ \fi\fi \fi} -\def\page_one_place_float_top_indeed - {\ifdim\topinserted=\zeropoint - \settrue\c_page_one_top_of_insert - \else - \setfalse\c_page_one_top_of_insert - \fi - \global\advance\topinserted\dimexpr\ht\floatbox+\dp\floatbox+\floatbottomskip\relax - \insert\topins - {\forgetall - \ifconditional\c_page_one_top_of_insert - \topskipcorrection % [xx] new: see icare topbleed - \kern-\lineskip\par\prevdepth\maxdimen - \else - %\blank[-\rootfloatparameter\c!spaceafter,\rootfloatparameter\c!spacebefore]% inserts can't look back - \betweenfloatblanko - \fi - \page_otr_command_flush_float_box - \blank[\rootfloatparameter\c!spaceafter]}% +\def\page_one_place_float_top_indeed % maybe remember last beforeskip + {\page_one_prepare_top_float + \page_one_insert_top_float \doinsertfloatinfo} \def\page_one_place_float_bottom_indeed @@ -561,25 +570,26 @@ \defineoutputroutine [\s!singlecolumn] - [\s!page_otr_command_routine =\page_one_command_routine, - \s!page_otr_command_package_contents =\page_one_command_package_contents, - \s!page_otr_command_set_vsize =\page_one_command_set_vsize, - \s!page_otr_command_set_hsize =\page_one_command_set_hsize, - \s!page_otr_command_next_page =\page_one_command_next_page, - \s!page_otr_command_next_page_and_inserts =\page_one_command_next_page_and_inserts, - % \s!page_otr_command_synchronize_hsize =\page_one_command_synchronize_hsize, - \s!page_otr_command_set_top_insertions =\page_one_command_set_top_insertions, - \s!page_otr_command_set_bottom_insertions =\page_one_command_set_bottom_insertions, - \s!page_otr_command_flush_top_insertions =\page_one_command_flush_top_insertions, - \s!page_otr_command_flush_bottom_insertions =\page_one_command_flush_bottom_insertions, - % \s!page_otr_command_set_float_hsize =\page_one_command_set_float_hsize, - \s!page_otr_command_check_if_float_fits =\page_one_command_check_if_float_fits, - \s!page_otr_command_flush_float_box =\page_one_command_flush_float_box, - \s!page_otr_command_synchronize_side_floats =\page_one_command_synchronize_side_floats, - \s!page_otr_command_side_float_output =\page_one_command_side_float_output, - \s!page_otr_command_flush_floats =\page_one_command_flush_floats, - \s!page_otr_command_flush_side_floats =\page_one_command_flush_side_floats, - \s!page_otr_command_flush_saved_floats =\page_one_command_flush_saved_floats + [\s!page_otr_command_routine =\page_one_command_routine, + \s!page_otr_command_package_contents =\page_one_command_package_contents, + \s!page_otr_command_set_vsize =\page_one_command_set_vsize, + \s!page_otr_command_set_hsize =\page_one_command_set_hsize, + \s!page_otr_command_next_page =\page_one_command_next_page, + \s!page_otr_command_next_page_and_inserts =\page_one_command_next_page_and_inserts, + % \s!page_otr_command_synchronize_hsize =\page_one_command_synchronize_hsize, + \s!page_otr_command_set_top_insertions =\page_one_command_set_top_insertions, + \s!page_otr_command_set_bottom_insertions =\page_one_command_set_bottom_insertions, + \s!page_otr_command_flush_top_insertions =\page_one_command_flush_top_insertions, + \s!page_otr_command_flush_bottom_insertions=\page_one_command_flush_bottom_insertions, + % \s!page_otr_command_set_float_hsize =\page_one_command_set_float_hsize, + \s!page_otr_command_check_if_float_fits =\page_one_command_check_if_float_fits, + \s!page_otr_command_flush_float_box =\page_one_command_flush_float_box, + \s!page_otr_command_synchronize_side_floats=\page_one_command_synchronize_side_floats, + \s!page_otr_command_side_float_output =\page_one_command_side_float_output, + \s!page_otr_command_flush_floats =\page_one_command_flush_floats, + \s!page_otr_command_flush_side_floats =\page_one_command_flush_side_floats, + \s!page_otr_command_flush_saved_floats =\page_one_command_flush_saved_floats, + \s!page_otr_command_flush_margin_blocks =\page_one_command_flush_margin_blocks ] % \setupoutputroutine diff --git a/tex/context/base/page-otr.mkvi b/tex/context/base/page-otr.mkvi index fd96054cf..19c308c32 100644 --- a/tex/context/base/page-otr.mkvi +++ b/tex/context/base/page-otr.mkvi @@ -255,6 +255,7 @@ \definesystemconstant{page_otr_command_flush_floats} \definesystemconstant{page_otr_command_flush_side_floats} \definesystemconstant{page_otr_command_flush_saved_floats} +\definesystemconstant{page_otr_command_flush_margin_blocks} \definesystemconstant{singlecolumn} \definesystemconstant{multicolumn} @@ -279,7 +280,8 @@ \s!page_otr_command_synchronize_side_floats, \s!page_otr_command_flush_floats, \s!page_otr_command_flush_side_floats, - \s!page_otr_command_flush_saved_floats] + \s!page_otr_command_flush_saved_floats, + \s!page_otr_command_flush_margin_blocks] \appendtoks \setupoutputroutine[\s!singlecolumn]% diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index 9eb810a19..467f22493 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -2553,7 +2553,7 @@ [\s!page_otr_command_routine =\page_set_command_routine, \s!page_otr_command_package_contents =\page_set_command_package_contents, \s!page_otr_command_set_vsize =\page_set_command_set_vsize, -% \s!page_otr_command_set_hsize =\page_one_command_set_hsize, % tricky, goes wrong + % \s!page_otr_command_set_hsize =\page_one_command_set_hsize, % tricky, goes wrong \s!page_otr_command_next_page =\page_set_command_next_page, \s!page_otr_command_next_page_and_inserts =\page_set_command_next_page_and_inserts, \s!page_otr_command_synchronize_hsize =\page_set_command_synchronize_hsize, @@ -2569,6 +2569,7 @@ \s!page_otr_command_flush_floats =\page_set_command_flush_floats, \s!page_otr_command_flush_side_floats =\page_set_command_flush_side_floats, \s!page_otr_command_flush_saved_floats =\page_set_command_flush_saved_floats + % \s!page_otr_command_flush_margin_blocks =\page_set_command_flush_margin_blocks, % not used ] \protect \endinput diff --git a/tex/context/base/spac-ali.mkiv b/tex/context/base/spac-ali.mkiv index 7a75002ea..6bfba019f 100644 --- a/tex/context/base/spac-ali.mkiv +++ b/tex/context/base/spac-ali.mkiv @@ -831,14 +831,22 @@ \installcorenamespace{alignline} -\letvalue{\??alignline\v!left }\leftaligned -\letvalue{\??alignline\v!right }\rightaligned \letvalue{\??alignline\v!middle }\midaligned -\letvalue{\??alignline\v!flushleft }\rightaligned -\letvalue{\??alignline\v!flushright}\leftaligned \letvalue{\??alignline\v!center }\midaligned \letvalue{\??alignline\v!max }\maxaligned +% was wrong +% +% \letvalue{\??alignline\v!left }\leftaligned +% \letvalue{\??alignline\v!right }\rightaligned +% \letvalue{\??alignline\v!flushleft }\rightaligned +% \letvalue{\??alignline\v!flushright}\leftaligned + +\letvalue{\??alignline\v!left }\rightaligned +\letvalue{\??alignline\v!right }\leftaligned +\letvalue{\??alignline\v!flushleft }\leftaligned +\letvalue{\??alignline\v!flushright}\rightaligned + \def\doalignedline#1{\resetrealignsignal\csname\??alignline#1\endcsname} %D Experimental (will be redone when floats are redone as it's real messy diff --git a/tex/context/base/spac-ver.lua b/tex/context/base/spac-ver.lua index 593f60e77..55ba5e7b8 100644 --- a/tex/context/base/spac-ver.lua +++ b/tex/context/base/spac-ver.lua @@ -1301,7 +1301,7 @@ local builders = nodes.builders local actions = nodes.tasks.actions("vboxbuilders") -function nodes.builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction) +function builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction) local done = false if head then starttiming(builders) @@ -1329,7 +1329,7 @@ end local actions = nodes.tasks.actions("mvlbuilders") -function nodes.builders.buildpage_filter(groupcode) +function builders.buildpage_filter(groupcode) starttiming(builders) local head = texlists.contrib_head local head, done = actions(head,groupcode) @@ -1338,8 +1338,8 @@ function nodes.builders.buildpage_filter(groupcode) return (done and head) or true end -callbacks.register('vpack_filter', nodes.builders.vpack_filter, "vertical spacing etc") -callbacks.register('buildpage_filter', nodes.builders.buildpage_filter, "vertical spacing etc (mvl)") +callbacks.register('vpack_filter', builders.vpack_filter, "vertical spacing etc") +callbacks.register('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)") statistics.register("v-node processing time", function() return statistics.elapsedseconds(builders) diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 368ad4a97..4e9c140a3 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 7687b37a7..aa49e4e0b 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/strc-flt.mkvi b/tex/context/base/strc-flt.mkvi index 5dffb34e2..ba1f4e29c 100644 --- a/tex/context/base/strc-flt.mkvi +++ b/tex/context/base/strc-flt.mkvi @@ -776,15 +776,32 @@ \strc_floats_get_box \global\insidefloatfalse} +% \def\strc_floats_set_local_hsize +% {\iflocalcenterfloatbox +% \seteffectivehsize +% \hsize\localhsize +% \else +% \doifinset\v!margin\floatlocation % brr, really needed! see wm will be redone +% {\let\currentmarginblock\empty +% \hsize\marginblockparameter\c!width}% +% \fi} + +\newdimen\availablefloatwidth +\newdimen\availablefloatheight + \def\strc_floats_set_local_hsize {\iflocalcenterfloatbox + % also available check here? \seteffectivehsize \hsize\localhsize \else \doifinset\v!margin\floatlocation % brr, really needed! see wm will be redone - {\let\currentmarginblock\empty - \hsize\marginblockparameter\c!width}% - \fi} + {\hsize\namedmarginblockparameter\empty\c!width}% + \fi + \edef\p_availablewidth {\floatparameter\c!availablewidth }% + \edef\p_availableheight{\floatparameter\c!availableheight}% + \availablefloatwidth \ifx\p_availablewidth \empty\hsize\else\p_availablewidth \relax\fi + \availablefloatheight\ifx\p_availableheight\empty\vsize\else\p_availableheight\relax\fi} \ifdefined\everyinsidefloat \else \newevery \everyinsidefloat \relax \fi @@ -880,30 +897,6 @@ {\let\extrafloatlocation#rightpagelocation}% {\let\extrafloatlocation#leftpagelocation}} -% \def\strc_floats_check_extra_actions -% {\doifnotinset\v!text\floatlocation % fuzzy, text overloads left, since then it's a directive -% {\let\extrafloatlocation\empty -% % \sidefloatdownshift will be reset afterwards, and can -% % already be set at this point -% \processallactionsinset -% [\floatlocation] % ininner/inouter : for old times sake -% [ \v!inner=>\strc_floats_set_extra_action\v!left \v!right, -% \v!outer=>\strc_floats_set_extra_action\v!right \v!left, -% \v!innermargin=>\strc_floats_set_extra_action\v!leftmargin \v!rightmargin, -% \v!outermargin=>\strc_floats_set_extra_action\v!rightmargin\v!leftmargin, -% \v!inneredge=>\strc_floats_set_extra_action\v!leftedge \v!rightedge, -% \v!outeredge=>\strc_floats_set_extra_action\v!rightedge \v!leftedge, -% \v!backspace=>\strc_floats_set_extra_action\v!backspace \v!cutspace, -% \v!cutspace=>\strc_floats_set_extra_action\v!cutspace \v!backspace, -% % \v!margin=>\strc_floats_set_extra_action\v!cutspace \v!backspace, -% \v!left=>\strc_floats_set_extra_action\v!left \v!left, -% \v!right=>\strc_floats_set_extra_action\v!right \v!right, -% \v!line=>, % only -n*line is handled (see ***) -% \s!unknown=>{\movedownsidefloat[\commalistelement]}]% -% \ifx\extrafloatlocation\empty \else -% \edef\floatlocation{\extrafloatlocation,\floatlocation}% -% \fi}} - \installcorenamespace{extrafloataction} \setvalue{\??extrafloataction \v!inner}#1{\strc_floats_set_extra_action\v!left \v!right} @@ -937,41 +930,6 @@ % pas op, maxbreedte niet instellen als plaats=links/rechts -% \def\strc_floats_set_local_dimensions -% {\global\sidefloatshift \zeropoint % duplicate -% \global\sidefloatmaximum\zeropoint\relax % duplicate -% \ifdim\sidefloatdownshift=\zeropoint\else -% \global\setbox\floatbox\vbox -% {\vskip\sidefloatdownshift\nointerlineskip\box\floatbox}% -% \fi -% \doifsomething{\floatparameter\c!minwidth} -% {\scratchdimen\floatparameter\c!minwidth\relax -% \ifdim\wd\floatbox<\scratchdimen -% \global\setbox\floatbox\hbox to \scratchdimen -% {\doifnot{\floatparameter\c!location}\v!left \hss -% \box\floatbox -% \doifnot{\floatparameter\c!location}\v!right\hss}% -% \fi}% -% \doifinset\v!hanging\floatlocation -% {\doifcommonelse{\v!inleft,\v!leftmargin}\floatlocation -% {\letfloatparameter\c!maxwidth\leftmarginwidth}% -% {\doifcommon{\v!inright,\v!rightmargin}\floatlocation -% {\letfloatparameter\c!maxwidth\rightmarginwidth}}}% -% \doifsomething{\floatparameter\c!maxwidth} -% {\scratchdimen\floatparameter\c!maxwidth\relax -% \ifdim\wd\floatbox>\scratchdimen -% \doifcommonelse{\v!inright,\v!rightmargin,\v!rightedge,\v!inleft,\v!leftmargin,\v!leftedge}\floatlocation -% {\global\sidefloatmaximum\scratchdimen} -% {\global\setbox\floatbox\hbox to \scratchdimen -% {\doifcommonelse{\v!right,\v!left}\floatlocation -% {\doifnotinset\v!right\floatlocation\hss -% \box\floatbox -% \doifnotinset\v!left\floatlocation\hss}% -% {\doifnot{\floatparameter\c!location}\v!left\hss -% \box\floatbox -% \doifnot{\floatparameter\c!location}\v!right\hss}}}% -% \fi}} - \def\strc_floats_set_local_dimensions {\global\sidefloatshift \zeropoint % duplicate \global\sidefloatmaximum\zeropoint\relax % duplicate @@ -1233,8 +1191,8 @@ \or % manual \fi \ifcase\floatrotation -\doifnotinset\v!margin\floatlocation % brr, really needed! see wm - {\postcenterfloatbox\d_strc_floats_content}% + \doifnotinset\v!margin\floatlocation % brr, really needed! see wm + {\postcenterfloatbox\d_strc_floats_content}% \else \global\setbox\floatbox\vbox {\rotate[\c!rotation=\number\floatrotation]{\box\floatbox}}% @@ -1940,6 +1898,9 @@ \unexpanded\def\installfloatmethod#1#2#3% routine keyword handler {\setvalue{\??floatmethods#1:#2}{#3}} +\unexpanded\def\handlefloatmethod#1% + {\csname\??floatmethods\currentoutputroutine:#1\endcsname} + % \unexpanded\def\installfloatmethod#1#2#3% routine keyword handler % {\ifcsname\??floatsettings#1:#2\endcsname \else % \expandafter\newtoks\csname\??floatsettings#1:#2\endcsname diff --git a/tex/context/base/strc-itm.mkvi b/tex/context/base/strc-itm.mkvi index a33b9a965..50b4035c2 100644 --- a/tex/context/base/strc-itm.mkvi +++ b/tex/context/base/strc-itm.mkvi @@ -244,6 +244,7 @@ \def\strc_itemgroups_insert_reference_indeed % maybe we need a 'frozen counter' numberdata blob {\setnextinternalreference + % no need to collect nodes in \b_strc_destination_nodes here ... maybe at some point \ctxlua {structures.references.setandgetattribute("\s!full", "\referenceprefix","\currentitemreference", { metadata = { diff --git a/tex/context/base/strc-lst.mkvi b/tex/context/base/strc-lst.mkvi index fd98ee2d1..16544f866 100644 --- a/tex/context/base/strc-lst.mkvi +++ b/tex/context/base/strc-lst.mkvi @@ -784,10 +784,11 @@ \setfalse\c_lists_show_number \fi \fi + \strc_lists_interaction_check \to \t_lists_every_renderingsetup \appendtoks - \strc_lists_interaction_check % this can insert a node (latelua) + \strc_references_flush_destination_nodes \to \t_lists_every_renderingsynchronize \appendtoks @@ -1163,6 +1164,7 @@ \listparameter\c!after \fi \stopsetups + %D List elements are packaged in such a way that we can click on them %D in an interactive document. Here are a few helpers. @@ -1191,7 +1193,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 - \dogetsimplepagereference{internal(\currentlistentrylocation)}% + \strc_references_get_simple_page_reference{internal(\currentlistentrylocation)}% \a_strc_lists_reference\currentreferenceattribute \else \a_strc_lists_reference\attributeunsetvalue @@ -1207,7 +1209,7 @@ \fi \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter ! \ifx\p_interaction_backward\v!list - \dosetsimplepagereference{bck:\currentlistentrylocation}% + \strc_references_set_simple_page_reference{bck:\currentlistentrylocation}% \a_strc_lists_destination\currentdestinationattribute \else \a_strc_lists_destination\attributeunsetvalue @@ -1227,6 +1229,8 @@ \let\strc_lists_set_destination_attribute\empty \let\strc_lists_set_style_color \strc_lists_set_style_color_normal} +\strc_lists_interaction_check_nop + \def\strc_lists_get_reference_attribute_indeed#element% {\ifx#element\p_interaction_forward attr \referenceattribute\a_strc_lists_reference diff --git a/tex/context/base/strc-not.mkvi b/tex/context/base/strc-not.mkvi index 4c16afb91..f8f25900f 100644 --- a/tex/context/base/strc-not.mkvi +++ b/tex/context/base/strc-not.mkvi @@ -505,13 +505,13 @@ \endcsname} \setvalue{\??noteinteractioninline\v!yes}% - {\dogetsimplepagereference{page(\ctxlua{structures.notes.getnumberpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getnumberpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_get_reference_attribute_symbol{attr\referenceattribute\currentreferenceattribute}% \let \strc_notes_set_style_color_inline \strc_notes_set_style_color_inline_yes} \setvalue{\??noteinteractioninline\v!all}% - {%\dogetsimplepagereference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% - \dogetsimplepagereference{note:\currentnote:\currentnotenumber}% + {%\strc_references_get_simple_page_reference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% + \strc_references_get_simple_page_reference{note:\currentnote:\currentnotenumber}% \edef\strc_notes_get_reference_attribute_symbol{attr\referenceattribute\currentreferenceattribute}% \let \strc_notes_set_style_color_inline \strc_notes_set_style_color_inline_yes} @@ -523,7 +523,7 @@ \expandafter\let\csname\??noteinteractioninline\v!text \expandafter\endcsname\csname\??noteinteractioninline\v!yes\endcsname \setvalue{\??noteinteractiondisplay\v!yes}% - {\dogetsimplepagereference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_set_reference_attribute_number{\attribute\referenceattribute\currentreferenceattribute}% \let \strc_notes_set_reference_attribute_text \donothing \let \strc_notes_set_destination_attribute_text\donothing @@ -536,19 +536,19 @@ \let\strc_notes_set_style_color_display \strc_notes_set_style_color_display_nop} \setvalue{\??noteinteractiondisplay\v!all}% - {\dogetsimplepagereference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_set_reference_attribute_text {\attribute\referenceattribute\currentreferenceattribute}% - %\dosetsimplepagereference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% - \dosetsimplepagereference{note:\currentnote:\currentnotenumber}% + %\strc_references_set_simple_page_reference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% + \strc_references_set_simple_page_reference{note:\currentnote:\currentnotenumber}% \edef\strc_notes_set_destination_attribute_text{\attribute\destinationattribute\currentdestinationattribute}% \let \strc_notes_set_reference_attribute_number\strc_notes_set_reference_attribute_text \let \strc_notes_set_style_color_display \strc_notes_set_style_color_display_yes} \setvalue{\??noteinteractiondisplay\v!text}% - {\dogetsimplepagereference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% + {\strc_references_get_simple_page_reference{page(\ctxlua{structures.notes.getsymbolpage("\currentnote",\currentnotenumber)})}% \edef\strc_notes_set_reference_attribute_text {\attribute\referenceattribute\currentreferenceattribute}% - %\dosetsimplepagereference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% - \dosetsimplepagereference{note:\currentnote:\currentnotenumber}% + %\strc_references_set_simple_page_reference{note:\cldcontext{structures.notes.internalid("\currentnote",\currentnotenumber)}}% + \strc_references_set_simple_page_reference{note:\currentnote:\currentnotenumber}% \edef\strc_notes_set_destination_attribute_text{\attribute\destinationattribute\currentdestinationattribute}% \let \strc_notes_set_reference_attribute_number\donothing \let \strc_notes_set_style_color_display \strc_notes_set_style_color_display_yes} @@ -1101,6 +1101,7 @@ \strc_notes_set_reference_attribute_text \strc_constructions_stored_start \begstrut + \strc_references_flush_destination_nodes \strc_notes_set_destination_attribute_text \strc_notes_inject_text \endstrut diff --git a/tex/context/base/strc-ref.mkvi b/tex/context/base/strc-ref.mkvi index 65c0837d3..0a0f0a546 100644 --- a/tex/context/base/strc-ref.mkvi +++ b/tex/context/base/strc-ref.mkvi @@ -123,7 +123,14 @@ \expandafter\gobblefourarguments \fi} -\def\strc_references_set_named_reference_indeed#kind#labels#userdata#text% labels userdata text -> todo: userdata +\newbox\b_strc_destination_nodes + +\unexpanded\def\strc_references_flush_destination_nodes + {\ifvoid\b_strc_destination_nodes \else + \unhbox\b_strc_destination_nodes + \fi} + +\unexpanded\def\strc_references_set_named_reference_indeed#kind#labels#userdata#text% labels userdata text -> todo: userdata {\ifreferencing % we could have a more efficient one for page references but for the moment % we don't care too much @@ -149,8 +156,9 @@ \fi % beware, the structures.references.set writes a % \setnextinternalreference - \ctxlua{structures.references.setandgetattribute("\currentreferencekind", "\referenceprefix","\currentreferencelabels", - { + \setbox\b_strc_destination_nodes\hbox\bgroup % messybut we need the delay + \ctxlua{structures.references.setandgetattribute("\currentreferencekind", "\referenceprefix","\currentreferencelabels", + { references = { % internal = \nextinternalreference, % no need for an internal as we have an explicit block = "\currentsectionblock", @@ -172,25 +180,31 @@ userdata = structures.helpers.touserdata(\!!bs\detokenize{#userdata}\!!es) \fi },"\interactionparameter\c!focus") - }% + }% + \egroup \fi \else + \setbox\b_strc_destination_nodes\emptyhbox \lastdestinationattribute\attributeunsetvalue \fi % will become obsolete: \xdef\currentdestinationattribute{\number\lastdestinationattribute}% % will become an option: \ifnum\lastdestinationattribute>\zerocount - \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute{}% + \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup + \strc_references_flush_destination_nodes + \egroup \fi} \def\strc_references_set_page_only_destination_attribute#labels% could in fact be fully expandable {\ifreferencing \edef\currentreferencelabels{#labels}% \ifx\currentreferencelabels\empty + \setbox\b_strc_destination_nodes\emptyhbox \lastdestinationattribute\attributeunsetvalue \else - \ctxlua{structures.references.setandgetattribute("page", "\referenceprefix","\currentreferencelabels", + \setbox\b_strc_destination_nodes\hbox\bgroup % messybut we need the delay + \ctxlua{structures.references.setandgetattribute("\s!page", "\referenceprefix","\currentreferencelabels", { references = { block = "\currentsectionblock", @@ -200,9 +214,11 @@ kind = "page", }, },"\interactionparameter\c!focus") - }% + }% + \egroup \fi \else + \setbox\b_strc_destination_nodes\emptyhbox \lastdestinationattribute\attributeunsetvalue \fi} @@ -223,10 +239,11 @@ %D For internal usage: -\def\dosetsimplepagereference#label% beware, not that ok as it injects a dummy ... brrr +\def\strc_references_set_simple_page_reference#label% {\iflocation - \ctxlua{structures.references.setandgetattribute("\s!page", "\referenceprefix","#label", - { + \setbox\b_strc_destination_nodes\hbox\bgroup + \ctxlua{structures.references.setandgetattribute("\s!page", "\referenceprefix","#label", + { references = { % block = "\currentsectionblock", % section = structures.sections.currentid(), @@ -234,14 +251,16 @@ metadata = { % we could assume page to have no metadata kind = "\s!page", }, - },"\interactionparameter\c!focus") - }% + },"\interactionparameter\c!focus") + }% + \egroup \xdef\currentdestinationattribute{\number\lastdestinationattribute}% \else + \setbox\b_strc_destination_nodes\emptyhbox \xdef\currentdestinationattribute{\number\attributeunsetvalue}% \fi} -\def\dogetsimplepagereference#label% +\def\strc_references_get_simple_page_reference#label% {\iflocation \ctxlua{structures.references.inject("\referenceprefix","#label",\number\ht\strutbox,\number\dp\strutbox,\extrareferencearguments)}% \xdef\currentreferenceattribute{\number\lastreferenceattribute}% diff --git a/tex/context/base/strc-ren.mkiv b/tex/context/base/strc-ren.mkiv index de8a2da6b..543c55fff 100644 --- a/tex/context/base/strc-ren.mkiv +++ b/tex/context/base/strc-ren.mkiv @@ -129,13 +129,13 @@ {\edef\currentheadinteraction{\headparameter\c!interaction}% \ifx\currentheadinteraction\v!list % setuphead[<section>][interaction=list,...] - \dogetsimplepagereference{bck:\nextinternalreference}% + \strc_references_get_simple_page_reference{bck:\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 - \dogetsimplepagereference\currentheadbackreference + \strc_references_get_simple_page_reference\currentheadbackreference \let\currentstructurereferenceattribute\currentreferenceattribute \fi \else diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv index 0294f4f88..e9b613f21 100644 --- a/tex/context/base/strc-sec.mkiv +++ b/tex/context/base/strc-sec.mkiv @@ -52,6 +52,10 @@ \def\getsomefullstructurenumber#1#2{\ctxlua{structures.sections.fullnumber(#1,"#2")}} \def\getspecificstructuretitle #1{\ctxlua{structures.sections.structuredata("#1","titledata.title",nil,"\headparameter\s!catcodes")}}% +% will be: +% +% \def\getfullstructurenumber #1{\ctxcommand{structurenumber(\thenamedheadlevel{#1})}} + % structure heads (like \startchapter) % \c!deeptextcommand, \c!deepnumbercommand: undefined ! @@ -276,17 +280,20 @@ {\setfalse\currentstructureown %\globalpushmacro\currenthead % this does not work out well \xdef\currenthead{#1}% + \setsystemmode\currenthead % new, also here now \headparameter\c!beforesection % beware, no users vars set yet \the\everybeforehead \dohandlehead{#1}{#2}{#3}% name -- -- -- userdata (we might move the tagged to here) \headparameter\c!insidesection} \unexpanded\def\dostophead[#1]% !!! also used at lua end - {\dostoptagged\dostoptagged + {\dostoptagged + \dostoptagged %\globalpopmacro\currenthead % so we do a hard recover \xdef\currenthead{#1}% recover \headparameter\c!aftersection - \the\everyafterhead} + \the\everyafterhead + \resetsystemmode\currenthead} % new, also here now % \unexpanded\def\donexthead[#1][#2][#3]% obsolete % {\setfalse\currentstructureown @@ -376,9 +383,6 @@ % BEWARE: \marking[section]{my text} does not work as we use list indices instead % so we need a 'keep track of raw set option' (or maybe a funny internal prefix) -% \unexpanded\def\setheadmarking -% {\normalexpanded{\noexpand\setmarking[\currenthead]{\currentstructurelistnumber}}} - \unexpanded\def\setheadmarking % li:: so that we can use \marking[section]{Taco needed this} {\normalexpanded{\setmarking[\currenthead]{li::\currentstructurelistnumber}}} @@ -586,17 +590,23 @@ {\setheadmarking \getheadsyncs} -\unexpanded\def\placecurrentheadhidden - {\setxvalue{\currenthead:hidden:attr}% +\installcorenamespace{hiddenheadattr} +\installcorenamespace{hiddenheadsync} + +% todo: when in the page builder we need to resolve the marking immediately +% because otherwise we have an async + +\unexpanded\def\placecurrentheadhidden % maybe trialtypesetting check + {\setxvalue{\??hiddenheadattr\currenthead}% {\headreferenceattributes}% can be used when making a box - \setxvalue{\currenthead:hidden:sync}% - {\noexpand\letgvalue{\currenthead:hidden:sync}\relax - \noexpand\setmarking[\currentheadcoupling]{\currentstructurelistnumber}% + \setxvalue{\??hiddenheadsync\currenthead}% + {\noexpand\letgvalue{\??hiddenheadsync\currenthead}\relax + \noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}% \hbox\headreferenceattributes{}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference \currentstructuresynchronize}} % and it's a node anyway -\def\synchronizehead #1{\csname#1:hidden:sync\endcsname} -\def\theheadreferenceattributes#1{\csname#1:hidden:attr\endcsname} +\def\synchronizehead #1{\csname\??hiddenheadsync#1\endcsname} +\def\theheadreferenceattributes#1{\csname\??hiddenheadattr#1\endcsname} \unexpanded\def\placerawheaddata [#1]{\synchronizehead{#1}} \unexpanded\def\placerawheadtext [#1]{\getspecificstructuretitle{\thenamedheadlevel{#1}}} diff --git a/tex/context/base/typo-mar.mkiv b/tex/context/base/typo-mar.mkiv index 788b7b3dd..e1b25a9ae 100644 --- a/tex/context/base/typo-mar.mkiv +++ b/tex/context/base/typo-mar.mkiv @@ -196,7 +196,10 @@ \ifx\currentmargindatastrut\empty \else \synchronizestrut\currentmargindatastrut \fi - \begstrut\margindataparameter\c!command{#content}\endstrut + \begstrut + \strc_references_flush_destination_nodes + \margindataparameter\c!command{#content}% + \endstrut \egroup \egroup \edef\currentmarginfirstheight{\number\dimexpr\framedfirstheight}% @@ -209,7 +212,10 @@ \ifx\currentmargindatastrut\empty \else \synchronizestrut\currentmargindatastrut \fi - \begstrut\margindataparameter\c!command{#content}\endstrut + \begstrut + \strc_references_flush_destination_nodes + \margindataparameter\c!command{#content}% + \endstrut \egroup \let\currentmarginfirstheight\empty \else @@ -223,7 +229,10 @@ \ifx\currentmargindatastrut\empty \else \dosetupstrut[\currentmargindatastrut]% \fi - \begstrut\margindataparameter\c!command{#content}\endstrut + \begstrut + \strc_references_flush_destination_nodes + \margindataparameter\c!command{#content}% + \endstrut \egroup \egroup \edef\currentmarginfirstheight{true}% diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index 24b7a1709..cd9939be7 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autosirka'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='osa'/> <cd:constant name='background' value='pozadi'/> <cd:constant name='backgroundcolor' value='barvapozadi'/> diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 8bf801e62..c8e629cdd 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autobreite'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='achsen'/> <cd:constant name='background' value='hintergrund'/> <cd:constant name='backgroundcolor' value='hintergrundfarbe'/> diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 975b65d7a..4b4f3c0e3 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autowidth'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='axis'/> <cd:constant name='background' value='background'/> <cd:constant name='backgroundcolor' value='backgroundcolor'/> diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index f426da007..04a9e4131 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autolargeur'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='axe'/> <cd:constant name='background' value='arriereplan'/> <cd:constant name='backgroundcolor' value='couleurarriereplan'/> diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index 73bf9db91..d75ac590a 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autoampiezza'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='asse'/> <cd:constant name='background' value='sfondo'/> <cd:constant name='backgroundcolor' value='coloresfondo'/> diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 6b89db114..96c4e3f39 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autobreedte'/> + <cd:constant name='availableheight' value='beschikbarehoogte'/> + <cd:constant name='availablewidth' value='beschikbarebreedte'/> <cd:constant name='axis' value='assenstelsel'/> <cd:constant name='background' value='achtergrond'/> <cd:constant name='backgroundcolor' value='achtergrondkleur'/> diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index cfb9d9dd3..8221fa0dc 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='آویزانخودکار'/> <cd:constant name='autostrut' value='بستخودکار'/> <cd:constant name='autowidth' value='عرضخودکار'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='محورها'/> <cd:constant name='background' value='پسزمینه'/> <cd:constant name='backgroundcolor' value='رنگپسزمینه'/> diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 9cf9c7846..9acca422b 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -564,6 +564,8 @@ <cd:constant name='autohang' value='autohang'/> <cd:constant name='autostrut' value='autostrut'/> <cd:constant name='autowidth' value='autolatime'/> + <cd:constant name='availableheight' value='availableheight'/> + <cd:constant name='availablewidth' value='availablewidth'/> <cd:constant name='axis' value='axa'/> <cd:constant name='background' value='fundal'/> <cd:constant name='backgroundcolor' value='culoarefundal'/> diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index d38a8fd5d..b0489ad34 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 04/02/12 22:23:43 +-- merge date : 04/06/12 23:08:20 do -- begin closure to overcome local limits and interference |