diff options
41 files changed, 451 insertions, 45 deletions
diff --git a/doc/context/documents/general/manuals/cld-mkiv.pdf b/doc/context/documents/general/manuals/cld-mkiv.pdf Binary files differindex a2cdb7fc9..bac02979f 100644 --- a/doc/context/documents/general/manuals/cld-mkiv.pdf +++ b/doc/context/documents/general/manuals/cld-mkiv.pdf diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex 2ffb19efa..cd9954bb7 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex e82e59d07..85d4d24da 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex 38c4532e4..a5ba5a662 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex 29f08846d..de6dcbbd2 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex 02df2354e..8d4a71209 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf Binary files differindex c301caabc..0a3ef98ec 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf Binary files differindex 87fdaf725..6447d100a 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf Binary files differindex c8088953f..97c6edb1f 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf Binary files differindex 2a10daed4..ee2912cc9 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf Binary files differindex 0997f1662..447ac5c12 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf Binary files differindex 18cbbedf6..548415194 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf Binary files differindex a9e83a207..84ede4333 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex 5137d53cb..31b39c1ac 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex 75c8f9455..95f3d1223 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/doc/context/sources/general/fonts/fonts/fonts-features.tex b/doc/context/sources/general/fonts/fonts/fonts-features.tex index d6d116856..64cb164f6 100644 --- a/doc/context/sources/general/fonts/fonts/fonts-features.tex +++ b/doc/context/sources/general/fonts/fonts/fonts-features.tex @@ -2706,6 +2706,10 @@ do do: \stopsection +\startsection[title=Spacekerns] + +\stopsection + \stopchapter \stopcomponent diff --git a/doc/context/sources/general/manuals/cld/cld-specialcommands.tex b/doc/context/sources/general/manuals/cld/cld-specialcommands.tex index 37e891019..151952c53 100644 --- a/doc/context/sources/general/manuals/cld/cld-specialcommands.tex +++ b/doc/context/sources/general/manuals/cld/cld-specialcommands.tex @@ -8,6 +8,8 @@ \index{tracing} +\startsection[title=Tracing] + There are a few functions in the \type {context} namespace that are no macros at the \TEX\ end. @@ -28,18 +30,176 @@ There are a few tracing options that you can set at the \TEX\ end: \enabletrackers[context.trace] \stoptyping -A few macros have special functions at the \LUA\ end. One of them is \type -{\char}. The function makes sure that the characters ends up right. The same is -true for \type {\chardef}. So, you don't need to mess around with \type {\relax} -or trailing spaces as you would do at the \TEX\ end in order to tell the scanner -to stop looking ahead. +\stopsection + +\startsection[title=Overloads] + +A few macros have special functions (overloads) at the \LUA\ end. One of them is +\type {\char}. The function makes sure that the characters ends up right. The +same is true for \type {\chardef}. So, you don't need to mess around with \type +{\relax} or trailing spaces as you would do at the \TEX\ end in order to tell the +scanner to stop looking ahead. \starttyping context.char(123) \stoptyping Other examples of macros that have optimized functions are \type {\par}, -\type{\bgroup} and \type {\egroup}. +\type{\bgroup} and \type {\egroup}. Or take this: + +\startbuffer +1: \ctxlua{commands.doif(true)}{one} +2: \cldcommand{doif("a","a","two")} +3: \ctxcommand{doif(true)}{three} +\stopbuffer + +\typebuffer + +\startlines +\getbuffer +\stoplines + +\stopsection + +\startsection[title=Steps] + +When you run the following code: + +\setbox0\emptybox + +\starttyping +\startluacode + context.startitemize() + context.startitem() + context("BEFORE 1") + context.stopitem() + context("\\setbox0\\hbox{!!!!}") + context.startitem() + context("%p",tex.getbox(0).width) + context.stopitem() + context.stopitemize() +\stopluacode +\stoptyping + +You get a message like: + +\starttyping +[ctxlua]:8: attempt to index a nil value +... +10 context("\\setbox0\\hbox{!!!!}") +11 context.startitem() +12 >> context("%p",tex.getbox(0).width) +... +\stoptyping + +due to the fact that the box is still void. All that the \CONTEXT\ commands feed +into \TEX\ happens when the code snippet has finished. You can however run a +snippet of code the following way: + +\startbuffer +\startluacode + context.stepwise (function() + context.startitemize() + context.startitem() + context.step("BEFORE 1") + context.stopitem() + context.step("\\setbox0\\hbox{!!!!}") + context.startitem() + context.step("%p",tex.getbox(0).width) + context.stopitem() + context.stopitemize() + end) +\stopluacode +\stopbuffer + +\typebuffer + +and get: + +\getbuffer + +A more extensive example is: + +\startbuffer +\startluacode + context.stepwise (function() + context.startitemize() + context.startitem() + context.step("BEFORE 1") + context.stopitem() + context.step("\\setbox0\\hbox{!!!!}") + context.startitem() + context.step("%p",tex.getbox(0).width) + context.stopitem() + context.startitem() + context.step("BEFORE 2") + context.stopitem() + context.step("\\setbox2\\hbox{????}") + context.startitem() + context.step("%p",tex.getbox(2).width) + context.startitem() + context.step("BEFORE 3") + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2") + context.stopitem() + context.startitem() + context.step("BEFORE 4") + context.startitemize() + context.stepwise (function() + context.step("\\bgroup") + context.step("\\setbox0\\hbox{>>>>}") + context.startitem() + context.step("%p",tex.getbox(0).width) + context.stopitem() + context.step("\\setbox2\\hbox{<<<<}") + context.startitem() + context.step("%p",tex.getbox(2).width) + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2") + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2") + context.stopitem() + context.step("\\egroup") + end) + context.stopitemize() + context.stopitem() + context.startitem() + context.step("AFTER 1\\par") + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2\\par") + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2\\par") + context.stopitem() + context.startitem() + context.step("AFTER 2\\par") + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2\\par") + context.stopitem() + context.startitem() + context.step("\\copy0\\copy2\\par") + context.stopitem() + context.stopitemize() + end) +\stopluacode +\stopbuffer + +\typebuffer + +which gives: + +\getbuffer + +A step returns control to \TEX\ immediately and after the \TEX\ code that it +feeds back is expanded, returns to \LUA. There are some limitations due to the +input stack but normally that us no real issue. + +\stopsection \stopchapter diff --git a/doc/context/sources/general/manuals/spacing/spacing-spaces.tex b/doc/context/sources/general/manuals/spacing/spacing-spaces.tex index defa833c3..0d7f64379 100644 --- a/doc/context/sources/general/manuals/spacing/spacing-spaces.tex +++ b/doc/context/sources/general/manuals/spacing/spacing-spaces.tex @@ -230,6 +230,46 @@ cursive attachments. \stopsection +\startsection[title=Looseness] + +The \type {\looseness} parameter can be used to let the par builder add more +lines, but that condition is only met when the demand is reasonable. So we need +stretch and often also tolerance to achieve it. + +\starttyping +\looseness=1 ... text ... \par +\stoptyping + +This setting is reset afterwards. Because \type {framed} does some grouping deep down, +we need either to use it in there like this: + +\starttyping +\framed + [align={normal,verytolerant,stretch},strut=no] + {\looseness1 ... \par} +\stoptyping + +which is somewhat clumsy, or we can do: + +\starttyping +\framed + [align={normal,verytolerant,stretch,2*more}] + {...} +\stoptyping + +This is demonstrated in \in {figure} [fig:looseness]. + +\startplacefigure[reference=fig:looseness,title={Looseness in action.}] + \dontcomplain + \startcombination[location=top,nx=3,ny=1] + {\framed[foregroundstyle=small,align={normal,verytolerant,stretch}, width=.3\textwidth]{\samplefile{sapolsky}\unskip}} {} + {\framed[foregroundstyle=small,align={normal,verytolerant,stretch,1*more},width=.3\textwidth]{\samplefile{sapolsky}\unskip}} {\type {1*more}} + {\framed[foregroundstyle=small,align={normal,verytolerant,stretch,2*more},width=.3\textwidth]{\samplefile{sapolsky}\unskip}} {\type {2*more}} + \stopcombination +\stopplacefigure + +\stopsection + \stopchapter \stopcomponent diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 81868a917..15910dcf9 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.01.12 15:56} +\newcontextversion{2018.01.14 15:55} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 4c654db20..4a48e5d24 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2018.01.12 15:56} +\edef\contextversion{2018.01.14 15:55} %D For those who want to use this: diff --git a/tex/context/base/mkii/mult-nl.mkii b/tex/context/base/mkii/mult-nl.mkii index b67d7d7ae..ba7c5a42c 100644 --- a/tex/context/base/mkii/mult-nl.mkii +++ b/tex/context/base/mkii/mult-nl.mkii @@ -376,6 +376,7 @@ \setinterfacevariable{norepeat}{norepeat} \setinterfacevariable{normal}{normaal} \setinterfacevariable{nospacing}{geenspatiering} +\setinterfacevariable{nostopper}{geenafsluiter} \setinterfacevariable{not}{niet} \setinterfacevariable{notation}{notation} \setinterfacevariable{note}{note} @@ -621,6 +622,10 @@ \setinterfaceconstant{align}{uitlijnen} \setinterfaceconstant{aligncharacter}{karakteruitlijnen} \setinterfaceconstant{alignmentcharacter}{uitlijnkarakter} +\setinterfaceconstant{alignmentleftsample}{alignmentleftsample} +\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth} +\setinterfaceconstant{alignmentrightsample}{alignmentrightsample} +\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth} \setinterfaceconstant{alignsymbol}{alignsymbol} \setinterfaceconstant{aligntitle}{titeluitlijnen} \setinterfaceconstant{alternative}{variant} @@ -907,6 +912,7 @@ \setinterfaceconstant{leftoffset}{linkeroffset} \setinterfaceconstant{leftquotation}{linkercitaat} \setinterfaceconstant{leftquote}{linkerciteer} +\setinterfaceconstant{leftsample}{leftsample} \setinterfaceconstant{leftsentence}{linkerzin} \setinterfaceconstant{leftspeech}{linkeruitspraak} \setinterfaceconstant{leftstyle}{linkerletter} @@ -978,7 +984,8 @@ \setinterfaceconstant{nleft}{nlinks} \setinterfaceconstant{nlines}{nregels} \setinterfaceconstant{norm}{norm} -\setinterfaceconstant{note}{note} +\setinterfaceconstant{note}{noot} +\setinterfaceconstant{notes}{noten} \setinterfaceconstant{nr}{nr} \setinterfaceconstant{nright}{nrechts} \setinterfaceconstant{ntop}{nboven} @@ -998,6 +1005,7 @@ \setinterfaceconstant{numberset}{numberset} \setinterfaceconstant{numberstarter}{numberstarter} \setinterfaceconstant{numberstopper}{numberstopper} +\setinterfaceconstant{numberstrut}{nummerstrut} \setinterfaceconstant{numberstyle}{nummerletter} \setinterfaceconstant{numberwidth}{nummerbreedte} \setinterfaceconstant{nx}{nx} @@ -1109,6 +1117,7 @@ \setinterfaceconstant{rightoffset}{rechteroffset} \setinterfaceconstant{rightquotation}{rechtercitaat} \setinterfaceconstant{rightquote}{rechterciteer} +\setinterfaceconstant{rightsample}{rightsample} \setinterfaceconstant{rightsentence}{rechterzin} \setinterfaceconstant{rightspeech}{rechteruitspraak} \setinterfaceconstant{rightstyle}{rechterletter} @@ -1165,7 +1174,9 @@ \setinterfaceconstant{source}{bron} \setinterfaceconstant{space}{spatie} \setinterfaceconstant{spaceafter}{nawit} +\setinterfaceconstant{spaceafterside}{witnazij} \setinterfaceconstant{spacebefore}{voorwit} +\setinterfaceconstant{spacebeforeside}{witvoorzij} \setinterfaceconstant{spaceinbetween}{tussenwit} \setinterfaceconstant{spacing}{spatiering} \setinterfaceconstant{specification}{specification} @@ -1230,6 +1241,7 @@ \setinterfaceconstant{titledistance}{titelafstand} \setinterfaceconstant{titleleft}{titellinks} \setinterfaceconstant{titleright}{titelrechts} +\setinterfaceconstant{titlestrut}{titelstrut} \setinterfaceconstant{titlestyle}{titelletter} \setinterfaceconstant{to}{aan} \setinterfaceconstant{toffset}{toffset} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index df7d91ce0..cd2bb382b 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2018.01.12 15:56} +\newcontextversion{2018.01.14 15:55} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 54316346a..f9958698d 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -41,7 +41,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2018.01.12 15:56} +\edef\contextversion{2018.01.14 15:55} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-gbn.lua b/tex/context/base/mkiv/font-gbn.lua index 3256a1649..8f1acac65 100644 --- a/tex/context/base/mkiv/font-gbn.lua +++ b/tex/context/base/mkiv/font-gbn.lua @@ -235,7 +235,7 @@ function nodes.handlers.nodepass(head,groupcode,size,packtype,direction) end function nodes.handlers.basepass(head) - if not basemodepass then + if basemodepass then head = n_ligaturing(head) head = n_kerning(head) end diff --git a/tex/context/base/mkiv/lang-mis.mkiv b/tex/context/base/mkiv/lang-mis.mkiv index e8609ec04..eb7dc7d80 100644 --- a/tex/context/base/mkiv/lang-mis.mkiv +++ b/tex/context/base/mkiv/lang-mis.mkiv @@ -139,16 +139,13 @@ %D \stop %D \macros -%D {compoundhyphen, -%D beginofsubsentence,endofsubsentence} +%D {compoundhyphen} %D %D Now let's go to the macros. First we define some variables. In the main \CONTEXT\ %D modules these can be tuned by a setup command. Watch the (maybe) better looking %D compound hyphen. \ifx\compoundhyphen \undefined \unexpanded\def\compoundhyphen {\hbox{-\kern-.25ex-}} \fi -\ifx\beginofsubsentence\undefined \unexpanded\def\beginofsubsentence{\hbox{\emdash}} \fi -\ifx\endofsubsentence \undefined \unexpanded\def\endofsubsentence {\hbox{\emdash}} \fi %D The last two variables are needed for subsentences |<|like this one|>| which we %D did not yet mention. We want to enable breaking but at the same time don't want @@ -162,14 +159,17 @@ \unexpanded\def\permithyphenation{\ifhmode\prewordbreak\fi} % doesn't remove spaces %D \macros -%D {beginofsubsentencespacing,endofsubsentencespacing} +%D {beginofsubsentence,endofsubsentence, +%D beginofsubsentencespacing,endofsubsentencespacing} %D %D In the previous macros we provided two hooks which can be used to support nested %D sub||sentences. In \CONTEXT\ these hooks are used to insert a small space when %D needed. -\ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi -\ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi +% \ifx\beginofsubsentence \undefined \unexpanded\def\beginofsubsentence{\hbox{\emdash}} \fi +% \ifx\endofsubsentence \undefined \unexpanded\def\endofsubsentence {\hbox{\emdash}} \fi +% \ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi +% \ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi %D The following piece of code is a torture test compound handling. The \type %D {\relax} before the \type {\ifmmode} is needed because of the alignment scanner @@ -313,7 +313,7 @@ \prewordbreak\discretionary{\hbox{#2}}{}{\hbox{#2}}\allowbreak\postwordbreak \fi\fi \fi\fi - \nextnextnext} % lookahead in commands + \nextnextnext} %D \macros %D {directdiscretionary} @@ -412,14 +412,27 @@ {\prewordbreak\discretionary{\hbox{\normalstartimath|\normalstopimath}}{}{\hbox{\normalstartimath|\normalstopimath}}% \allowbreak\postwordbreak} % bugged +% \definetextmodediscretionary < +% {\beginofsubsentence\prewordbreak\beginofsubsentencespacing} +% +% \definetextmodediscretionary > +% {\endofsubsentencespacing\prewordbreak\endofsubsentence} +% +% \definetextmodediscretionary = +% {\prewordbreak\midsentence\prewordbreak} + \definetextmodediscretionary < - {\beginofsubsentence\prewordbreak\beginofsubsentencespacing} + {\beginofsubsentence\prewordbreak\beginofsubsentencespacing + \aftergroup\ignorespaces} % tricky, we need to go over the \nextnextnext \definetextmodediscretionary > - {\endofsubsentencespacing\prewordbreak\endofsubsentence} + {\removeunwantedspaces + \endofsubsentencespacing\prewordbreak\endofsubsentence} \definetextmodediscretionary = - {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen} + {\removeunwantedspaces + \prewordbreak\midsentence\prewordbreak + \aftergroup\ignorespaces} % french diff --git a/tex/context/base/mkiv/mtx-context-listing.tex b/tex/context/base/mkiv/mtx-context-listing.tex index 41e468e1f..f7c3d2868 100644 --- a/tex/context/base/mkiv/mtx-context-listing.tex +++ b/tex/context/base/mkiv/mtx-context-listing.tex @@ -97,12 +97,15 @@ context.usemodule { "scite" } end - if #document.files > 0 then + local done = false + local files = document.files + + if #files > 0 then if document.arguments.sort then - table.sort(document.files) + table.sort(files) end - for i=1,#document.files do - local filename = document.files[i] + for i=1,#files do + local filename = files[i] if not string.find(filename,"^mtx%-context%-") then local pretty = document.arguments.pretty if pretty == true then @@ -129,9 +132,12 @@ else context.typefile(filename) end + done = true end end - else + end + + if not done then context("no files given") end diff --git a/tex/context/base/mkiv/mtx-context-meaning.tex b/tex/context/base/mkiv/mtx-context-meaning.tex new file mode 100644 index 000000000..88ca21759 --- /dev/null +++ b/tex/context/base/mkiv/mtx-context-meaning.tex @@ -0,0 +1,83 @@ +%D \module +%D [ file=mtx-context-meaning, +%D version=2018.01.12, +%D title=\CONTEXT\ Extra Trickry, +%D subtitle=Show Meanings, +%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. + +% begin help +% +% usage: context --extra=meaning [options] list-of-commands +% +% --pattern : match given pattern +% +% example: context --extra=meaning --pattern=*paper* +% context --extra=meaning setuplayout +% context --extra=meaning setup_layout +% +% end help + +\input mtx-context-common.tex + +\setupbodyfont + [dejavu] + +\def\showmeaning#1% + {\writestatus{meaning}{\strippedcsname#1}% + \writestring{}% + \writestring{\expandafter\meaning\begincsname#1\endcsname}} + +\starttext + +\startluacode + local h = tex.hashtokens() + + local function showmeaning(str) + local s = string.gsub(str,"^\\","") + local p = "^" .. string.topattern(s) .. "$" + context("pattern: ") + context.type(s) + context.blank() + for i=1,#h do + local hi = h[i] + if string.find(h[i],p) then + context.type(hi) + context.par() + context.showmeaning(hi) + end + end + context.page() + end + + local done = false + local pattern = document.arguments.pattern + + if pattern then + pattern = { pattern} + else + pattern = document.files + end + + if type(pattern) == "table" then + table.sort(pattern) + for i=1,#pattern do + local p = pattern[i] + if not string.find(p,"^mtx%-context%-") then + done = true + showmeaning(p) + end + end + end + + if not done then + context("no search pattern given") + end +\stopluacode + +\stoptext diff --git a/tex/context/base/mkiv/spac-ali.mkiv b/tex/context/base/mkiv/spac-ali.mkiv index eff4cbcbf..e5e7bd40f 100644 --- a/tex/context/base/mkiv/spac-ali.mkiv +++ b/tex/context/base/mkiv/spac-ali.mkiv @@ -791,10 +791,17 @@ \setvalue{\??aligncommand\v!extremestretch }{\toksapp\t_spac_align_collected{\spac_align_set_extreme_stretch}} \setvalue{\??aligncommand \v!final}{\c_spac_align_state_par_fill\plusone} +\setvalue{\??aligncommand1*\v!final}{\c_spac_align_state_par_fill\plusone} \setvalue{\??aligncommand2*\v!final}{\c_spac_align_state_par_fill\plustwo} % hardcoded multiplier \setvalue{\??aligncommand3*\v!final}{\c_spac_align_state_par_fill\plusthree} \setvalue{\??aligncommand4*\v!final}{\c_spac_align_state_par_fill\plusfour} +% a one shot (only usefull in e.g. framed, also needs tolerance and stretch) + +\setvalue{\??aligncommand \v!more}{\toksapp\t_spac_align_collected{\looseness\plusone}} +\setvalue{\??aligncommand1*\v!more}{\toksapp\t_spac_align_collected{\looseness\plusone}} +\setvalue{\??aligncommand2*\v!more}{\toksapp\t_spac_align_collected{\looseness\plustwo}} + % \setvalue{\??aligncommand ... }{\toksapp\t_spac_align_collected{\nopenalties}} % \setvalue{\??aligncommand ... }{\toksapp\t_spac_align_collected{\setdefaultpenalties}} diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex c5feca20c..b04345260 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 044d5ab28..60dc11947 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/strc-con.mkvi b/tex/context/base/mkiv/strc-con.mkvi index 0aa7e69da..57b69cc7f 100644 --- a/tex/context/base/mkiv/strc-con.mkvi +++ b/tex/context/base/mkiv/strc-con.mkvi @@ -524,6 +524,11 @@ [\v!empty] [\c!renderingsetup=\??constructionrenderings:\v!empty] +\defineconstructionalternative + [\v!label] + [\c!renderingsetup=\??constructionrenderings:\v!label, + \c!width=] + \newbox \constructionheadbox \newskip \leftconstructionskip \newskip \rightconstructionskip @@ -906,6 +911,13 @@ \ignorespaces \stopsetups +\startsetups[\??constructionrenderings:\v!label] + \dontleavehmode + \begingroup + \constructionparameter\c!headcommand{\flushconstructionheadbox} + \endgroup +\stopsetups + % you can use \placeclosesymbol or \qed to place a symbol at the end of a % construction diff --git a/tex/context/base/mkiv/task-ini.lua b/tex/context/base/mkiv/task-ini.lua index 36b346342..f41fb9b08 100644 --- a/tex/context/base/mkiv/task-ini.lua +++ b/tex/context/base/mkiv/task-ini.lua @@ -44,15 +44,15 @@ appendaction("processors", "characters", "scripts.injectors.handler") appendaction("processors", "words", "languages.words.check") -- disabled -- might move up, no disc check needed then appendaction("processors", "words", "languages.hyphenators.handler") -- always on appendaction("processors", "words", "typesetters.initials.handler") -- disabled -- might move up -appendaction("processors", "words", "typesetters.firstlines.handler") -- disabled -- might move down +appendaction("processors", "words", "typesetters.firstlines.handler") -- disabled appendaction("processors", "fonts", "builders.paragraphs.solutions.splitters.split") -- experimental appendaction("processors", "fonts", "nodes.handlers.characters") -- maybe todo appendaction("processors", "fonts", "nodes.injections.handler") appendaction("processors", "fonts", "typesetters.fontkerns.handler") appendaction("processors", "fonts", "nodes.handlers.protectglyphs", nil, "nohead") -- maybe todo -appendaction("processors", "fonts", "builders.kernel.ligaturing") -- always on (could be selective: if only node mode) -appendaction("processors", "fonts", "builders.kernel.kerning") -- always on (could be selective: if only node mode) +appendaction("processors", "fonts", "builders.kernel.ligaturing") -- not always on (could be selective: if only node mode) +appendaction("processors", "fonts", "builders.kernel.kerning") -- not always on (could be selective: if only node mode) appendaction("processors", "fonts", "nodes.handlers.stripping") -- disabled (might move) ------------("processors", "fonts", "typesetters.italics.handler") -- disabled (after otf/kern handling) appendaction("processors", "fonts", "nodes.handlers.flatten") diff --git a/tex/context/base/mkiv/typo-del.mkiv b/tex/context/base/mkiv/typo-del.mkiv index 1ef7f74c6..33688b9d3 100644 --- a/tex/context/base/mkiv/typo-del.mkiv +++ b/tex/context/base/mkiv/typo-del.mkiv @@ -140,6 +140,18 @@ % \def\beforesubsentence{\removeunwantedspaces} % \def\aftersubsentence {\ignorespaces} +\newconditional\c_typo_subsentence_cleanup % \settrue\c_typo_subsentence_cleanup + +\def\typo_subsentence_cleanup_start + {\ifconditional\c_typo_subsentence_cleanup + \expandafter\ignorespaces + \fi} + +\def\typo_subsentence_cleanup_stop + {\ifconditional\c_typo_subsentence_cleanup + \removeunwantedspaces + \fi} + \unexpanded\def\midsentence {\dostarttagged\t!subsentencesymbol\empty \dotagsetsubsentencesymbol\s!middle @@ -162,10 +174,11 @@ \symbol[\ifodd\c_typo_subsentence_nesting\c!leftsentence\else\c!leftsubsentence\fi]% \dostoptagged \dostarttagged\t!subsentencecontent\empty - }% \ignorespaces} + \typo_subsentence_cleanup_start} \unexpanded\def\endofsubsentence % relax prevents space gobbling - {\dostoptagged + {\typo_subsentence_cleanup_stop + \dostoptagged \dostarttagged\t!subsentencesymbol\empty \dotagsetsubsentencesymbol\s!right \symbol[\ifodd\c_typo_subsentence_nesting\c!rightsentence\else\c!rightsubsentence\fi]% @@ -184,7 +197,7 @@ \unskip \hskip\hspaceamount\currentusedlanguage{intersentence}% % no good, actually language dependent: -% \ignorespaces + % \ignorespaces \else \unskip \fi} @@ -199,9 +212,10 @@ %D \typebuffer %D \getbuffer -\unexpanded\def\startsubsentence{\beginofsubsentence \prewordbreak\beginofsubsentencespacing} -\unexpanded\def\stopsubsentence {\endofsubsentencespacing\prewordbreak\endofsubsentence} +\unexpanded\def\startsubsentence{\beginofsubsentence\prewordbreak\beginofsubsentencespacing\typo_subsentence_cleanup_start} +\unexpanded\def\stopsubsentence {\typo_subsentence_cleanup_stop\endofsubsentencespacing\prewordbreak\endofsubsentence} \unexpanded\def\subsentence {\groupedcommand\startsubsentence\stopsubsentence} +\unexpanded\def\midsubsentence {\typo_subsentence_cleanup_start\prewordbreak\midsentence\prewordbreak\typo_subsentence_cleanup_stop} \definehspace [quotation] [\zeropoint] \definehspace [interquotation] [.125em] diff --git a/tex/context/base/mkiv/typo-fln.lua b/tex/context/base/mkiv/typo-fln.lua index 0cebd4b37..4fb82ce44 100644 --- a/tex/context/base/mkiv/typo-fln.lua +++ b/tex/context/base/mkiv/typo-fln.lua @@ -38,7 +38,8 @@ local getprev = nuts.getprev local getboth = nuts.getboth local setboth = nuts.setboth local getid = nuts.getid -local getfield = nuts.getfield +local getsubtype = nuts.getsubtype +local getwidth = nuts.getwidth local getlist = nuts.getlist local setlist = nuts.setlist local getattr = nuts.getattr @@ -53,14 +54,19 @@ local nodecodes = nodes.nodecodes local glyph_code = nodecodes.glyph local disc_code = nodecodes.disc local kern_code = nodecodes.kern +local glue_code = nodecodes.glue + +local spaceskip_code = nodes.gluecodes.spaceskip local traverse_id = nuts.traverse_id local flush_node_list = nuts.flush_list local flush_node = nuts.flush_node local copy_node_list = nuts.copy_list +local insert_node_before = nuts.insert_before local insert_node_after = nuts.insert_after local remove_node = nuts.remove local list_dimensions = nuts.dimensions +local hpack_node_list = nuts.hpack local nodepool = nuts.pool local newpenalty = nodepool.penalty @@ -114,7 +120,7 @@ implement { } actions[v_line] = function(head,setting) - -- local attribute = fonts.specifiers.contextnumber(setting.feature) -- was experimental + -- local attribute = fonts.specifiers.contextnumber(setting.feature) -- was experimental local dynamic = setting.dynamic local font = setting.font local noflines = setting.n or 1 @@ -165,11 +171,28 @@ actions[v_line] = function(head,setting) hsize = hsize - hangindent end + local function list_dimensions(list,start) + local temp = copy_node_list(list,start) + temp = tonode(temp) + temp = nodes.handlers.characters(temp) + temp = nodes.injections.handler(temp) + -- temp = typesetters.fontkerns.handler(temp) -- maybe when enabled + -- nodes.handlers.protectglyphs(temp) -- not needed as we discard + -- temp = typesetters.spacings.handler(temp) -- maybe when enabled + -- temp = typesetters.kerns.handler(temp) -- maybe when enabled + temp = tonut(temp) + temp = hpack_node_list(temp) + local width = getwidth(temp) + flush_node_list(temp) + return width + end + local function try(extra) local width = list_dimensions(list,start) if extra then width = width + list_dimensions(extra) end + -- report_firstlines("line length: %p, progression: %p, text: %s",hsize,width,nodes.listtoutf(list,nil,nil,start)) if width > hsize then list = prev return true @@ -187,7 +210,10 @@ actions[v_line] = function(head,setting) elseif id == disc_code then -- this could be an option n = n + 1 - if try(getfield(start,"pre")) then + local pre, post, replace = getdisc(start) + if pre and try(pre) then + break + elseif replace and try(replace) then break end elseif id == kern_code then -- todo: fontkern @@ -203,6 +229,9 @@ actions[v_line] = function(head,setting) linebreaks[i] = n end end + + flush_node_list(temp) + local start = head local n = 0 @@ -224,6 +253,7 @@ actions[v_line] = function(head,setting) local linebreak = linebreaks[i] while start and n < nofchars do local id = getid(start) + local ok = false if id == glyph_code then n = n + 1 update(start) @@ -268,6 +298,8 @@ actions[v_line] = function(head,setting) end setdisc(disc,pre,post,replace) flush_node(disc) + elseif id == glue_code then + head = insert_node_before(head,start,newpenalty(10000)) -- nobreak end if linebreak == n then if trace_firstlines then @@ -281,7 +313,7 @@ actions[v_line] = function(head,setting) start = getnext(start) end end - flush_node_list(temp) + return head, true end diff --git a/tex/context/interface/mkii/keys-nl.xml b/tex/context/interface/mkii/keys-nl.xml index 8cef8ca55..212685d44 100644 --- a/tex/context/interface/mkii/keys-nl.xml +++ b/tex/context/interface/mkii/keys-nl.xml @@ -379,6 +379,7 @@ <cd:variable name='norepeat' value='norepeat'/> <cd:variable name='normal' value='normaal'/> <cd:variable name='nospacing' value='geenspatiering'/> + <cd:variable name='nostopper' value='geenafsluiter'/> <cd:variable name='not' value='niet'/> <cd:variable name='notation' value='notation'/> <cd:variable name='note' value='note'/> @@ -627,6 +628,10 @@ <cd:constant name='align' value='uitlijnen'/> <cd:constant name='aligncharacter' value='karakteruitlijnen'/> <cd:constant name='alignmentcharacter' value='uitlijnkarakter'/> + <cd:constant name='alignmentleftsample' value='alignmentleftsample'/> + <cd:constant name='alignmentleftwidth' value='alignmentleftwidth'/> + <cd:constant name='alignmentrightsample' value='alignmentrightsample'/> + <cd:constant name='alignmentrightwidth' value='alignmentrightwidth'/> <cd:constant name='alignsymbol' value='alignsymbol'/> <cd:constant name='aligntitle' value='titeluitlijnen'/> <cd:constant name='alternative' value='variant'/> @@ -913,6 +918,7 @@ <cd:constant name='leftoffset' value='linkeroffset'/> <cd:constant name='leftquotation' value='linkercitaat'/> <cd:constant name='leftquote' value='linkerciteer'/> + <cd:constant name='leftsample' value='leftsample'/> <cd:constant name='leftsentence' value='linkerzin'/> <cd:constant name='leftspeech' value='linkeruitspraak'/> <cd:constant name='leftstyle' value='linkerletter'/> @@ -984,7 +990,8 @@ <cd:constant name='nleft' value='nlinks'/> <cd:constant name='nlines' value='nregels'/> <cd:constant name='norm' value='norm'/> - <cd:constant name='note' value='note'/> + <cd:constant name='note' value='noot'/> + <cd:constant name='notes' value='noten'/> <cd:constant name='nr' value='nr'/> <cd:constant name='nright' value='nrechts'/> <cd:constant name='ntop' value='nboven'/> @@ -1004,6 +1011,7 @@ <cd:constant name='numberset' value='numberset'/> <cd:constant name='numberstarter' value='numberstarter'/> <cd:constant name='numberstopper' value='numberstopper'/> + <cd:constant name='numberstrut' value='nummerstrut'/> <cd:constant name='numberstyle' value='nummerletter'/> <cd:constant name='numberwidth' value='nummerbreedte'/> <cd:constant name='nx' value='nx'/> @@ -1115,6 +1123,7 @@ <cd:constant name='rightoffset' value='rechteroffset'/> <cd:constant name='rightquotation' value='rechtercitaat'/> <cd:constant name='rightquote' value='rechterciteer'/> + <cd:constant name='rightsample' value='rightsample'/> <cd:constant name='rightsentence' value='rechterzin'/> <cd:constant name='rightspeech' value='rechteruitspraak'/> <cd:constant name='rightstyle' value='rechterletter'/> @@ -1171,7 +1180,9 @@ <cd:constant name='source' value='bron'/> <cd:constant name='space' value='spatie'/> <cd:constant name='spaceafter' value='nawit'/> + <cd:constant name='spaceafterside' value='witnazij'/> <cd:constant name='spacebefore' value='voorwit'/> + <cd:constant name='spacebeforeside' value='witvoorzij'/> <cd:constant name='spaceinbetween' value='tussenwit'/> <cd:constant name='spacing' value='spatiering'/> <cd:constant name='specification' value='specification'/> @@ -1236,6 +1247,7 @@ <cd:constant name='titledistance' value='titelafstand'/> <cd:constant name='titleleft' value='titellinks'/> <cd:constant name='titleright' value='titelrechts'/> + <cd:constant name='titlestrut' value='titelstrut'/> <cd:constant name='titlestyle' value='titelletter'/> <cd:constant name='to' value='aan'/> <cd:constant name='toffset' value='toffset'/> diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml index e39caba78..48fcac906 100644 --- a/tex/context/interface/mkiv/context-en.xml +++ b/tex/context/interface/mkiv/context-en.xml @@ -249,9 +249,13 @@ <cd:constant type="stretch"/> <cd:constant type="extremestretch"/> <cd:constant type="final"/> + <cd:constant type="1*final"/> <cd:constant type="2*final"/> <cd:constant type="3*final"/> <cd:constant type="4*final"/> + <cd:constant type="more"/> + <cd:constant type="1*more"/> + <cd:constant type="2*more"/> </cd:keywords> </cd:arguments> </cd:command> @@ -7396,6 +7400,7 @@ </cd:arguments> </cd:command> <cd:command category="language" file="typo-del.mkiv" level="document" name="subsentence" type="environment"/> + <cd:command category="language" file="typo-del.mkiv" level="document" name="midsubsentence"/> </cd:interface> <cd:interface file="i-description.xml"> <cd:command category="structure" file="strc-des.mkvi" level="style" name="definedescription"> diff --git a/tex/context/interface/mkiv/i-align.xml b/tex/context/interface/mkiv/i-align.xml index 55659a12a..669b845b9 100644 --- a/tex/context/interface/mkiv/i-align.xml +++ b/tex/context/interface/mkiv/i-align.xml @@ -53,9 +53,13 @@ <cd:constant type="stretch"/> <cd:constant type="extremestretch"/> <cd:constant type="final"/> + <cd:constant type="1*final"/> <cd:constant type="2*final"/> <cd:constant type="3*final"/> <cd:constant type="4*final"/> + <cd:constant type="more"/> + <cd:constant type="1*more"/> + <cd:constant type="2*more"/> <!-- <cd:constant type="cd:name"/> --> @@ -313,4 +317,4 @@ </cd:arguments> </cd:command> -</cd:interface>
\ No newline at end of file +</cd:interface> diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 38c4532e4..a5ba5a662 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-delimitedtext.xml b/tex/context/interface/mkiv/i-delimitedtext.xml index 5017aa02b..c34052644 100644 --- a/tex/context/interface/mkiv/i-delimitedtext.xml +++ b/tex/context/interface/mkiv/i-delimitedtext.xml @@ -258,4 +258,6 @@ <cd:command name="subsentence" type="environment" level="document" category="language" file="typo-del.mkiv"/> -</cd:interface>
\ No newline at end of file + <cd:command name="midsubsentence" level="document" category="language" file="typo-del.mkiv"/> + +</cd:interface> diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex 53ce66a29..b4431ff9f 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 6da2415ad..37e2dbfc5 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 01/12/18 15:56:34 +-- merge date : 01/14/18 15:55:33 do -- begin closure to overcome local limits and interference @@ -34752,7 +34752,7 @@ function nodes.handlers.nodepass(head,groupcode,size,packtype,direction) end end function nodes.handlers.basepass(head) - if not basemodepass then + if basemodepass then head=n_ligaturing(head) head=n_kerning(head) end |