diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-12-10 21:15:04 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2014-12-10 21:15:04 +0100 |
commit | 7b68e6df9eb6d5c9f216c333051ccafce11bf3fb (patch) | |
tree | 6a588c8728fa6ff0ce1e9c54be0da1615eca1c56 /tex | |
parent | 66a7d730de0d2823007aab1d742a27e8c2071e25 (diff) | |
download | context-7b68e6df9eb6d5c9f216c333051ccafce11bf3fb.tar.gz |
2014-12-10 20:15:00
Diffstat (limited to 'tex')
24 files changed, 258 insertions, 107 deletions
diff --git a/tex/context/base/anch-pos.mkiv b/tex/context/base/anch-pos.mkiv index 7ecaa296e..a87a32c06 100644 --- a/tex/context/base/anch-pos.mkiv +++ b/tex/context/base/anch-pos.mkiv @@ -315,8 +315,8 @@ %D \NC \type {\epos} \NC e: \NC end point in a line \NC \NR %D \stoptabulate %D -%D Each macro takes an identifier as argument, and the \type -%D {\hpos} and \type {\vpos} also expect box content. +%D Each macro takes an identifier as argument, and the \type {\hpos} and +%D \type {\vpos} also expect box content. \let\xypos\setpositiononly diff --git a/tex/context/base/cont-fil.mkii b/tex/context/base/cont-fil.mkii index e05d8eac4..604ea233d 100644 --- a/tex/context/base/cont-fil.mkii +++ b/tex/context/base/cont-fil.mkii @@ -124,4 +124,6 @@ \definefilesynonym [letter] [cor-01] \definefilesynonym [memo] [cor-02] +\definefilesynonym [syn-01] [syntax] + \endinput diff --git a/tex/context/base/cont-fil.mkiv b/tex/context/base/cont-fil.mkiv index 8e9be155b..a1159b7f5 100644 --- a/tex/context/base/cont-fil.mkiv +++ b/tex/context/base/cont-fil.mkiv @@ -116,5 +116,6 @@ \definefilesynonym [mat-11] [math-characters] \definefilesynonym [fnt-11] [fonts-system] \definefilesynonym [fnt-23] [fonts-shapes] +\definefilesynonym [syn-01] [syntax] \endinput diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index c564529fe..2bd2b8693 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{2014.12.09 13:03} +\newcontextversion{2014.12.10 20:13} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 8431af5b4..c992bb951 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index ebffaceeb..e2908d511 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.12.09 13:03} +\edef\contextversion{2014.12.10 20:13} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/meta-fig.mkiv b/tex/context/base/meta-fig.mkiv index 46dc4cffc..bf37aa7bf 100644 --- a/tex/context/base/meta-fig.mkiv +++ b/tex/context/base/meta-fig.mkiv @@ -47,6 +47,9 @@ \c!command=\meta_process_graphic_instance{\fittingpageparameter\c!instance}, \c!instance=] +\unexpanded\def\setupMPpage + {\setupfittingpage[MPpage]} + %D \macros %D {MPfigure} %D @@ -56,7 +59,7 @@ {\bgroup \getfiguredimensions[#1]% [\c!object=\v!no] already set \startMPcode - externalfigure "#1" + draw externalfigure "#1" xscaled \the\dimexpr\figurewidth \relax\space % must be points yscaled \the\dimexpr\figureheight\relax\space % must be points #2 ; diff --git a/tex/context/base/meta-fun.lua b/tex/context/base/meta-fun.lua index 78ee25baf..7aaaf2818 100644 --- a/tex/context/base/meta-fun.lua +++ b/tex/context/base/meta-fun.lua @@ -26,7 +26,7 @@ function metafun.topath(t,connector) if type(ti) == "string" then context(ti) else - context("(%s,%s)",ti.x or ti[1] or 0,ti.y or ti[2] or 0) + context("(%F,%F)",ti.x or ti[1] or 0,ti.y or ti[2] or 0) end end else @@ -47,7 +47,7 @@ function metafun.interpolate(f,b,e,s,c) else done = true end - context("(%s,%s)",i,d(i)) + context("(%F,%F)",i,d(i)) end end if not done then diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index e580e4dcc..fea1225ad 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -272,18 +272,26 @@ end -- end of new function metapost.settext(box,slot) - top.textexts[slot] = copy_list(texgetbox(box)) - texsetbox(box,nil) - -- this can become - -- top.textexts[slot] = textakebox(box) + if top then + top.textexts[slot] = copy_list(texgetbox(box)) + texsetbox(box,nil) + -- this can become + -- top.textexts[slot] = textakebox(box) + else + -- weird error + end end function metapost.gettext(box,slot) - texsetbox(box,copy_list(top.textexts[slot])) - if trace_textexts then - report_textexts("putting text %s in box %s",slot,box) + if top then + texsetbox(box,copy_list(top.textexts[slot])) + if trace_textexts then + report_textexts("putting text %s in box %s",slot,box) + end + -- top.textexts[slot] = nil -- no, pictures can be placed several times + else + -- weird error end - -- top.textexts[slot] = nil -- no, pictures can be placed several times end -- rather generic pdf, so use this elsewhere too it no longer pays diff --git a/tex/context/base/mult-fun.lua b/tex/context/base/mult-fun.lua index dc76c3e0d..3d712320a 100644 --- a/tex/context/base/mult-fun.lua +++ b/tex/context/base/mult-fun.lua @@ -4,12 +4,13 @@ return { "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", - "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", - "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", - "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", --- "originlength", "tickstep ", "ticklength", --- "autoarrows", "ahfactor", --- "angleoffset", anglelength", anglemethod", + "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", + "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", + "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", + "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", + -- "originlength", "tickstep ", "ticklength", + -- "autoarrows", "ahfactor", + -- "angleoffset", anglelength", anglemethod", "metapostversion", "maxdimensions", }, @@ -38,23 +39,31 @@ return { "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", - "withshade", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor", "withshading", "shadedinto", - "withcircularshade", "withlinearshade", + "withshading", "withlinearshading", "withcircularshading", + "withfromshadecolor", "withtoshadecolor", "shadedinto", + "withshade", "withcircularshade", "withlinearshade", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", - "graphictext", "loadfigure", "externalfigure", "withmask", "figure", "register", "bitmapimage", + "graphictext", "loadfigure", "externalfigure", "figure", "register", + "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", - "textext", "thetextext", "rawtextext", "textextoffset", "verbatim", "thelabel", "label", "autoalign", + "textext", "thetextext", "rawtextext", "textextoffset", + "verbatim", + "thelabel", "label", + "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", -- redefined usign textext -- "property", "withproperties", "properties", -- not yet - "set_linear_vector", "linear_shade", "define_linear_shade", "define_circular_linear_shade", "define_sampled_linear_shade", - "set_circular_vector", "circular_shade", "define_circular_shade", "define_circular_linear_shade", "define_sampled_circular_shade", + "set_linear_vector", "set_circular_vector", + "linear_shade", "circular_shade", + "define_linear_shade", "define_circular_shade", + "define_circular_linear_shade", "define_circular_linear_shade", + "define_sampled_linear_shade", "define_sampled_circular_shade", "space", "CRLF", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", @@ -77,26 +86,31 @@ return { "pushcurrentpicture", "popcurrentpicture", -- "arrowpath", --- "colorlike", "dowithpath", "rangepath", "straightpath", "addbackground", --- "cleanstring", "asciistring", "setunstringed", "getunstringed", "unstringed", --- "showgrid", --- "phantom", --- "xshifted", "yshifted", --- "drawarrowpath", "midarrowhead", "arrowheadonpath", --- "drawxticks", "drawyticks", "drawticks", --- "pointarrow", --- "thefreelabel", "freelabel", "freedotlabel", --- "anglebetween", "colorcircle", --- "remapcolors", "normalcolors", "resetcolormap", "remapcolor", "remappedcolor", --- "recolor", "refill", "redraw", "retext", "untext", "restroke", "reprocess", "repathed", + -- "colorlike", "dowithpath", "rangepath", "straightpath", "addbackground", + -- "cleanstring", "asciistring", "setunstringed", "getunstringed", "unstringed", + -- "showgrid", + -- "phantom", + -- "xshifted", "yshifted", + -- "drawarrowpath", "midarrowhead", "arrowheadonpath", + -- "drawxticks", "drawyticks", "drawticks", + -- "pointarrow", + -- "thefreelabel", "freelabel", "freedotlabel", + -- "anglebetween", "colorcircle", + -- "remapcolors", "normalcolors", "resetcolormap", "remapcolor", "remappedcolor", + -- "recolor", "refill", "redraw", "retext", "untext", "restroke", "reprocess", "repathed", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", -- --- "swappointlabels", + -- "swappointlabels", "normalfill", "normaldraw", "visualizepaths", "naturalizepaths", - "drawboundary", "drawwholepath", "visualizeddraw", "visualizedfill", "draworigin", "drawboundingbox", - "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", - "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", + "drawboundary", "drawwholepath", + "visualizeddraw", "visualizedfill", + "draworigin", "drawboundingbox", + "drawpath", + "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", + "drawpointlabels", + "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", + "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", -- "undashed", -- diff --git a/tex/context/base/mult-mps.lua b/tex/context/base/mult-mps.lua index cf4fb4d38..04776d8bf 100644 --- a/tex/context/base/mult-mps.lua +++ b/tex/context/base/mult-mps.lua @@ -31,7 +31,9 @@ return { "def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary", "tertiary", "primarydef", "secondarydef", "tertiarydef", "randomseed", "also", "contour", "doublepath", - "withcolor", "withcmykcolor", "withpen", "dashed", "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", + "withcolor", "withcmykcolor", "withpen", + "dashed", + "if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within", "forsuffixes", "step", "until", "charlist", "extensible", "fontdimen", "headerbyte", "kern", "ligtable", "boundarychar", "chardp", "charext", "charht", "charic", "charwd", "designsize", @@ -50,7 +52,9 @@ return { "withprescript", "withpostscript", "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt", -- - "redpart", "greenpart", "bluepart", "cyanpart", "magentapart", "yellowpart", "blackpart", "greypart", + "redpart", "greenpart", "bluepart", + "cyanpart", "magentapart", "yellowpart", + "blackpart", "greypart", "prescriptpart", "postscriptpart", "rgbcolor", "cmykcolor", "greycolor", "graycolor", "colormodel", "graypart", @@ -58,7 +62,8 @@ return { -- "colorpart", "stroked", "filled", "textual", "clipped", "bounded", "pathpart", "expandafter", - "minute", "hour", "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", + "minute", "hour", + "outputformat", "outputtemplate", "filenametemplate", "fontmapfile", "fontmapline", "fontpart", "fontsize", "glyph", "restoreclipcolor", "troffmode", -- "runscript", @@ -117,7 +122,11 @@ return { -- "mitered", "rounded", "beveled", "butt", "squared", "eps", "epsilon", "infinity", - "bboxmargin", "ahlength", "ahangle", "labeloffset", "dotlabeldiam", "defaultpen", "defaultscale", "join_radius", + "bboxmargin", + "ahlength", "ahangle", + "labeloffset", "dotlabeldiam", + "defaultpen", "defaultscale", + "join_radius", -- "pen_lft", "pen_rt", "pen_top", "pen_bot", -- "pen_count_", }, diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index 8dee6d176..72e86b545 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -2642,9 +2642,9 @@ \else \bgroup \fi -\vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1 + \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1 \doinhibitblank - \setupindenting[\framedtextparameter\c!indenting]% + \useindentingparameter\framedtextparameter \useframedtextstyleandcolor\c!style\c!color \ignorespaces} diff --git a/tex/context/base/page-app.mkiv b/tex/context/base/page-app.mkiv index e4858d48f..2e81f7537 100644 --- a/tex/context/base/page-app.mkiv +++ b/tex/context/base/page-app.mkiv @@ -139,6 +139,9 @@ [TEXpage] [\c!align=\v!normal] % needed, else problems ! +\unexpanded\def\setupTEXpage + {\setupfittingpage[TEXpage]} + %D For Mojca: %D %D \starttyping diff --git a/tex/context/base/s-syn-01.tex b/tex/context/base/s-syntax.mkii index 01c8f6653..6d1d59697 100644 --- a/tex/context/base/s-syn-01.tex +++ b/tex/context/base/s-syntax.mkii @@ -1,5 +1,5 @@ %D \module -%D [ file=s-syn-01, +%D [ file=s-syntax, % was: s-syn-01, %D version=0000.00.00, %D title=\CONTEXT\ Style File, %D subtitle=Preliminary Syntax Stuff, diff --git a/tex/context/base/s-syntax.mkiv b/tex/context/base/s-syntax.mkiv new file mode 100644 index 000000000..7fe7cde8a --- /dev/null +++ b/tex/context/base/s-syntax.mkiv @@ -0,0 +1,78 @@ +%D \module +%D [ file=s-syntax, % was: s-syn-01, +%D version=0000.00.00, +%D title=\CONTEXT\ Style File, +%D subtitle=Preliminary Syntax Stuff, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is needed for the \METAFUN\ manual. + +\unprotect + +\unexpanded\def\module_syntax_Indent #1{\ifvmode\noindent\hbox to 2em{\hss#1}\else#1\fi} +\unexpanded\def\module_syntax_Sugar #1{\ifhmode\unskip\unskip\unskip\fi\kern.25em{#1}\kern.25em\ignorespaces} +\unexpanded\def\module_syntax_Something #1{\Sugar{\mathematics{\langle\hbox{#1}\rangle}}} +\unexpanded\def\module_syntax_Lbrace {\Sugar{\tttf\leftargument}} +\unexpanded\def\module_syntax_Rbrace {\Sugar{\tttf\rightargument}} +\unexpanded\def\module_syntax_Or {\Sugar{\mathematics{\vert}}} +\unexpanded\def\module_syntax_Optional #1{\Sugar{\mathematics{[\hbox{#1}]}}} +\unexpanded\def\module_syntax_Means {\Sugar{\mathematics{\rightarrow}}} +\unexpanded\def\module_syntax_Tex #1{\Sugar{\type{#1}}} +\unexpanded\def\module_syntax_Literal #1{\Sugar{\type{#1}}} +\unexpanded\def\module_syntax_Syntax #1{\strut\kern-.25em{#1}\kern-.25em} +\unexpanded\def\module_syntax_Next {\crlf\hbox to 2em{}\nobreak} +\unexpanded\def\module_syntax_Whatever #1{\Sugar{\mathematics{(\hbox{#1})}}} +\unexpanded\def\module_syntax_Quote #1{\Sugar{\quote{#1}}} +\unexpanded\def\module_syntax_Or {\Sugar{\module_syntax_Indent{\mathematics{\vert}}}} +\unexpanded\def\module_syntax_Means {\Sugar{\module_syntax_Indent{\mathematics{\rightarrow}}}} +\unexpanded\def\module_syntax_FlaggedLiteral #1{\color[darkred]{\module_syntax_Literal{#1}}} +\unexpanded\def\module_syntax_FlaggedSomething#1{\module_syntax_Something{\color[darkred]{#1}}} + +\unexpanded\def\StartSyntax + {\goodbreak % to be reconsidered + \startlines + % formatters + \let\Indent \module_syntax_Indent + \let\Sugar \module_syntax_Sugar + \let\Something \module_syntax_Something + \let\Lbrace \module_syntax_Lbrace + \let\Rbrace \module_syntax_Rbrace + \let\Or \module_syntax_Or + \let\Optional \module_syntax_Optional + \let\Means \module_syntax_Means + \let\Tex \module_syntax_Tex + \let\Literal \module_syntax_Literal + \let\Syntax \module_syntax_Syntax + \let\Next \module_syntax_Next + \let\Whatever \module_syntax_Whatever + \let\Quote \module_syntax_Quote + \let\Or \module_syntax_Or + \let\Means \module_syntax_Means + \let\FlaggedLiteral \module_syntax_FlaggedLiteral + \let\FlaggedSomething\module_syntax_FlaggedSomething + % shortcuts + \let\FL \module_syntax_FlaggedLiteral + \let\FS \module_syntax_FlaggedSomething + \let\L \module_syntax_Literal + \let\S \module_syntax_Something + \let\M \module_syntax_Means + \let\O \module_syntax_Or + \let\Q \module_syntax_Quote + \let\LB \module_syntax_Lbrace + \let\RB \module_syntax_Rbrace + % precaution + \catcode`\#\othercatcode} + +\unexpanded\def\StopSyntax + {\stoplines} + +\unexpanded\def\SyntaxCommand#1% + {\csname module_syntax_#1\endcsname} + +\protect \endinput diff --git a/tex/context/base/spac-hor.mkiv b/tex/context/base/spac-hor.mkiv index 0621af4df..c61355ae5 100644 --- a/tex/context/base/spac-hor.mkiv +++ b/tex/context/base/spac-hor.mkiv @@ -64,6 +64,12 @@ \def\spac_indentation_set_everypar {\everypar{\checkindentation}} +\unexpanded\def\useindentingparameter#1% faster local variant + {\edef\m_spac_indentation_options{#1\c!indenting}% + \ifx\m_spac_indentation_options\empty \else + \spac_indentation_setup_indeed + \fi} + % \def\spac_indentation_apply_step_one#1% % {\ifcsname\??indentingmethod#1\endcsname % % case two diff --git a/tex/context/base/spac-lin.mkiv b/tex/context/base/spac-lin.mkiv index 5ed9d718a..f73809f2c 100644 --- a/tex/context/base/spac-lin.mkiv +++ b/tex/context/base/spac-lin.mkiv @@ -91,10 +91,10 @@ \dostarttaggedchained\t!lines\currentlines\??lines \begingroup \uselinesstyleandcolor\c!style\c!color - \setupindenting[\linesparameter\c!indenting]% - \setupalign[\linesparameter\c!align]% + \useindentingparameter\linesparameter + \usealignparameter\linesparameter \typesettinglinestrue - \setupwhitespace[\v!none]% + \setupwhitespace[\v!none]% todo use fast variant %\obeylines % move upwards to keep spaces in the first line due to optional argument \ignorespaces \glet\spac_after_first_obeyed_line\spac_lines_after_first_obeyed_line_a diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex e42667002..cbbbf6d10 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 e9a91348d..d9ff62899 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/supp-box.lua b/tex/context/base/supp-box.lua index e208ae39b..13fca4548 100644 --- a/tex/context/base/supp-box.lua +++ b/tex/context/base/supp-box.lua @@ -157,7 +157,7 @@ local function applytochars(current,doaction,noaction,nested) local id = getid(current) if nested and (id == hlist_code or id == vlist_code) then context.beginhbox() - applytochars(getlist(current),what,nested) + applytochars(getlist(current),doaction,noaction,nested) context.endhbox() elseif id ~= glyph_code then noaction(tonode(copy_node(current))) @@ -180,7 +180,7 @@ local function applytowords(current,doaction,noaction,nested) noaction(tonode(copy_node(current))) elseif nested and (id == hlist_code or id == vlist_code) then context.beginhbox() - applytowords(getlist(current),what,nested) + applytowords(getlist(current),doaction,noaction,nested) context.egroup() elseif not start then start = current diff --git a/tex/context/base/syst-aux.lua b/tex/context/base/syst-aux.lua index e645bb3b9..c65f97fd0 100644 --- a/tex/context/base/syst-aux.lua +++ b/tex/context/base/syst-aux.lua @@ -17,7 +17,7 @@ local tonumber = tonumber local settings_to_array = utilities.parsers.settings_to_array local format = string.format local utfsub = utf.sub -local P, S, C, Cc, Cs, Carg, lpegmatch, utf8character = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg, lpeg.match, lpeg.patterns.utf8character +local P, S, R, C, Cc, Cs, Carg, lpegmatch, utf8character = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg, lpeg.match, lpeg.patterns.utf8character local todimen = number.todimen local setvalue = context.setvalue @@ -90,7 +90,14 @@ end -- \gdef\setpercentdimen#1#2% -- {#1=\ctxcommand{percentageof("#2",\number#1)}\relax} -local spaces = P(" ")^0/"" +local spaces = P(" ")^0 / "" +local nohash = 1 - P("#") +local digit = R("09") +local double = P("##") / "#" +local single = P("#") +local sentinel = spaces * (nohash^1 / "\\%0") +local sargument = (single * digit)^1 +local dargument = (double * digit)^1 local pattern = Cs( ( P("global") / "\\global" )^0 @@ -103,10 +110,18 @@ local pattern = Cs( * spaces * ( P((1-S(" #"))^1) / "def\\csname %0\\endcsname" ) * spaces - * Cs( (P("##")/"#" + P(1))^0 ) + * ( + -- (double * digit)^1 * sentinel^-1 * double^-1 + -- + (single * digit)^1 * sentinel^-1 * single^-1 + ( P("[") * dargument * P("]") + dargument)^1 * sentinel^-1 * double^-1 + + ( P("[") * sargument * P("]") + sargument)^1 * sentinel^-1 * single^-1 + + sentinel^-1 * (double+single)^-1 + ) ) function commands.thetexdefinition(str) +-- print(str) +-- print(lpegmatch(pattern,str)) context(lpegmatch(pattern,str)) end diff --git a/tex/context/base/typo-del.mkiv b/tex/context/base/typo-del.mkiv index 9bdca4af4..6ce768ab2 100644 --- a/tex/context/base/typo-del.mkiv +++ b/tex/context/base/typo-del.mkiv @@ -363,10 +363,7 @@ \fi % so far \pushmacro\checkindentation - \edef\p_delimited_indenting{\delimitedtextparameter\c!indenting}% - \ifx\p_delimited_indenting\empty \else - \setupindenting[\p_delimited_indenting]% todo: use fast one (no [] checking) - \fi + \useindentingparameter\delimitedtextparameter % \begingroup \usedelimitedtextstyleandcolor\c!style\c!color diff --git a/tex/context/base/typo-itc.lua b/tex/context/base/typo-itc.lua index 60352120e..5e1ff3fbc 100644 --- a/tex/context/base/typo-itc.lua +++ b/tex/context/base/typo-itc.lua @@ -32,6 +32,7 @@ local tonode = nuts.tonode local tonut = nuts.tonut local getfield = nuts.getfield +local getprev = nuts.getprev local getnext = nuts.getnext local getid = nuts.getid local getfont = nuts.getfont @@ -230,29 +231,36 @@ function italics.handler(head) replace = getfield(current,"replace") if replace then local current = find_tail(replace) - local font = getfont(current) - local char = getchar(current) - local data = italicsdata[font] - if data then - local attr = forcedvariant or getattr(current,a_italics) - if attr and attr > 0 then - local cd = data[char] - if not cd then - -- this really can happen - replaceitalic = 0 - else - replaceitalic = cd.italic or cd.italic_correction - if not replaceitalic then - replaceitalic = setitalicinfont(font,char) -- calculated once - -- replaceitalic = 0 - end - if replaceitalic ~= 0 then - lastfont = font - lastattr = attr - replacechar = char - replacehead = replace - replace = current + if getid(current) ~= glyph_code then + current = getprev(current) + end + if current and getid(current) == glyph_code then + local font = getfont(current) + local char = getchar(current) + local data = italicsdata[font] + if data then + local attr = forcedvariant or getattr(current,a_italics) + if attr and attr > 0 then + local cd = data[char] + if not cd then + -- this really can happen + replaceitalic = 0 + else + replaceitalic = cd.italic or cd.italic_correction + if not replaceitalic then + replaceitalic = setitalicinfont(font,char) -- calculated once + -- replaceitalic = 0 + end + if replaceitalic ~= 0 then + lastfont = font + lastattr = attr + replacechar = char + replacehead = replace + replace = current + end end + else + replaceitalic = 0 end else replaceitalic = 0 @@ -265,29 +273,36 @@ function italics.handler(head) local post = getfield(current,"post") if post then local current = find_tail(post) - local font = getfont(current) - local char = getchar(current) - local data = italicsdata[font] - if data then - local attr = forcedvariant or getattr(current,a_italics) - if attr and attr > 0 then - local cd = data[char] - if not cd then - -- this really can happen - postitalic = 0 - else - postitalic = cd.italic or cd.italic_correction - if not postitalic then - postitalic = setitalicinfont(font,char) -- calculated once - -- postitalic = 0 - end - if postitalic ~= 0 then - lastfont = font - lastattr = attr - postchar = char - posthead = post - post = current + if getid(current) ~= glyph_code then + current = getprev(current) + end + if current and getid(current) == glyph_code then + local font = getfont(current) + local char = getchar(current) + local data = italicsdata[font] + if data then + local attr = forcedvariant or getattr(current,a_italics) + if attr and attr > 0 then + local cd = data[char] + if not cd then + -- this really can happen + postitalic = 0 + else + postitalic = cd.italic or cd.italic_correction + if not postitalic then + postitalic = setitalicinfont(font,char) -- calculated once + -- postitalic = 0 + end + if postitalic ~= 0 then + lastfont = font + lastattr = attr + postchar = char + posthead = post + post = current + end end + else + postitalic = 0 end else postitalic = 0 diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 53386b5d6..5b218c6d7 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 : 12/09/14 13:03:29 +-- merge date : 12/10/14 20:13:09 do -- begin closure to overcome local limits and interference |