From a16cd078a5cc00d7c789093b5209b6f8d2dfdb1a Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 14 Jan 2018 17:29:49 +0100 Subject: 2018-01-14 16:05:00 --- doc/context/documents/general/manuals/cld-mkiv.pdf | Bin 796440 -> 798293 bytes doc/context/documents/general/qrcs/setup-cs.pdf | Bin 842366 -> 842570 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 842149 -> 842333 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 846330 -> 846466 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 839112 -> 839308 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 842518 -> 842708 bytes .../documents/general/qrcs/setup-mapping-cs.pdf | Bin 358627 -> 358669 bytes .../documents/general/qrcs/setup-mapping-de.pdf | Bin 437787 -> 437942 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 356308 -> 356378 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 358679 -> 358874 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 357863 -> 357864 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 357285 -> 357617 bytes .../documents/general/qrcs/setup-mapping-ro.pdf | Bin 623432 -> 623889 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 835436 -> 835647 bytes doc/context/documents/general/qrcs/setup-ro.pdf | Bin 838208 -> 838383 bytes .../sources/general/fonts/fonts/fonts-features.tex | 4 + .../general/manuals/cld/cld-specialcommands.tex | 172 ++++++++++++++++++++- .../general/manuals/spacing/spacing-spaces.tex | 40 +++++ 18 files changed, 210 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/context/documents/general/manuals/cld-mkiv.pdf b/doc/context/documents/general/manuals/cld-mkiv.pdf index a2cdb7fc9..bac02979f 100644 Binary files a/doc/context/documents/general/manuals/cld-mkiv.pdf and b/doc/context/documents/general/manuals/cld-mkiv.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf index 2ffb19efa..cd9954bb7 100644 Binary files a/doc/context/documents/general/qrcs/setup-cs.pdf and b/doc/context/documents/general/qrcs/setup-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf index e82e59d07..85d4d24da 100644 Binary files a/doc/context/documents/general/qrcs/setup-de.pdf and b/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf index 38c4532e4..a5ba5a662 100644 Binary files a/doc/context/documents/general/qrcs/setup-en.pdf and b/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf index 29f08846d..de6dcbbd2 100644 Binary files a/doc/context/documents/general/qrcs/setup-fr.pdf and b/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf index 02df2354e..8d4a71209 100644 Binary files a/doc/context/documents/general/qrcs/setup-it.pdf and b/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf index c301caabc..0a3ef98ec 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf and b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf index 87fdaf725..6447d100a 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-de.pdf and b/doc/context/documents/general/qrcs/setup-mapping-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf index c8088953f..97c6edb1f 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-en.pdf and b/doc/context/documents/general/qrcs/setup-mapping-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf index 2a10daed4..ee2912cc9 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf and b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf index 0997f1662..447ac5c12 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-it.pdf and b/doc/context/documents/general/qrcs/setup-mapping-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf index 18cbbedf6..548415194 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf and b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf index a9e83a207..84ede4333 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf and b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf index 5137d53cb..31b39c1ac 100644 Binary files a/doc/context/documents/general/qrcs/setup-nl.pdf and b/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf index 75c8f9455..95f3d1223 100644 Binary files a/doc/context/documents/general/qrcs/setup-ro.pdf and b/doc/context/documents/general/qrcs/setup-ro.pdf differ 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 -- cgit v1.2.3