diff options
Diffstat (limited to 'tex')
35 files changed, 184 insertions, 145 deletions
diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index 5336c4458..3728bd16b 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -641,9 +641,9 @@ \c!text=\v!no, \c!style=\tt, \c!indentnext=\v!yes, - \c!margin=\!!zeropoint, - \c!evenmargin=\!!zeropoint, - \c!oddmargin=\!!zeropoint, + \c!margin=\zeropoint, + \c!evenmargin=\zeropoint, + \c!oddmargin=\zeropoint, \c!blank=\v!line, %\c!escape=, % yes | no | {START,STOP} | default when yes: {BTEX,ETEX} \c!numbering=\v!no, diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index f67ff38ef..4b79a732f 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.06.13 09:57} +\newcontextversion{2012.06.13 23:46} %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 59ebd9ad6..8db00b160 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.06.13 09:57} +\newcontextversion{2012.06.13 23:46} %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 c28388200..169d147e4 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 f8110d973..bcf424f66 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 f0f272d16..6230809f5 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.06.13 09:57} +\edef\contextversion{2012.06.13 23:46} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 1551bf94d..fd1d6539a 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.06.13 09:57} +\edef\contextversion{2012.06.13 23:46} %D For those who want to use this: diff --git a/tex/context/base/core-mis.mkiv b/tex/context/base/core-mis.mkiv index 2d615081f..030eef6a7 100644 --- a/tex/context/base/core-mis.mkiv +++ b/tex/context/base/core-mis.mkiv @@ -448,12 +448,12 @@ {\hrule \!!width \dimen0 \!!height \linewidth - \!!depth \!!zeropoint}}% - \def\verline% + \!!depth \zeropoint}}% + \def\verline {\vrule \!!width \linewidth \!!height \dimen2 - \!!depth \!!zeropoint}% + \!!depth \zeropoint}% \doglobal\newcounter\@@gridc \doglobal\newcounter\@@gridd \doglobal\newcounter\@@gride @@ -516,9 +516,9 @@ \c!unit=\@@rtunit]% \dorecurse\@@pszz{\position(##3,##4){##5}}}% \draw - \verline\@@rtnx\@@rtdx0\verline\!!zeropoint\!!zeropoint\v!start\empty + \verline\@@rtnx\@@rtdx0\verline\zeropoint\zeropoint\v!start\empty \draw - \horline\@@rtny0\@@rtdy\horline\!!zeropoint\!!zeropoint\v!start\empty + \horline\@@rtny0\@@rtdy\horline\zeropoint\zeropoint\v!start\empty \tfx \doifnot\@@rtxstep{0} {\setlegend\@@rtxstep\@@rtdx\@@rtx diff --git a/tex/context/base/font-run.mkiv b/tex/context/base/font-run.mkiv index b346de5e1..b2ccd0dda 100644 --- a/tex/context/base/font-run.mkiv +++ b/tex/context/base/font-run.mkiv @@ -50,7 +50,7 @@ &&##2\tfa##3&&##2\tfb##3&&##2\tfc##3&&##2\tfd##3&\cr}% \halign to \localhsize {\bigstrut{1.5}{2}##&\vrule## - \tabskip=\!!zeropoint \!!plus 1fill + \tabskip\zeropoint \!!plus 1fill &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## @@ -58,7 +58,7 @@ &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule - \tabskip=\!!zeropoint\cr + \tabskip=\zeropoint\cr \noalign{\hrule} &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil \llap{\string\mr\hbox to 1em{\hss:\hss}$\mr \languageparameter\c!text$\quad}\vrule}\cr @@ -89,7 +89,7 @@ \noalign{\hrule}} \halign to \localhsize {##&\vrule##\strut - \tabskip=\!!zeropoint \!!plus 1fill + \tabskip=\zeropoint \!!plus 1fill &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule diff --git a/tex/context/base/font-sol.lua b/tex/context/base/font-sol.lua index 08ab533dd..861331785 100644 --- a/tex/context/base/font-sol.lua +++ b/tex/context/base/font-sol.lua @@ -30,8 +30,8 @@ local trace_colors = false trackers.register("builders.paragraphs.solutions.s local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) local report_solutions = logs.reporter("fonts","solutions") -local report_splitters = logs.reporter("nodes","splitters") -local report_optimizers = logs.reporter("nodes","optimizers") +local report_splitters = logs.reporter("fonts","splitters") +local report_optimizers = logs.reporter("fonts","optimizers") local nodes, node = nodes, node @@ -41,8 +41,6 @@ local v_normal = variables.normal local v_reverse = variables.reverse local v_preroll = variables.preroll local v_random = variables.random -local v_less = variables.less -local v_more = variables.more local settings_to_array = utilities.parsers.settings_to_array local settings_to_hash = utilities.parsers.settings_to_hash @@ -110,7 +108,6 @@ local preroll = true local criterium = 0 local randomseed = nil local optimize = nil -- set later - local variant = "normal" local cache = { } @@ -128,6 +125,7 @@ local dummy = { criterium = 0, preroll = false, optimize = nil, + variant = "normal", } local function checksettings(r,settings) @@ -136,6 +134,7 @@ local function checksettings(r,settings) local optimize for k, v in next, method do if variants[k] then + variant = k optimize = variants[k] -- last? end end @@ -181,8 +180,7 @@ end local contextsetups = fonts.specifiers.contextsetups -local function convert(featuresets,name,set,what) - local list = set[what] +local function convert(featuresets,name,list) if list then local numbers = { } local nofnumbers = 0 @@ -407,12 +405,12 @@ local function doit(word,list,best,width,badness,line,set,listdir) end elseif set == "less" then for n in traverse_nodes(first) do - setnodecolor(n,"font:isol") + setnodecolor(n,"font:isol") -- yellow set_attribute(n,0,featurenumber) end else for n in traverse_nodes(first) do - setnodecolor(n,"font:medi") + setnodecolor(n,"font:medi") -- green set_attribute(n,0,featurenumber) end end @@ -548,8 +546,6 @@ variants[v_random] = function(words,list,best,width,badness,line,set,listdir) end end -optimize = variants.normal -- the default - local function show_quality(current,what,line) local set = current.glue_set local sign = current.glue_sign @@ -726,6 +722,6 @@ end commands.definefontsolution = splitters.define commands.startfontsolution = splitters.start commands.stopfontsolution = splitters.stop -commands.setfontsolution = splitters.start -commands.resetfontsolution = splitters.stop +commands.setfontsolution = splitters.set +commands.resetfontsolution = splitters.reset diff --git a/tex/context/base/font-sol.mkiv b/tex/context/base/font-sol.mkiv index 2c6bf8860..d2808feb2 100644 --- a/tex/context/base/font-sol.mkiv +++ b/tex/context/base/font-sol.mkiv @@ -13,6 +13,8 @@ \writestatus{loading}{ConTeXt Node Support / Splitters} +% todo: pass color for tracing + %D This module is specially made for the oriental \TEX\ project. The working is as %D follows (and tuned for fonts like Idris' Husayni. The following method came to %D my mind after a couple of Skype sessions with Idris while working on the rough @@ -93,7 +95,7 @@ \unexpanded\def\setfontsolution[#1]% just one {\edef\currentfontsolution{#1}% - \ctxcommand{setfontsolution("\currentfontsolution", { + \ctxcommand{setfontsolution("\currentfontsolution",{ method = "\fontsolutionparameter\c!method", criterium = "\fontsolutionparameter\c!criterium", % randomseed = "\fontsolutionparameter\c!random", diff --git a/tex/context/base/grph-epd.mkiv b/tex/context/base/grph-epd.mkiv index 947128b6b..d0d2e1b81 100644 --- a/tex/context/base/grph-epd.mkiv +++ b/tex/context/base/grph-epd.mkiv @@ -26,9 +26,15 @@ \reference[\figurereference]{}% todo: dest area \stopsetups +\defineframed + [system_graphics_epdf] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!background={\v!foreground,system:graphics:epdf}] + \def\grph_epdf_add_overlay {\global\setbox\foundexternalfigure\vbox\bgroup - \framed[\c!offset=\v!overlay,\c!background={\v!foreground,system:graphics:epdf}]{\box\foundexternalfigure}% + \system_graphics_epdf{\box\foundexternalfigure}% \egroup} \appendtoks diff --git a/tex/context/base/grph-fig.mkiv b/tex/context/base/grph-fig.mkiv index 72fb91d4b..6935ebe7e 100644 --- a/tex/context/base/grph-fig.mkiv +++ b/tex/context/base/grph-fig.mkiv @@ -280,9 +280,9 @@ {\def\docommand##1% {\color[##1] {\blackrule - [\c!width=2em, - \c!height=1ex, - \c!depth=\!!zeropoint]}% + [\c!width=2\emwidth, + \c!height=\exheight, + \c!depth=\zeropoint]}% \endgraf}% \global\setbox\colorbarbox\vbox {\forgetall diff --git a/tex/context/base/grph-trf.mkiv b/tex/context/base/grph-trf.mkiv index 5984c8a06..ec7455e18 100644 --- a/tex/context/base/grph-trf.mkiv +++ b/tex/context/base/grph-trf.mkiv @@ -653,10 +653,10 @@ \c!n=1, % was 2 \c!nx=\@@cpn,\c!x=1,\c!sx=1, \c!ny=\@@cpn,\c!y=1,\c!sy=1, - \c!width=\!!zeropoint, - \c!height=\!!zeropoint, - \c!hoffset=\!!zeropoint, - \c!voffset=\!!zeropoint, + \c!width=\zeropoint, + \c!height=\zeropoint, + \c!hoffset=\zeropoint, + \c!voffset=\zeropoint, \c!offset=\zeropoint, \c!leftoffset=\@@cpoffset, % \zeropoint, \c!rightoffset=\@@cpoffset, % \zeropoint, diff --git a/tex/context/base/lpdf-epa.lua b/tex/context/base/lpdf-epa.lua index c8d23a618..03a36f2dc 100644 --- a/tex/context/base/lpdf-epa.lua +++ b/tex/context/base/lpdf-epa.lua @@ -111,9 +111,9 @@ function codeinjections.mergereferences(specification) local size = specification.size or "crop" -- todo local pagedata = document.pages[pagenumber] local annotations = pagedata.Annots - local namespace = format("lpdf-epa-%s-",file.removesuffix(file.basename(fullname))) - local reference = namespace .. pagenumber - if annotations.n > 0 then + if annotations and annotations.n > 0 then + local namespace = format("lpdf-epa-%s-",file.removesuffix(file.basename(fullname))) + local reference = namespace .. pagenumber local mediabox = pagedata.MediaBox local llx, lly, urx, ury = mediabox[1], mediabox[2], mediabox[3], mediabox[4] local width, height = xscale * (urx - llx), yscale * (ury - lly) -- \\overlaywidth, \\overlayheight diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index 7b92fd200..6c1880c90 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -167,6 +167,8 @@ return { "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", -- + "availablehsize", "localhsize", "setlocalhsize", + -- "nextbox", "dowithnextbox", "dowithnextboxcs", "dowithnextboxcontent", "dowithnextboxcontentcs", -- "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", diff --git a/tex/context/base/page-run.mkiv b/tex/context/base/page-run.mkiv index 62b1030ee..dabf37252 100644 --- a/tex/context/base/page-run.mkiv +++ b/tex/context/base/page-run.mkiv @@ -242,16 +242,16 @@ end [\v!page] [\c!frame=\v!on, \c!corner=\v!rectangular, - \c!frameoffset=\!!zeropoint, - \c!framedepth=\!!zeropoint, + \c!frameoffset=\zeropoint, + \c!framedepth=\zeropoint, \c!framecolor=layout:page] \setupbackgrounds [#1][#2] [\c!background=, \c!frame=\v!on, \c!corner=\v!rectangular, - \c!frameoffset=\!!zeropoint, - \c!framedepth=\!!zeropoint, + \c!frameoffset=\zeropoint, + \c!framedepth=\zeropoint, \c!framecolor=] \else\iffirstargument \showframe diff --git a/tex/context/base/page-sel.mkiv b/tex/context/base/page-sel.mkiv index cfa9b3737..27f094118 100644 --- a/tex/context/base/page-sel.mkiv +++ b/tex/context/base/page-sel.mkiv @@ -56,7 +56,7 @@ {\bgroup \dontcomplain \getfiguredimensions[#1]% - \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% + \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\zeropoint,#3]% \doifinset0{#2}{\emptyhbox\page}% \dorecurse\@@ipn {\dofilterpage{#1}\recurselevel @@ -70,7 +70,7 @@ {\bgroup \dontcomplain \getfiguredimensions[#1]% - \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% + \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\zeropoint,#3]% \doifelse{#2}\v!even {\dorecurse\@@ipn {\ifodd\recurselevel\relax\else\dofilterpage{#1}\recurselevel\fi}} @@ -104,7 +104,7 @@ [\c!n=\noffigurepages, \c!marking=\v!off, \c!scale=\!!thousand, - \c!offset=\!!zeropoint, + \c!offset=\zeropoint, #2]% \dorecurse\@@ipn {\vbox to \textheight @@ -300,8 +300,8 @@ \getparameters [\??ip] [\c!n=1, - \c!offset=\!!zeropoint, - \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint, + \c!offset=\zeropoint, + \c!hoffset=\zeropoint,\c!voffset=\zeropoint, \c!width=\figurewidth,\c!height=\figureheight,#2] \ifnum\@@ipn>\zerocount \definepapersize @@ -309,10 +309,10 @@ \setuppapersize [\s!dummy][\s!dummy] \setuplayout - [\c!backspace=\!!zeropoint,\c!topspace=\!!zeropoint, + [\c!backspace=\zeropoint,\c!topspace=\zeropoint, \c!height=\v!middle,\c!width=\v!middle, - \c!textdistance=\!!zeropoint, - \c!header=\!!zeropoint,\c!footer=\!!zeropoint] + \c!textdistance=\zeropoint, + \c!header=\zeropoint,\c!footer=\zeropoint] \fi \dorecurse\noffigurepages {\global\let\slicedpagenumber\recurselevel diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index 467f22493..99570004c 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -1429,7 +1429,7 @@ \dorecurse{\getvalue{\??mc#1\c!nright}} % todo {\dododefinecolumnset[#1][\recurselevel]}% % redo framed settings - \setupcolumnset[#1][1][\c!distance=\!!zeropoint]} + \setupcolumnset[#1][1][\c!distance=\zeropoint]} \def\dododefinecolumnset[#1][#2]% {\presetlocalframed diff --git a/tex/context/base/ppchtex.mkiv b/tex/context/base/ppchtex.mkiv index a14578ceb..37ab4d412 100644 --- a/tex/context/base/ppchtex.mkiv +++ b/tex/context/base/ppchtex.mkiv @@ -474,9 +474,9 @@ \or \resetchemicalcoordinates \setbox2\hbox{\ignoreMPboxdepth\getMPdrawing}% - \wd2=\!!zeropoint - \ht2=\!!zeropoint - \dp2=\!!zeropoint + \wd2\zeropoint + \ht2\zeropoint + \dp2\zeropoint \put {\box2} at 0 0 \endpicture \popMPdrawing @@ -515,9 +515,9 @@ \ifMPdrawingdone \resetchemicalcoordinates \setbox2\hbox{\ignoreMPboxdepth\getMPdrawing}% - \wd2=\!!zeropoint - \ht2=\!!zeropoint - \dp2=\!!zeropoint + \wd2\zeropoint + \ht2\zeropoint + \dp2\zeropoint \put {\box2} at 0 0 % \fi \endpicture @@ -2149,8 +2149,8 @@ \ifdim\wd4>\dimen2 \dimen0=\wd4 \fi \chemicaloutermolecule {#1} - {\ifdim\ht2>\!!zeropoint\box2\fi} % expands to \empty in test - {\ifdim\ht4>\!!zeropoint\box4\fi}% % expands to \empty in test + {\ifdim\ht2>\zeropoint\box2\fi} % expands to \empty in test + {\ifdim\ht4>\zeropoint\box4\fi}% % expands to \empty in test \egroup} \def\chemicalsingleouterarrow diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 0a7e12e4e..3b5e3291c 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 7483bbd83..fc2a6c247 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/strc-def.mkiv b/tex/context/base/strc-def.mkiv index 7917b7d83..396b4c154 100644 --- a/tex/context/base/strc-def.mkiv +++ b/tex/context/base/strc-def.mkiv @@ -29,7 +29,7 @@ %\c!deepnumbercommand=, %\c!deeptextcommand=, %\c!default=, - \c!distance=\!!zeropoint, + \c!distance=\zeropoint, \c!expansion=\v!no, %\c!file=, %\c!footer=, diff --git a/tex/context/base/strc-itm.mkvi b/tex/context/base/strc-itm.mkvi index 86acba33c..a621781c5 100644 --- a/tex/context/base/strc-itm.mkvi +++ b/tex/context/base/strc-itm.mkvi @@ -182,6 +182,7 @@ \newconditional\c_strc_itemgroups_columns \newconditional\c_strc_itemgroups_concat \newconditional\c_strc_itemgroups_txt +\newconditional\c_strc_itemgroups_extra \newconditional\c_strc_itemgroups_repeat % 0 = before/after @@ -452,6 +453,7 @@ % this will be a constant \setfalse\c_strc_itemgroups_head \setfalse\c_strc_itemgroups_sub + \setfalse\c_strc_itemgroups_symbol \setfalse\c_strc_itemgroups_columns % to be checked \let\m_strc_itemgroups_destination\empty @@ -584,9 +586,11 @@ {\processcommalist[#subcategories]{\strc_itemgroups_setup_list_level_b{#category}{#whatever}}}} \def\strc_itemgroups_increment_item_counter - {\ifconditional\c_strc_itemgroups_sub \else \ifx\strc_itemgroups_extra_symbol\empty - \strc_counters_increment_sub\v_strc_itemgroups_counter\currentitemlevel - \fi\fi} + {\ifconditional\c_strc_itemgroups_sub \else + \ifconditional\c_strc_itemgroups_symbol \else % \ifx\strc_itemgroups_extra_symbol\empty + \strc_counters_increment_sub\v_strc_itemgroups_counter\currentitemlevel + \fi + \fi} \unexpanded\def\strc_itemgroups_insert_item_counter {\ifconditional\c_strc_itemgroups_repeat @@ -1090,6 +1094,7 @@ \unexpanded\def\strc_itemgroups_start_symbol#text% {\def\strc_itemgroups_extra_symbol{#text}% + \settrue\c_strc_itemgroups_symbol \startitemgroupitem} \unexpanded\def\strc_itemgroups_start_dummy @@ -1117,6 +1122,7 @@ \unexpanded\def\strc_itemgroups_start_text#text% {\def\strc_itemgroups_extra_symbol{#text}% + \settrue\c_strc_itemgroups_symbol \settrue\c_strc_itemgroups_txt \startitemgroupitem} @@ -1219,29 +1225,31 @@ \unexpanded\def\strc_itemgroups_start_head_sym#text% {\def\strc_itemgroups_extra_symbol{#text}% + \settrue\c_strc_itemgroups_symbol \settrue\c_strc_itemgroups_head \strc_itemgroups_start_head} \def\strc_itemgroups_make_symbol_box {\setbox\b_strc_itemgroups\hbox {\ifconditional\c_strc_itemgroups_head - \ifx\strc_itemgroups_extra_symbol\empty - \useitemgroupstyleandcolor\c!headstyle\c!headcolor - \strc_itemgroups_used_symbol - \else + \ifconditional\c_strc_itemgroups_symbol \useitemgroupstyleandcolor\c!symstyle\c!symcolor \strc_itemgroups_extra_symbol + \else + \useitemgroupstyleandcolor\c!headstyle\c!headcolor + \strc_itemgroups_used_symbol \fi \else - \ifx\strc_itemgroups_extra_symbol\empty - \useitemgroupstyleandcolor\c!style\c!color - \strc_itemgroups_used_symbol - \else + \ifconditional\c_strc_itemgroups_symbol \useitemgroupstyleandcolor\c!symstyle\c!symcolor \strc_itemgroups_extra_symbol + \else + \useitemgroupstyleandcolor\c!style\c!color + \strc_itemgroups_used_symbol \fi \fi}% - \let\strc_itemgroups_extra_symbol\empty} + \let\strc_itemgroups_extra_symbol\empty + \setfalse\c_strc_itemgroups_symbol} \def\strc_itemgroups_make_fitting_box {\ifdim\wd\b_strc_itemgroups>\itemgroupparameter\c!maxwidth\scaledpoint\relax % brr, sp diff --git a/tex/context/base/strc-mat.mkiv b/tex/context/base/strc-mat.mkiv index 121808cd1..a6763e27e 100644 --- a/tex/context/base/strc-mat.mkiv +++ b/tex/context/base/strc-mat.mkiv @@ -39,12 +39,12 @@ \c!expansion=\v!yes, % maybe automatically \c!spacebefore=\v!big, \c!spaceafter=\formulaparameter\c!spacebefore, - \c!leftmargin=\!!zeropoint, - \c!rightmargin=\!!zeropoint, + \c!leftmargin=\zeropoint, + \c!rightmargin=\zeropoint, \c!indentnext=\v!no, \c!alternative=\s!default, \c!strut=\v!no, - \c!distance=1em] + \c!distance=\emwidth] \setupsubformulas % subformulas could be last in chain [\c!indentnext=\formulaparameter\c!indentnext] diff --git a/tex/context/base/strc-sbe.mkiv b/tex/context/base/strc-sbe.mkiv index a98b67885..460a5f0e1 100644 --- a/tex/context/base/strc-sbe.mkiv +++ b/tex/context/base/strc-sbe.mkiv @@ -29,7 +29,7 @@ \unexpanded\def\definesectionblock{\dotripleargument\dodefinesectionblock} \unexpanded\def\setupsectionblock {\dodoubleargument\dosetupsectionblock} -\def\setsectionblock {\dosingleargument\dosetsectionblock} +\unexpanded\def\setsectionblock {\dosingleargument\dosetsectionblock} \def\sectionblockparameter#1% {\csname diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index 0e43a6202..a29fbefee 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -4183,7 +4183,7 @@ %D %D \starttyping %D \def\rightword% -%D {\groupedcommand{\hfill\hbox}{\parfillskip\!!zeropoint}} +%D {\groupedcommand{\hfill\hbox}{\parfillskip\zeropoint}} %D %D .......... \rightword{the right way} %D \stoptyping @@ -5133,49 +5133,28 @@ %D These examples show us that an optional can be used. The %D value provided is added to \type{\localhsize}. -% todo: a fast non argument variant - \newdimen\localhsize -% \def\complexsetlocalhsize[#1]% don't change ! -% {\localhsize\hsize -% \ifnum\hangafter<\zerocount -% \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent -% \fi -% \advance\localhsize -\leftskip -% \advance\localhsize -\rightskip -% \advance\localhsize #1\relax} -% -% \def\simplesetlocalhsize -% {\complexsetlocalhsize[\zeropoint]} -% -% \definecomplexorsimple\setlocalhsize - \unexpanded\def\setlocalhsize % don't change ! {\doifnextoptionalelse \syst_helpers_set_local_hsize_yes \syst_helpers_set_local_hsize_nop} -% \def\syst_helpers_set_local_hsize_nop -% {\localhsize\hsize -% \ifnum\hangafter<\zerocount -% \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent -% \fi -% \advance\localhsize -\leftskip -% \advance\localhsize -\rightskip} - \def\syst_helpers_set_local_hsize_nop - {\localhsize\dimexpr - \hsize -\leftskip -\rightskip - \ifnum\hangafter<\zerocount - \ifdim\hangindent>\zeropoint-\else+\fi\hangindent - \fi - \relax} + {\localhsize\availablehsize} \def\syst_helpers_set_local_hsize_yes[#1]% {\syst_helpers_set_local_hsize_nop \advance\localhsize#1\relax} +\def\availablehsize + {\dimexpr + \hsize-\leftskip-\rightskip + \ifnum\hangafter<\zerocount + \ifdim\hangindent>\zeropoint-\else+\fi\hangindent + \fi + \relax} + %D \macros %D {doifvalue,doifnotvalue,doifelsevalue, %D doifnothing,doifsomething,doifelsenothing, @@ -6735,7 +6714,7 @@ \def\gobbleassigndimen#1\\{} \def\assigndimen#1#2% - {\afterassignment\gobbleassigndimen#1=#2\!!zeropoint\\} + {\afterassignment\gobbleassigndimen#1=#2\zeropoint\\} \def\setusage#1% {\expandafter\let\csname#1\endcsname\iftrue} diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv index dd1dc819f..79569e62e 100644 --- a/tex/context/base/tabl-ntb.mkiv +++ b/tex/context/base/tabl-ntb.mkiv @@ -720,7 +720,10 @@ \ifx\tbltblsetups\empty\else \doprocesslocalsetups\tbltblsetups \fi - \hsize\tbltbltextwidth + %\hsize\tbltbltextwidth + \doifelse\tbltbltextwidth\v!local + {\hsize\availablehsize} + {\hsize\tbltbltextwidth}% \processaction [\tbltblsplit] [ \v!yes=>\enableTBLbreaktrue, @@ -1502,7 +1505,7 @@ \c!header=, \c!spaceinbetween=, \c!maxwidth=8em, - \c!textwidth=\hsize, + \c!textwidth=\v!local, % was \hsize \c!split=\v!auto, \c!splitoffset=0pt, \c!distance=\zeropoint, % individual column diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv index 489287727..cd5bd8a06 100644 --- a/tex/context/base/tabl-tbl.mkiv +++ b/tex/context/base/tabl-tbl.mkiv @@ -2029,6 +2029,7 @@ % \dostarttagged\t!tabulate\empty \dostarttagged\t!tabulaterow\empty + \setfalse\inhibitmargindata % new per 2012.06.13 ... really needed \everycr\expandafter{\the\everycr\dostoptagged\dostarttagged\t!tabulaterow\empty}% \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}% \dostoptagged diff --git a/tex/context/base/tabl-xtb.mkvi b/tex/context/base/tabl-xtb.mkvi index 2382cae21..b5f123f43 100644 --- a/tex/context/base/tabl-xtb.mkvi +++ b/tex/context/base/tabl-xtb.mkvi @@ -97,6 +97,8 @@ \newcount\c_tabl_x_nesting \newcount\c_tabl_x_skip_mode % 1 = skip +\newdimen\d_tabl_x_textwidth + % \setupxtable[one][parent][a=b,c=d] % \setupxtable[one] [a=b,c=d] % \setupxtable [a=b,c=d] @@ -137,7 +139,7 @@ % \c!footer=, % \c!header=, \c!spaceinbetween=, - \c!textwidth=\hsize, + \c!textwidth=\v!local, % was \hsize, \c!textheight=\vsize, \c!distance=\zeropoint, % individual column \c!columndistance=\zeropoint, % each column (whole table) @@ -211,10 +213,11 @@ \unexpanded\def\tabl_x_start_named_indeed[#settings]% {\advance\c_tabl_x_nesting\plusone \dostarttagged\t!table\empty - \forgetall \iffirstargument \setupcurrentxtable[#settings]% \fi + \tabl_x_check_textwidth + \forgetall \edef\tabl_x_current_buffer{\tabl_x_default_buffer}% \normalexpanded{\buff_pickup{\tabl_x_current_buffer}{\e!start\currentxtable}{\e!stop\currentxtable}\relax\tabl_x_process}} @@ -223,13 +226,22 @@ %D Now we come to processing: +\def\tabl_x_check_textwidth + {\edef\p_textwidth{\xtableparameter\c!textwidth}% + \ifx\p_textwidth\v!local + \d_tabl_x_textwidth\availablehsize + \else + \d_tabl_x_textwidth\p_textwidth + \fi} + \def\tabl_x_prepare#settings% assumes \iffirstargument to be set {\advance\c_tabl_x_nesting\plusone \dostarttagged\t!table\empty - \forgetall \iffirstargument \tabl_x_set_checked{#settings}% - \fi} + \fi + \tabl_x_check_textwidth + \forgetall} \def\tabl_x_get_buffer {\ctxcommand{gettexbuffer("\tabl_x_current_buffer")}} @@ -242,7 +254,7 @@ {\xtableparameter\c!spaceinbetween}% \ctxcommand{x_table_create { option = "\xtableparameter\c!option", - textwidth = \number\dimexpr\xtableparameter\c!textwidth, + textwidth = \number\d_tabl_x_textwidth, textheight = \number\dimexpr\xtableparameter\c!textheight, maxwidth = \number\dimexpr\xtableparameter\c!maxwidth, lineheight = \number\openlineheight, @@ -319,8 +331,10 @@ \let\tsplitdirectwidth \d_tabl_x_final_width \handledirecttsplit} + \def\tabl_x_flush_flow_normal - {\ctxcommand{x_table_flush{ method = "\v!normal" }}} + {\dontleavehmode % else no leftskip etc + \ctxcommand{x_table_flush{ method = "\v!normal" }}} \def\tabl_x_flush_flow_split {\ctxcommand{x_table_flush{ method = "\v!split" }}} diff --git a/tex/context/base/typo-mar.lua b/tex/context/base/typo-mar.lua index a21d9b70a..e3701afd4 100644 --- a/tex/context/base/typo-mar.lua +++ b/tex/context/base/typo-mar.lua @@ -73,7 +73,7 @@ if not modules then modules = { } end modules ['typo-mar'] = { -- so far -local format = string.format +local format, validstring = string.format, string.valid local insert, remove = table.insert, table.remove local setmetatable, next = setmetatable, next @@ -81,6 +81,7 @@ local attributes, nodes, node, variables = attributes, nodes, node, variables local trace_margindata = false trackers.register("typesetters.margindata", function(v) trace_margindata = v end) local trace_marginstack = false trackers.register("typesetters.margindata.stack", function(v) trace_marginstack = v end) +local trace_margingroup = false trackers.register("typesetters.margindata.group", function(v) trace_margingroup = v end) local report_margindata = logs.reporter("typesetters","margindata") @@ -92,6 +93,7 @@ local enableaction = tasks.enableaction local variables = interfaces.variables local conditionals = tex.conditionals +local systemmodes = tex.systemmodes local v_top = variables.top local v_depth = variables.depth @@ -138,6 +140,8 @@ local kern_code = nodecodes.kern local penalty_code = nodecodes.penalty local whatsit_code = nodecodes.whatsit local line_code = listcodes.line +local cell_code = listcodes.cell +local alignment_code = listcodes.alignment local leftskip_code = gluecodes.leftskip local rightskip_code = gluecodes.rightskip local userdefined_code = whatsitcodes.userdefined @@ -229,14 +233,14 @@ local defaults = { local enablelocal, enableglobal -- forward reference (delayed initialization) -local function showstore(store,banner) +local function showstore(store,banner,location) if next(store) then for i, si in table.sortedpairs(store) do local si =store[i] - report_margindata("%s: stored at %s: %s => %s",banner,i,si.name or "no name",nodes.toutf(si.box.list)) + report_margindata("%s: stored in %s at %s: %s => %s",banner,location,i,validstring(si.name,"no name"),nodes.toutf(si.box.list)) end else - report_margindata("%s: nothing stored",banner) + report_margindata("%s: nothing stored in %s",banner,location) end end @@ -245,7 +249,7 @@ function margins.save(t) local inline = t.inline local location = t.location local category = t.category - local scope = t.scope + local scope = t.scope or v_global local store if inline then store = inlinestore @@ -263,15 +267,17 @@ function margins.save(t) end if enablelocal and scope == v_local then enablelocal() - end - if enableglobal and scope == v_global then + if enableglobal then + enableglobal() -- is the fallback + end + elseif enableglobal and scope == v_global then enableglobal() end nofsaved = nofsaved + 1 nofstored = nofstored + 1 local name = t.name if trace_marginstack then - showstore(store,"before ") + showstore(store,"before",location) end if name and name ~= "" then if inlinestore then -- todo: inline store has to be done differently (not sparse) @@ -292,7 +298,7 @@ function margins.save(t) end end if trace_marginstack then - showstore(store,"between") + showstore(store,"between",location) end end if t.number then @@ -327,7 +333,7 @@ function margins.save(t) end end if trace_marginstack then - showstore(store,"after ") + showstore(store,"after",location) end if trace_margindata then report_margindata("saved: %s, location: %s, scope: %s, inline: %s",nofsaved,location,scope,tostring(inline)) @@ -409,7 +415,8 @@ local function realign(current,candidate) if not anchor or anchor == "" then anchor = v_text end - if inline or anchor ~= v_text then + if inline or anchor ~= v_text or candidate.psubtype == alignment_code then + -- the alignment_code check catches margintexts ste before a tabulate h_anchors = h_anchors + 1 anchornode = new_latelua(format("_plib_.set('md:h',%i,{x=true,c=true})",h_anchors)) local blob = jobpositions.get('md:h', h_anchors) @@ -516,6 +523,7 @@ local function inject(parent,head,candidate) local baseline = candidate.baseline local strutheight = candidate.strutheight local strutdepth = candidate.strutdepth + local psubtype = parent.subtype local offset = stacked[location] local firstonstack = offset == false or offset == nil nofstatus = nofstatus + 1 @@ -538,8 +546,9 @@ local function inject(parent,head,candidate) end candidate.width = width candidate.hsize = parent.width -- we can also pass textwidth + candidate.psubtype = psubtype if trace_margindata then - report_margindata("processing, index %s, height: %s, depth: %s",candidate.n,height,depth) + report_margindata("processing, index %s, height: %s, depth: %s, parent: %s",candidate.n,height,depth,listcodes[psubtype]) end if firstonstack then offset = 0 @@ -708,11 +717,11 @@ local function flushed(scope,parent) -- current is hlist done = done or don end if done then -local a = has_attribute(head,a_linenumber) -- hack .. we need a more decent critical attribute inheritance mechanism + local a = has_attribute(head,a_linenumber) -- hack .. we need a more decent critical attribute inheritance mechanism parent.list = hpack_nodes(head,parent.width,"exactly") -if a then - set_attribute(parent.list,a_linenumber,a) -end + if a then + set_attribute(parent.list,a_linenumber,a) + end -- resetstacked() end return done, continue @@ -754,29 +763,44 @@ local function handler(scope,head,group) end end -function margins.localhandler(head,group) - if conditionals.inhibitmargindata then +function margins.localhandler(head,group) -- sometimes group is "" which is weird + local inhibit = conditionals.inhibitmargindata + if inhibit then + if trace_margingroup then + report_margindata("ignored: 3, group: %s, stored: %s, inhibit: %s",group,nofstored,tostring(inhibit)) + end return head, false elseif nofstored > 0 then return handler(v_local,head,group) else + if trace_margingroup then + report_margindata("ignored: 4, group: %s, stored: %s, inhibit: %s",group,nofstored,tostring(inhibit)) + end return head, false end end function margins.globalhandler(head,group) -- check group --- print(group) - if conditionals.inhibitmargindata or nofstored == 0 then + local inhibit = conditionals.inhibitmargindata + if inhibit or nofstored == 0 then + if trace_margingroup then + report_margindata("ignored: 1, group: %s, stored: %s, inhibit: %s",group,nofstored,tostring(inhibit)) + end return head, false elseif group == "hmode_par" then return handler("global",head,group) elseif group == "vmode_par" then -- experiment (for alignments) return handler("global",head,group) - -- this needs checking as we then get quite some one liners to process and - -- we cannot look ahead then: + -- this needs checking as we then get quite some one liners to process and + -- we cannot look ahead then: elseif group == "box" then -- experiment (for alignments) return handler("global",head,group) + elseif group == "alignment" then -- experiment (for alignments) + return handler("global",head,group) else + if trace_margingroup then + report_margindata("ignored: 2, group: %s, stored: %s, inhibit: %s",group,nofstored,tostring(inhibit)) + end return head, false end end @@ -823,12 +847,12 @@ end -- go horizontal. So this needs more testing. prependaction("finalizers", "lists", "typesetters.margins.localhandler") --- prependaction("vboxbuilders", "normalizers", "typesetters.margins.localhandler") +-- ("vboxbuilders", "normalizers", "typesetters.margins.localhandler") prependaction("mvlbuilders", "normalizers", "typesetters.margins.globalhandler") prependaction("shipouts", "normalizers", "typesetters.margins.finalhandler") disableaction("finalizers", "typesetters.margins.localhandler") --- disableaction("vboxbuilders", "typesetters.margins.localhandler") +-- ("vboxbuilders", "typesetters.margins.localhandler") disableaction("mvlbuilders", "typesetters.margins.globalhandler") disableaction("shipouts", "typesetters.margins.finalhandler") diff --git a/tex/context/base/typo-mar.mkiv b/tex/context/base/typo-mar.mkiv index fbd06acc9..4db0a9b66 100644 --- a/tex/context/base/typo-mar.mkiv +++ b/tex/context/base/typo-mar.mkiv @@ -299,6 +299,7 @@ category = "\margindataparameter\c!category", name = "\margindataparameter\c!name", scope = "\margindataparameter\c!scope", + number = \number\nextbox, }}% \fi \endgroup} diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv index 0848c1754..30ae1232e 100644 --- a/tex/context/base/x-mathml.mkiv +++ b/tex/context/base/x-mathml.mkiv @@ -46,7 +46,10 @@ \xmlregistersetup{xml:mml:define} -\def\MMLhack{\let\MMLpar\par \let\par\relax \everyvbox{\let\par\MMLpar}} +\unexpanded\def\MMLhack + {\let\MMLpar\par + \let\par\relax + \everyvbox{\let\par\MMLpar}} \xmlmapvalue {mml:math:mode} {display} {\displaymathematics} % we had this already \xmlmapvalue {mml:math:mode} {inline} {\inlinemathematics } diff --git a/tex/context/fonts/husayni.lfg b/tex/context/fonts/husayni.lfg index ff456f63c..cf9e373fa 100644 --- a/tex/context/fonts/husayni.lfg +++ b/tex/context/fonts/husayni.lfg @@ -75,7 +75,7 @@ return { solutions = { -- here we have references to featuresets, so we use strings! experimental = { less = { - "shrink" + "shrink", -- we need an extra one }, more = { "minimal_stretching", "medium_stretching", "maximal_stretching", "wide_all" diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index f3f55bd5a..c28cd2a74 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 : 06/13/12 09:57:33 +-- merge date : 06/13/12 23:46:07 do -- begin closure to overcome local limits and interference |