summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-02-23 23:32:32 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-02-23 23:32:32 +0100
commit661fb34ced40815e1e5e9073de9c8475127da094 (patch)
treee37efb780017271ef7d9d3b79673d6093b228c23 /doc/context/sources/general/manuals
parent8e51addbcecd962280c24a77de9ec1f6724e7a65 (diff)
downloadcontext-661fb34ced40815e1e5e9073de9c8475127da094.tar.gz
2018-02-23 22:19:00
Diffstat (limited to 'doc/context/sources/general/manuals')
-rw-r--r--doc/context/sources/general/manuals/cld/cld-specialcommands.tex55
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex.tex2
-rw-r--r--doc/context/sources/general/manuals/math/math-spacing.tex51
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex4
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-style.tex2
5 files changed, 111 insertions, 3 deletions
diff --git a/doc/context/sources/general/manuals/cld/cld-specialcommands.tex b/doc/context/sources/general/manuals/cld/cld-specialcommands.tex
index 151952c53..37ecf45c6 100644
--- a/doc/context/sources/general/manuals/cld/cld-specialcommands.tex
+++ b/doc/context/sources/general/manuals/cld/cld-specialcommands.tex
@@ -63,7 +63,11 @@ Other examples of macros that have optimized functions are \type {\par},
\startsection[title=Steps]
-When you run the following code:
+% added and extended in sync with an article about a generic 'execute'
+% feature
+
+We already mentioned the stepper as a very special trick so let's give
+some more explanation here. When you run the following code:
\setbox0\emptybox
@@ -197,7 +201,54 @@ which gives:
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.
+input stack but normally that is no real issue.
+
+You can run the following code:
+
+\starttyping
+\definenumber[LineCounter][way=bypage]
+\starttext
+\startluacode
+for i=1,2000 do
+ context.incrementnumber { "LineCounter" }
+ context.getnumber { "LineCounter" }
+ context.par()
+end
+\stopluacode
+\stoptext
+\stoptyping
+
+You will notice however that the number is not right on each page. This is
+because \TEX\ doesn't know yet that there is no room on the page. The next will
+work better:
+
+\starttyping
+\definenumber[LineCounter][way=bypage]
+\starttext
+\startluacode
+context.stepwise(function()
+ for i=1,2000 do
+ context.testpage { 0 }
+ context.incrementnumber { "LineCounter" }
+ context.getnumber { "LineCounter" }
+ context.par()
+ context.step()
+ end
+end)
+\stopluacode
+\stoptext
+\starttyping
+
+Instead of the \type {testpage} function you can also play directly with
+registers, like:
+
+\starttyping
+if tex.pagegtotal + tex.count.lineheight > tex.pagetotal then
+\starttyping
+
+but often an already defined helper does a better job. Of course you will
+probably never need this kind of hacks anyway, if only because much more is going
+on and there are better ways then.
\stopsection
diff --git a/doc/context/sources/general/manuals/luatex/luatex.tex b/doc/context/sources/general/manuals/luatex/luatex.tex
index 43f81ab5e..1d6f16f6a 100644
--- a/doc/context/sources/general/manuals/luatex/luatex.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex.tex
@@ -1,5 +1,7 @@
% macros=mkvi
+% \disabledirectives[vspacing.synchronizepage]
+
% author : Hans Hagen with Taco Hoekwater, Luigi Scarso & Hartmut Henkel
% copyright : PRAGMA ADE & ConTeXt Development Team
% license : Creative Commons Attribution ShareAlike 4.0 International
diff --git a/doc/context/sources/general/manuals/math/math-spacing.tex b/doc/context/sources/general/manuals/math/math-spacing.tex
index 3a665a7d8..913a90d9e 100644
--- a/doc/context/sources/general/manuals/math/math-spacing.tex
+++ b/doc/context/sources/general/manuals/math/math-spacing.tex
@@ -1,3 +1,5 @@
+% language=uk
+
\environment math-layout
\startcomponent math-spacing
@@ -689,6 +691,55 @@ We have
\stopsection
+\startsection[title=Choices]
+
+The next examples are generated using this macro:
+
+\startbuffer
+\starttexdefinition unexpanded Test#1#2
+
+ \begingroup
+
+ \showmakeup[depth]
+
+ \def\TestA{\dontleavehmode\ruledhbox{\dorecurse{8}{before }}}
+ \def\TestB{\dontleavehmode\ruledhbox{\dorecurse{8}{after }}}
+ \def\TestC{\dorecurse{18}{x+}x}
+
+ \setdisplaymathspacemodel[3]
+ \setupalign[flushleft] 1\space:\space\TestA \par
+ \startformula #2 \TestC \stopformula \par
+ \setupalign[flushleft] 2\space:\space\TestB \par
+
+ \setdisplaymathspacemodel[4]
+
+ \vskip#1\lineheight
+
+ \setupalign[flushright] \TestA\space:\space2 \par
+ \startformula #2 \TestC \stopformula \par
+ \setupalign[flushright] \TestB\space:\space2 \par
+
+ \endgroup
+
+\stoptexdefinition
+\stopbuffer
+
+\typebuffer \getbuffer
+
+It demonstrates the often hard decisions that we have to make with regards to
+spacing. On the one hand we want to be adaptive, on the other hand we want to be
+consistent, for instance in the depth of lines. These examples overlay the two
+variants (which is of course font and style dependent).
+
+\Test{-4.70}{} \blank[2*line]
+\Test{-6.00}{\frac{1}{2}} \blank[2*line]
+\Test{-6.55}{\frac{1}{\frac{1}{2}}}
+
+One side effect of these options is that at some point we need to choose a
+default and then easily forget about the other variants.
+
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex b/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
index c16afbf0a..525dd7490 100644
--- a/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
+++ b/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
@@ -6,6 +6,8 @@
\startchapter[title=Line correction]
+\startsection[title=Wrapping content]
+
\startbuffer[linecorrection]
\typebuffer
\blank
@@ -103,6 +105,8 @@ Because in this document we have set the whitespace this also gets added around
the box. So, in case your spacing around some special content looks bad, consider
using these commands.
+\stopsection
+
\stopchapter
\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-style.tex b/doc/context/sources/general/manuals/spacing/spacing-style.tex
index c9d168f1c..5514df729 100644
--- a/doc/context/sources/general/manuals/spacing/spacing-style.tex
+++ b/doc/context/sources/general/manuals/spacing/spacing-style.tex
@@ -1,6 +1,6 @@
\startenvironment spacing-style
-\usemodule[abr-03]
+\usemodule[abbreviations-words,typesetting]
\setupbodyfont
[pagella]