From 2bca80bc96d0182956e57c51b5d4977f714bed5c Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Thu, 2 Jun 2016 23:03:30 +0200 Subject: 2016-06-02 21:33:00 --- .../documents/general/columnsets/columnsets.pdf | Bin 4526014 -> 0 bytes .../documents/general/manuals/columnsets.pdf | Bin 0 -> 4526014 bytes doc/context/documents/general/manuals/luatex.pdf | Bin 995793 -> 999551 bytes .../documents/general/manuals/math-mkiv.pdf | Bin 0 -> 1149224 bytes .../documents/general/manuals/spacing-mkiv.pdf | Bin 38452 -> 39828 bytes doc/context/documents/general/manuals/xml-mkiv.pdf | Bin 1308267 -> 1306364 bytes .../columnsets/columnsets/columnsets-000.tex | 63 -- .../columnsets/columnsets/columnsets-001.tex | 17 - .../columnsets/columnsets/columnsets-002.tex | 17 - .../columnsets/columnsets/columnsets-003.tex | 35 - .../columnsets/columnsets/columnsets-004.tex | 32 - .../columnsets/columnsets/columnsets-005.tex | 29 - .../columnsets/columnsets/columnsets-006.tex | 35 - .../columnsets/columnsets/columnsets-007.tex | 43 - .../columnsets/columnsets/columnsets-101.tex | 30 - .../columnsets/columnsets/columnsets-102.tex | 36 - .../columnsets/columnsets/columnsets-103.tex | 37 - .../columnsets/columnsets/columnsets-201.tex | 31 - .../columnsets/columnsets/columnsets-202.tex | 32 - .../columnsets/columnsets/columnsets-203.tex | 29 - .../columnsets/columnsets/columnsets-204.tex | 41 - .../columnsets/columnsets/columnsets-205.tex | 42 - .../columnsets/columnsets/columnsets-206.tex | 29 - .../columnsets/columnsets/columnsets-301.tex | 29 - .../columnsets/columnsets/columnsets-401.tex | 26 - .../columnsets/columnsets/columnsets-402.tex | 24 - .../columnsets/columnsets/columnsets-403.tex | 23 - .../columnsets/columnsets/columnsets-404.tex | 34 - .../columnsets/columnsets/columnsets-405.tex | 29 - .../columnsets/columnsets/columnsets-601.tex | 29 - .../columnsets/columnsets/columnsets-701.tex | 23 - .../columnsets/columnsets/columnsets-702.tex | 27 - .../columnsets/columnsets/columnsets-703.tex | 34 - .../columnsets/columnsets/columnsets-704.tex | 69 -- .../columnsets/columnsets/columnsets-801.tex | 19 - .../columnsets/columnsets/columnsets-802.tex | 22 - .../columnsets/columnsets/columnsets-803.tex | 26 - .../columnsets/columnsets/columnsets-804.tex | 26 - .../columnsets/columnsets/columnsets-805.tex | 26 - .../columnsets/columnsets/columnsets-806.tex | 26 - .../columnsets/columnsets/columnsets-901.tex | 38 - .../columnsets/columnsets/columnsets-902.tex | 38 - .../columnsets/columnsets/columnsets-903.tex | 41 - .../general/columnsets/columnsets/columnsets.tex | 873 ------------------- .../general/manuals/columnsets/columnsets-000.tex | 63 ++ .../general/manuals/columnsets/columnsets-001.tex | 17 + .../general/manuals/columnsets/columnsets-002.tex | 17 + .../general/manuals/columnsets/columnsets-003.tex | 35 + .../general/manuals/columnsets/columnsets-004.tex | 32 + .../general/manuals/columnsets/columnsets-005.tex | 29 + .../general/manuals/columnsets/columnsets-006.tex | 35 + .../general/manuals/columnsets/columnsets-007.tex | 43 + .../general/manuals/columnsets/columnsets-101.tex | 30 + .../general/manuals/columnsets/columnsets-102.tex | 36 + .../general/manuals/columnsets/columnsets-103.tex | 37 + .../general/manuals/columnsets/columnsets-201.tex | 31 + .../general/manuals/columnsets/columnsets-202.tex | 32 + .../general/manuals/columnsets/columnsets-203.tex | 29 + .../general/manuals/columnsets/columnsets-204.tex | 41 + .../general/manuals/columnsets/columnsets-205.tex | 42 + .../general/manuals/columnsets/columnsets-206.tex | 29 + .../general/manuals/columnsets/columnsets-301.tex | 29 + .../general/manuals/columnsets/columnsets-401.tex | 26 + .../general/manuals/columnsets/columnsets-402.tex | 24 + .../general/manuals/columnsets/columnsets-403.tex | 23 + .../general/manuals/columnsets/columnsets-404.tex | 34 + .../general/manuals/columnsets/columnsets-405.tex | 29 + .../general/manuals/columnsets/columnsets-601.tex | 29 + .../general/manuals/columnsets/columnsets-701.tex | 23 + .../general/manuals/columnsets/columnsets-702.tex | 27 + .../general/manuals/columnsets/columnsets-703.tex | 34 + .../general/manuals/columnsets/columnsets-704.tex | 69 ++ .../general/manuals/columnsets/columnsets-801.tex | 19 + .../general/manuals/columnsets/columnsets-802.tex | 22 + .../general/manuals/columnsets/columnsets-803.tex | 26 + .../general/manuals/columnsets/columnsets-804.tex | 26 + .../general/manuals/columnsets/columnsets-805.tex | 26 + .../general/manuals/columnsets/columnsets-806.tex | 26 + .../general/manuals/columnsets/columnsets-901.tex | 38 + .../general/manuals/columnsets/columnsets-902.tex | 38 + .../general/manuals/columnsets/columnsets-903.tex | 41 + .../general/manuals/columnsets/columnsets.tex | 873 +++++++++++++++++++ .../manuals/luatex/luatex-modifications.tex | 12 +- .../general/manuals/luatex/luatex-nodes.tex | 20 + .../sources/general/manuals/math/math-mkiv.tex | 631 ++++++++++++++ .../sources/general/manuals/xml/xml-mkiv.tex | 77 ++ scripts/context/lua/mtxrun.lua | 10 +- scripts/context/stubs/mswin/mtxrun.lua | 10 +- scripts/context/stubs/unix/mtxrun | 10 +- scripts/context/stubs/win64/mtxrun.lua | 10 +- tex/context/base/context-version.pdf | Bin 4250 -> 4245 bytes tex/context/base/mkii/mult-de.mkii | 1 + tex/context/base/mkii/mult-en.mkii | 1 + tex/context/base/mkii/mult-fr.mkii | 1 + tex/context/base/mkii/mult-it.mkii | 1 + tex/context/base/mkii/mult-nl.mkii | 1 + tex/context/base/mkii/mult-pe.mkii | 1 + tex/context/base/mkii/mult-ro.mkii | 1 + tex/context/base/mkiv/anch-pos.lua | 9 + tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context-todo.tex | 6 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/font-ext.lua | 23 +- tex/context/base/mkiv/font-gds.lua | 941 --------------------- tex/context/base/mkiv/font-lib.mkvi | 6 +- tex/context/base/mkiv/font-otj.lua | 2 + tex/context/base/mkiv/font-sel.lua | 4 +- tex/context/base/mkiv/good-ctx.lua | 275 ++++++ tex/context/base/mkiv/good-gen.lua | 208 +++++ tex/context/base/mkiv/good-ini.lua | 349 ++++++++ tex/context/base/mkiv/good-mth.lua | 173 ++++ tex/context/base/mkiv/layo-ini.lua | 8 +- tex/context/base/mkiv/lxml-tab.lua | 6 +- tex/context/base/mkiv/lxml-tex.lua | 3 + tex/context/base/mkiv/math-map.lua | 4 + tex/context/base/mkiv/mult-def.lua | 4 + tex/context/base/mkiv/page-mix.lua | 3 - tex/context/base/mkiv/spac-ali.lua | 2 +- tex/context/base/mkiv/spac-ver.mkiv | 16 +- tex/context/base/mkiv/status-files.pdf | Bin 9274 -> 9080 bytes tex/context/base/mkiv/status-lua.pdf | Bin 268373 -> 268642 bytes tex/context/base/mkiv/trac-vis.lua | 7 +- tex/context/base/mkiv/typo-mar.lua | 332 +++----- tex/context/base/mkiv/typo-mar.mkiv | 6 +- tex/context/interface/mkii/keys-cs.xml | 1 + tex/context/interface/mkii/keys-de.xml | 1 + tex/context/interface/mkii/keys-en.xml | 1 + tex/context/interface/mkii/keys-fr.xml | 1 + tex/context/interface/mkii/keys-it.xml | 1 + tex/context/interface/mkii/keys-nl.xml | 1 + tex/context/interface/mkii/keys-pe.xml | 1 + tex/context/interface/mkii/keys-ro.xml | 1 + tex/context/interface/mkiv/i-context.pdf | Bin 820931 -> 820812 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 60791 -> 60787 bytes tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 135 files changed, 4062 insertions(+), 3246 deletions(-) delete mode 100644 doc/context/documents/general/columnsets/columnsets.pdf create mode 100644 doc/context/documents/general/manuals/columnsets.pdf create mode 100644 doc/context/documents/general/manuals/math-mkiv.pdf delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-000.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-001.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-002.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-003.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-004.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-005.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-006.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-007.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-101.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-102.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-103.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-201.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-202.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-203.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-204.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-205.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-206.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-301.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-401.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-402.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-403.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-404.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-405.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-601.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-701.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-702.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-703.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-704.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-801.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-802.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-803.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-804.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-805.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-806.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-901.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-902.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets-903.tex delete mode 100644 doc/context/sources/general/columnsets/columnsets/columnsets.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-000.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-001.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-002.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-003.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-004.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-005.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-006.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-007.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-101.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-102.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-103.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-201.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-202.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-203.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-204.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-205.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-206.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-301.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-401.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-402.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-403.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-404.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-405.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-601.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-701.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-702.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-703.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-704.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-801.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-802.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-803.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-804.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-805.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-806.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-901.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-902.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets-903.tex create mode 100644 doc/context/sources/general/manuals/columnsets/columnsets.tex create mode 100644 doc/context/sources/general/manuals/math/math-mkiv.tex delete mode 100644 tex/context/base/mkiv/font-gds.lua create mode 100644 tex/context/base/mkiv/good-ctx.lua create mode 100644 tex/context/base/mkiv/good-gen.lua create mode 100644 tex/context/base/mkiv/good-ini.lua create mode 100644 tex/context/base/mkiv/good-mth.lua diff --git a/doc/context/documents/general/columnsets/columnsets.pdf b/doc/context/documents/general/columnsets/columnsets.pdf deleted file mode 100644 index 0d4e862f1..000000000 Binary files a/doc/context/documents/general/columnsets/columnsets.pdf and /dev/null differ diff --git a/doc/context/documents/general/manuals/columnsets.pdf b/doc/context/documents/general/manuals/columnsets.pdf new file mode 100644 index 000000000..0d4e862f1 Binary files /dev/null and b/doc/context/documents/general/manuals/columnsets.pdf differ diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf index 8a178e0b2..b727209ef 100644 Binary files a/doc/context/documents/general/manuals/luatex.pdf and b/doc/context/documents/general/manuals/luatex.pdf differ diff --git a/doc/context/documents/general/manuals/math-mkiv.pdf b/doc/context/documents/general/manuals/math-mkiv.pdf new file mode 100644 index 000000000..eed4d598e Binary files /dev/null and b/doc/context/documents/general/manuals/math-mkiv.pdf differ diff --git a/doc/context/documents/general/manuals/spacing-mkiv.pdf b/doc/context/documents/general/manuals/spacing-mkiv.pdf index c717e6abf..1f0057f1d 100644 Binary files a/doc/context/documents/general/manuals/spacing-mkiv.pdf and b/doc/context/documents/general/manuals/spacing-mkiv.pdf differ diff --git a/doc/context/documents/general/manuals/xml-mkiv.pdf b/doc/context/documents/general/manuals/xml-mkiv.pdf index 7305fb7a8..932b4cbaf 100644 Binary files a/doc/context/documents/general/manuals/xml-mkiv.pdf and b/doc/context/documents/general/manuals/xml-mkiv.pdf differ diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-000.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-000.tex deleted file mode 100644 index 429a067de..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-000.tex +++ /dev/null @@ -1,63 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\usemodule[visual] -\usemodule[simulate] - -\dontcomplain - -\startenvironment columnsets-000 - -\useMPlibrary[dum] - -\setupbodyfont - [palatino] - -\setuplayout - [grid=yes] - -\setuplayout - [backspace=20mm, - cutspace=15mm, - width=middle, - height=middle] - -\setupsystem - [random=1234] - -\setuppagenumbering - [alternative=doublesided, - location=] - -\setupheadertexts - [pagenumber][right] - [left][pagenumber] - -\setupfootertexts - [\inputfilename] - -\setupfooter - [style=\tttf] - -\setuptolerance - [verytolerant,stretch] - -\definecolor[color-1][.5(red,green)] -\definecolor[color-2][.5(green,blue)] -\definecolor[color-3][.5(blue,red)] -\definecolor[color-4][.5(white,black)] -\definecolor[color-5][.5(white,color-4)] - -\startuniqueMPgraphic{frame} - fill OverlayBox withcolor \MPcolor{color-1} ; -\stopuniqueMPgraphic - -\startuniqueMPgraphic{contrast} - fill OverlayBox withcolor \MPcolor{color-3} ; -\stopuniqueMPgraphic - -\defineoverlay[frame] [\uniqueMPgraphic{frame}] -\defineoverlay[contrast][\uniqueMPgraphic{contrast}] - -\stopenvironment diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-001.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-001.tex deleted file mode 100644 index 689f4e044..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-001.tex +++ /dev/null @@ -1,17 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=2] - -\starttext - -\startcolumnset[example] - - \dorecurse{20}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-002.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-002.tex deleted file mode 100644 index a67dd3161..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-002.tex +++ /dev/null @@ -1,17 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][nleft=3,nright=2,width=5cm] - -\starttext - -\startcolumnset[example] - - \dorecurse{15}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-003.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-003.tex deleted file mode 100644 index eed0286f8..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-003.tex +++ /dev/null @@ -1,35 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=2,page=left] - -\setupbackgrounds[text][background=color,backgroundcolor=color-1] - -\setupcolumnsetstart[example][1][1][2] -\setupcolumnsetstart[example][1][2][4] -\setupcolumnsetstart[example][2][1][6] -\setupcolumnsetstart[example][2][2][6] -\setupcolumnsetstart[example][3][1][4] -\setupcolumnsetstart[example][3][2][2] - -\setupcolumnsetlines[example][1][1][-2] -\setupcolumnsetlines[example][1][2][-4] -\setupcolumnsetlines[example][2][1][-6] -\setupcolumnsetlines[example][2][2][-6] -\setupcolumnsetlines[example][3][1][-4] -\setupcolumnsetlines[example][3][2][-2] -\setupcolumnsetlines[example][4][1][4] -\setupcolumnsetlines[example][4][2][10] - -\starttext - -\startcolumnset[example] - - \dorecurse{20}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-004.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-004.tex deleted file mode 100644 index a58ddf621..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-004.tex +++ /dev/null @@ -1,32 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left] - -\definecolor[fakerulecolor] - -\definecolumnsetspan[wide] [n=2,background=contrast,color=white] -\definecolumnsetspan[wider][n=4,background=contrast,color=white] - -\starttext - -\startcolumnset[example] - - \startcolumnsetspan[wider] - wider: \dorecurse{2}{#1: \fakewords{25}{50}\par} - \stopcolumnsetspan - - inbetween: \fakewords{25}{50}\par - - \startcolumnsetspan[wide] - wide : \dorecurse{2}{#1: \fakewords{25}{50}\par} - \stopcolumnsetspan - - after: \dorecurse{15}{#1: \fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-005.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-005.tex deleted file mode 100644 index f1d970d9e..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-005.tex +++ /dev/null @@ -1,29 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left] - -\definecolumnsetspan[wide][n=2,background=contrast,color=white] - -\definecolor[fakerulecolor] - -\starttext - -\startcolumnset[example] - - \startcolumnsetspan[wide][default=btlr] - - \startsimplecolumns - \dorecurse{2}{\fakewords{25}{40}\par} - \stopsimplecolumns - - \stopcolumnsetspan - - \dorecurse{15}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-006.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-006.tex deleted file mode 100644 index 033619970..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-006.tex +++ /dev/null @@ -1,35 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left] - -\definecolor[fakerulecolor] - -\definecolumnsetspan[wide][n=2,background=contrast,color=white] - -\starttext - -\startcolumnset[example] - - \startcolumnsetspan[wide] - \fakewords{25}{50} - \stopcolumnsetspan - - \fakewords{25}{50} - - \startcolumnsetspan[wide] - \fakewords{25}{50} - \stopcolumnsetspan - - \startcolumnsetspan[wide][default=btrl] - \fakewords{25}{50} - \stopcolumnsetspan - - \dorecurse{15}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-007.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-007.tex deleted file mode 100644 index 137a414d9..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-007.tex +++ /dev/null @@ -1,43 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left] - -\definecolor[fakerulecolor] - -\definecolumnsetspan[wide][n=2,background=contrast,color=white] - -\starttext - -\startbuffer - - \startcolumnsetspan[wide] - \fakewords{25}{50} - \stopcolumnsetspan - - \fakewords{25}{50} - - \startcolumnsetspan[wide] - \fakewords{25}{50} - \stopcolumnsetspan - - \startcolumnsetspan[wide][default=btrl] - \fakewords{25}{50} - \stopcolumnsetspan - - \dorecurse{3}{\fakewords{100}{200}\par} - -\stopbuffer - -\startcolumnset[example] - - \dorecurse{4}{\getbuffer} - - \dorecurse{5}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-101.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-101.tex deleted file mode 100644 index f9c7b59cb..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-101.tex +++ /dev/null @@ -1,30 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\starttext - -\startbuffer -\fakewords{100}{200} -\placefigure - {} - {\externalfigure[placeholder][width=\columnsetspanwidth{1}]} -\fakewords{100}{200} -\placefigure - {} - {\externalfigure[placeholder][width=\columnsetspanwidth{2}]} -\fakewords{100}{200} -\stopbuffer - -\startcolumnset[example] - - \dorecurse {5}{\getbuffer} - \dorecurse{10}{\fakewords{100}{200}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-102.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-102.tex deleted file mode 100644 index 3cf4dcd0e..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-102.tex +++ /dev/null @@ -1,36 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\starttext - -\startbuffer -\placefigure [tbrl] - {tblr} - {\externalfigure[fake][width=\columnsetspanwidth{1},lines=5]} -\placefigure [fxtb:6*4] - {fxtb} - {\externalfigure[fake][width=\columnsetspanwidth{2},lines=5]} -\placefigure [btlr] - {btlr} - {\externalfigure[fake][width=\columnsetspanwidth{2},lines=5]} -\placefigure [btlr] - {btlr} - {\externalfigure[fake][width=\columnsetspanwidth{3},lines=5]} - -\dorecurse {5} { - \fakewords{100}{200}\par -} -\stopbuffer - -\startcolumnset[example] - - \dorecurse{6}{\getbuffer} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-103.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-103.tex deleted file mode 100644 index f1d4dbedc..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-103.tex +++ /dev/null @@ -1,37 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\starttext - -\startcolumnset[example] - -\useexternalfigure[fake][fake][width=\textwidth,lines=3] - -\placefigure[btlr]{brlr}{\externalfigure[fake]} -\placefigure[btlr]{brlr}{\externalfigure[fake]} -\placefigure[btrl]{btrl}{\externalfigure[fake]} -\placefigure[btrl]{btrl}{\externalfigure[fake]} -\placefigure[tblr]{tblr}{\externalfigure[fake]} -\placefigure[tblr]{tblr}{\externalfigure[fake]} -\placefigure[tbrl]{tbrl}{\externalfigure[fake]} -\placefigure[tbrl]{tbrl}{\externalfigure[fake]} - -\placefigure[lrbt]{lrbt}{\externalfigure[fake]} -\placefigure[lrbt]{lrbt}{\externalfigure[fake]} -\placefigure[lrtb]{lrtb}{\externalfigure[fake]} -\placefigure[lrtb]{lrtb}{\externalfigure[fake]} -\placefigure[rlbt]{rlbt}{\externalfigure[fake]} -\placefigure[rlbt]{rlbt}{\externalfigure[fake]} -\placefigure[rltb]{rltb}{\externalfigure[fake]} -\placefigure[rltb]{rltb}{\externalfigure[fake]} - -\dorecurse{10}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-201.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-201.tex deleted file mode 100644 index 37b26c391..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-201.tex +++ /dev/null @@ -1,31 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [one] - [type=both, - x=1,y=1,nx=2,ny=6, - background=contrast, - state=repeat] - -\definecolumnsetarea - [two] - [type=both, - x=4,y=10,nx=1,ny=6, - background=contrast, - state=repeat] - -\starttext - -\startcolumnset[example] - - \dorecurse{40}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-202.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-202.tex deleted file mode 100644 index 1721d9cbc..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-202.tex +++ /dev/null @@ -1,32 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [one][left] - [x=1,y=1,nx=2,ny=6, - background=contrast,state=repeat] - -\definecolumnsetarea - [two][right] - [x=3,y=1,nx=2,ny=6, - background=contrast,state=repeat] - -\definecolumnsetarea - [three][both] - [x=2,y=10,nx=2,ny=6, - background=contrast,state=repeat] - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{\fakewords{50}{100}} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-203.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-203.tex deleted file mode 100644 index 6c15578bc..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-203.tex +++ /dev/null @@ -1,29 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [one]% [left] - [x=1,y=1,nx=6,ny=6, - background=contrast,state=start] - -\definecolumnsetarea - [two]%[left] - [x=3,y=10,nx=4,ny=6, - background=contrast,state=start] - -\stopsetups - -\starttext - -\startcolumnset[example] - - \dorecurse{25}{\fakewords{50}{100}} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-204.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-204.tex deleted file mode 100644 index d390f468e..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-204.tex +++ /dev/null @@ -1,41 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\usemodule[oldfun] - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [title] - [x=1,y=1,nx=8,ny=8, - background=contrast, - color=white, - align={lohi,right}, - state=start] - -\setupcolumnsetareatext - [title] - [\setups{the title}] - -\startsetups[the title] - - \GapText - {\dimexpr\makeupwidth+\backspace\relax} - {6pt} - {RegularBold*default} {sa 4} - {A Title Spanni\+ng 2 Pages} - -\stopsetups - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-205.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-205.tex deleted file mode 100644 index b53709770..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-205.tex +++ /dev/null @@ -1,42 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\usemodule[oldfun] - -\environment columnsets-000 - -\unprotected \def\SpreadGapText#1#2{{\def\+{\blackrule[\c!width=#1]}#2}} - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [title] - [x=1,y=1,nx=8,ny=8, - background=contrast, - color=white, - align={lohi,right}, - state=start] - -\setupcolumnsetareatext - [title] - [\setups{the title}] - -\startsetups[the title] - - \GapText - {\dimexpr(\makeupwidth+\backspace)} {6pt} - {RegularBold} {sa 4} - {A Title Spanni\+ng 2 Pages} - -\stopsetups - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-206.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-206.tex deleted file mode 100644 index 8b9f524b1..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-206.tex +++ /dev/null @@ -1,29 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [first] - [x=2,y=4,nx=2,ny=8, - background=contrast, - state=start] - -\definecolumnsetarea - [second] - [x=1,y=20,nx=1,ny=3, - background=contrast, - state=start] - -\starttext - -\startcolumnset[example] - - \dorecurse{50}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-301.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-301.tex deleted file mode 100644 index 4d21f2b02..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-301.tex +++ /dev/null @@ -1,29 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4] - -\starttext - -\startcolumnset[example] - - 1: \fakewords{50}{75} \column - 2: [] \fakewords{50}{75} \column[yes] - 3: [yes] \fakewords{50}{75} \column[page] - \column[page] % redundant - 4: [page] \fakewords{50}{75} \column[3] - 5: [3] \fakewords{50}{75} \column[4] - 6: [4] \fakewords{50}{75} \column[first] - 7: [first] \fakewords{50}{75} \column[last] - 8: [last] \fakewords{50}{75} \page - 9: (page) \fakewords{50}{75} \page - \page % redundant - 10: (page) \fakewords{50}{75} \column[3*5] - 11: [3*5] \fakewords{50}{75} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-401.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-401.tex deleted file mode 100644 index ee91e608c..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-401.tex +++ /dev/null @@ -1,26 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\setupbackgrounds[text][text][background=contrast] - -\definecolor[fakerulecolor][white] - -\setupcolumnset[example:2][distance=36pt] -\setupcolumnset[example:3][distance=72pt] -\setupcolumnset[example:4][distance=24pt] -\setupcolumnset[example:5][distance=48pt] - -\starttext - -\startcolumnset[example] - - \dorecurse{25}{\fakewords{100}{150}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-402.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-402.tex deleted file mode 100644 index 00db6017c..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-402.tex +++ /dev/null @@ -1,24 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\setupbackgrounds[text][text][background=contrast] - -\setupcolumnset[example] [distance=24pt] -\setupcolumnset[example:1][distance=96pt] - -\definecolor[fakerulecolor][white] - -\starttext - -\startcolumnset[example] - - \dorecurse{25}{\fakewords{100}{150}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-403.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-403.tex deleted file mode 100644 index c9bc2e648..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-403.tex +++ /dev/null @@ -1,23 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\setupbackgrounds[text][text][background=contrast] - -\definecolor[fakerulecolor][white] - -\setupcolumnset[example][width=.15\makeupwidth] - -\starttext - -\startcolumnset[example] - - \dorecurse{25}{\fakewords{100}{150}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-404.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-404.tex deleted file mode 100644 index 05a25acfe..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-404.tex +++ /dev/null @@ -1,34 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left] - -\setupbackgrounds[text][text][background=contrast] - -\setupcolumnset[frame=on,framecolor=color-4,rulethickness=1mm] - -\definecolor[fakerulecolor][white] - -\setupcolumnset[example:1][width=2cm] -\setupcolumnset[example:2][width=4cm] -\setupcolumnset[example:3][width=3cm] - -\setupcolumnset[example:4][width=3cm] -\setupcolumnset[example:5][width=4cm] -\setupcolumnset[example:6][width=6cm] - -\starttext - -\startcolumnset[example] - -\dorecurse{15}{ - \dorecurse{3}{\fakewords{10}{15}\par} - \column[yes] -} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-405.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-405.tex deleted file mode 100644 index fa20ef34c..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-405.tex +++ /dev/null @@ -1,29 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\setupbackgrounds[text][text][background=contrast] - -\setupcolumnset[frame=on,framecolor=color-4,rulethickness=1mm] - -\definecolor[fakerulecolor][white] - -\setupcolumnset[example:1][width=.3\makeupwidth] - -\starttext - -\startcolumnset[example] - - \fakewords{150}{150} - \column - \fakewords{25}{50} - - \dorecurse{25}{\fakewords{50}{75}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-601.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-601.tex deleted file mode 100644 index b139210f4..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-601.tex +++ /dev/null @@ -1,29 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left,direction=reverse] - -\setupbackgrounds[text][text][background=contrast] - -\definecolor[fakerulecolor][color-1] - -\starttext - -\startcolumnset[example] - - \dorecurse{50}{ - \dontleavehmode - \snaptogrid\hbox - {\scale[height=2.5\lineheight]{\color[white]{#1}}}% - \space - \fakewords{30}{60} - %\simulatewords[n=30,m=60,min=1,max=5,color=color-1,line=yes]\par - \par - } - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-701.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-701.tex deleted file mode 100644 index b2c50cfaf..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-701.tex +++ /dev/null @@ -1,23 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\setupcolumnset - [example] - [background=contrast] - -\definecolor[fakerulecolor][white] - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-702.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-702.tex deleted file mode 100644 index 5b9a879c1..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-702.tex +++ /dev/null @@ -1,27 +0,0 @@ -content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\setupcolumnset - [example] - [background=contrast, - backgroundoffset=4pt, - frame=on, - framecolor=white, - rulethickness=2pt] - -\definecolor[fakerulecolor][white] - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-703.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-703.tex deleted file mode 100644 index 549b49f61..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-703.tex +++ /dev/null @@ -1,34 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=4,page=left] - -\definecolumnsetarea - [title][left] - [x=1,y=1,nx=8,ny=8, - background=contrast,state=repeat] - -\setupcolumnsetareatext - [title][left][\setups{cow}] - -\startsetups[cow] - - \externalfigure - [cow.pdf] - [height=15\lineheight, - width=2\dimexpr\makeupwidth+\backspace\relax] - -\stopsetups - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{\fakewords{50}{100}\par} - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-704.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-704.tex deleted file mode 100644 index 7fa6cb313..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-704.tex +++ /dev/null @@ -1,69 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\startuseMPgraphic{mpos:par:columns} - path p ; numeric h ; - for i=1 upto nofmultipars : - p := multipars[i] ; - h := bbheight(p) ; - if multikind[i] = "single" : - fill p topenlarged -.5h - withshademethod "linear" - withshadedirection shadedup - withcolor \MPcolor{color-1} shadedinto white ; - fill p bottomenlarged -.5h - withshademethod "linear" - withshadedirection shadedup - withcolor white shadedinto \MPcolor{color-1} ; - elseif multikind[i] = "first" : - fill p - withshademethod "linear" - withshadedirection shadedup - withcolor \MPcolor{color-2} shadedinto white ; - elseif multikind[i] = "middle" : - fill p topenlarged -.5h - withshademethod "linear" - withshadedirection shadedup - withcolor \MPcolor{color-2} shadedinto white ; - fill p bottomenlarged -.5h - withshademethod "linear" - withshadedirection shadedup - withcolor white shadedinto \MPcolor{color-3} ; - elseif multikind[i] = "last" : - fill p - withshademethod "linear" - withshadedirection shadedup - withcolor white shadedinto \MPcolor{color-3} ; - fi ; - endfor ; -\stopuseMPgraphic - -\definecolumnset - [example] - [n=4, - page=left] - -\definetextbackground - [shade] - [location=paragraph, - mp=mpos:par:columns, - before=\blank, - after=\blank] - -\starttext - -\startcolumnset[example] - - \dorecurse {40} { - \starttextbackground[shade] - \fakewords{10}{200} - \stoptextbackground - \par - } - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-801.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-801.tex deleted file mode 100644 index 1a84f99ab..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-801.tex +++ /dev/null @@ -1,19 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset [example-1] [n=2] -\definecolumnset [example-2] [n=3] - -\starttext \showgrid - - \startcolumnset [example-1] - \dorecurse {1}{\input tufte \par} - \stopcolumnset - \startcolumnset [example-2] - \dorecurse {2}{\input ward \par} - \stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-802.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-802.tex deleted file mode 100644 index a126d0012..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-802.tex +++ /dev/null @@ -1,22 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset [example-1] [n=2,balance=yes] -\definecolumnset [example-2] [n=3,balance=yes] - -\starttext \showgrid - - \setupcolumnsetlines[example-1][1][1] [8] - \setupcolumnsetlines[example-1][1][2][10] - - \startcolumnset [example-1] - \dorecurse {1}{\input tufte \par} - \stopcolumnset - \startcolumnset [example-2] - \dorecurse {2}{\input ward \par} - \stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-803.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-803.tex deleted file mode 100644 index 58a278bb1..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-803.tex +++ /dev/null @@ -1,26 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset [example-1] [n=2,balance=yes] -\definecolumnset [example-2] [n=3,balance=yes] - -\starttext \showgrid - - \setupcolumnsetlines[example-1][1][1] [8] - \setupcolumnsetlines[example-1][1][2][10] - - \setupcolumnsetlines[example-2][1][1][19] - \setupcolumnsetlines[example-2][1][2][18] - \setupcolumnsetlines[example-2][1][3][19] - - \startcolumnset [example-1] - \dorecurse {1}{\input tufte \par} - \stopcolumnset - \startcolumnset [example-2] - \dorecurse {2}{\input ward \par} - \stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-804.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-804.tex deleted file mode 100644 index c2b7a6b1e..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-804.tex +++ /dev/null @@ -1,26 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset [example-1] [n=2,balance=yes] -\definecolumnset [example-2] [n=3,balance=yes] - -\starttext \showgrid - - \setupcolumnsetlines[example-1][1][1] [8] - \setupcolumnsetlines[example-1][1][2][10] - - \setupcolumnsetlines[example-2][1][1] [0] - \setupcolumnsetlines[example-2][1][2][-2] - \setupcolumnsetlines[example-2][1][3] [0] - - \startcolumnset [example-1] - \dorecurse {1}{\input tufte \par} - \stopcolumnset - \startcolumnset [example-2] - \dorecurse {6}{\input ward \par} - \stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-805.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-805.tex deleted file mode 100644 index fc80e7e9c..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-805.tex +++ /dev/null @@ -1,26 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset [example-1] [n=2,balance=yes] -\definecolumnset [example-2] [n=3,balance=yes] - -\starttext \showgrid - - \setupcolumnsetlines[example-1][1][1] [8] - \setupcolumnsetlines[example-1][1][2][10] - - \setupcolumnsetstart[example-2][1][1][19] - \setupcolumnsetstart[example-2][1][2][17] - \setupcolumnsetstart[example-2][1][3][19] - - \startcolumnset [example-1] - \dorecurse {1}{\input tufte \par} - \stopcolumnset - \startcolumnset [example-2] - \dorecurse {2}{\input ward \par} - \stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-806.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-806.tex deleted file mode 100644 index 0322a336f..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-806.tex +++ /dev/null @@ -1,26 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset [example-1] [n=2,balance=yes] -\definecolumnset [example-2] [n=3,balance=yes] - -\starttext \showgrid - - \setupcolumnsetlines[example-1][1][1] [8] - \setupcolumnsetlines[example-1][1][2][10] - - \setupcolumnsetstart[example-2][1][1][29] - \setupcolumnsetstart[example-2][1][2][29] - \setupcolumnsetstart[example-2][1][3][29] - - \startcolumnset [example-1] - \dorecurse {1}{\input tufte \par} - \stopcolumnset - \startcolumnset [example-2] - \dorecurse {2}{\input ward \par} - \stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-901.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-901.tex deleted file mode 100644 index 300458bf5..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-901.tex +++ /dev/null @@ -1,38 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=2,page=left,distance=1cm] - -\setupcolumnset - [example] - [background=contrast] - -\definecolor[fakerulecolor][white] \faketriggertrue - -\setuphead - [section] - [style=\bfd] - -\setuplinenumbering - [style=bold, - distance=0pt, - align=inner] - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{ - \startsection[title=foo #1] - \startlinenumbering - \fakewords{50}{100}\par - \stoplinenumbering - \stopsection - } - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-902.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-902.tex deleted file mode 100644 index fda2969af..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-902.tex +++ /dev/null @@ -1,38 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left,distance=1cm] - -\setupcolumnset - [example] - [background=contrast] - -\definecolor[fakerulecolor][white] \faketriggertrue - -\setuphead - [section] - [style=\bfd] - -\setuplinenumbering - [style=bold, - distance=0pt, - align=inner] - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{ - \startsection[title=foo #1] - \startlinenumbering - \fakewords{50}{100}\par - \stoplinenumbering - \stopsection - } - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets-903.tex b/doc/context/sources/general/columnsets/columnsets/columnsets-903.tex deleted file mode 100644 index 68cd31ae2..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets-903.tex +++ /dev/null @@ -1,41 +0,0 @@ -% content=tex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\environment columnsets-000 - -\definecolumnset[example][n=3,page=left,distance=1cm] - -\setupcolumnset - [example] - [background=contrast] - -\definecolor[fakerulecolor][white] \faketriggertrue - -\setupblank - [line] - -\setuphead - [section] - [style=\bfd] - -\setuplinenumbering - [style=bold, - distance=0pt, - align=inner] - -\starttext - -\startcolumnset[example] - - \dorecurse{30}{ - \startsection[title=foo #1] - \startlinenumbering - \fakewords{50}{100}\par - \stoplinenumbering - \stopsection - } - -\stopcolumnset - -\stoptext diff --git a/doc/context/sources/general/columnsets/columnsets/columnsets.tex b/doc/context/sources/general/columnsets/columnsets/columnsets.tex deleted file mode 100644 index 7d68872ef..000000000 --- a/doc/context/sources/general/columnsets/columnsets/columnsets.tex +++ /dev/null @@ -1,873 +0,0 @@ -% engine=luatex -% -% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa - -\dontcomplain - -\definepagebreak[mine][yes] - -% A complete otf optima pack is too expensive for this (I only have the -% type one set). -% -% \usetypescriptfile -% [type-ghz] -% -% \usetypescript -% [sans] -% [optima-nova] -% -% \setupbodyfont -% [optima-nova,11pt] -% -% \definefont[QuiteLarge][SansBold sa 3] -% \definefont[NotSoLarge][SansBold sa 1.5] -% -% So we could use: -% -% \setupbodyfont -% [pagella,11pt] -% -% \definefont[QuiteLarge][Bold sa 2.50] -% \definefont[NotSoLarge][Bold sa 1.25] -% -% But this one has a matching sans: - -\setupbodyfont - [dejavu,11pt] - -\definefont[QuiteLarge][SansBold sa 2.50] -\definefont[NotSoLarge][SansBold sa 1.25] - -\setuplayout - [backspace=.1\paperwidth, - topspace=.025\paperheight, - header=0.025\paperheight, - footer=0.025\paperheight, - headerdistance=0.025\paperheight, - footerdistance=0.025\paperheight, - width=middle, - height=middle] - -\setuppagenumbering - [alternative=doublesided, - location=] - -\setupwhitespace - [line] - -\setupblank - [line] - -\setuptyping - [blank=halfline] - -\startsetups [pagenumber] - \hbox to .2\paperwidth { - \hss - Page \pagenumber - \hss - } -\stopsetups - -\setupfooter [before=\vfill,after=\vfill,style=\bf,color=color-4] -\setupheader [before=\vfill,after=\vfill,style=\bf,color=color-4] - -\setupfootertexts [] [\setups{pagenumber}] -\setupheadertexts [] [\setups{chapterhead}] - -\startsetups [chapterhead] - \hbox to .2\paperwidth { - \hss - \getmarking[chapter] - \hss - } -\stopsetups - -\setuphead - [chapter] - [header=empty] - -\definecolor[color-1][.5(red,green)] -\definecolor[color-2][.5(green,blue)] -\definecolor[color-3][.5(blue,red)] -\definecolor[color-4][.5(white,black)] -\definecolor[color-5][.5(white,color-4)] -\definecolor[color-6][.2(white,color-4)] - -\startuseMPgraphic{page} -StartPage ; - path p ; - numeric n; n := PageNumber ; - numeric w; w := bbwidth(Page) ; - numeric h; h := bbheight(Page) ; - def DrawBit (expr bit, dx, dy) = - path p ; p := unitsquare xyscaled(w/5,h/40) shifted (dx*w/10,dy*(h-h/40)) ; - if n div bit > 0 : - n := n - (n div bit)*bit ; - fill p withcolor \MPcolor{color-1} ; - else : - fill p withcolor \MPcolor{color-2} ; - fi ; - enddef ; - DrawBit(32,7,1) ; - DrawBit(16,4,1) ; - DrawBit( 8,1,1) ; - DrawBit( 4,7,0) ; - DrawBit( 2,4,0) ; - DrawBit( 1,1,0) ; -StopPage ; -\stopuseMPgraphic - -\startuniqueMPgraphic{frame} - fill OverlayBox withcolor \MPcolor{color-5} ; -\stopuniqueMPgraphic - -\startuniqueMPgraphic{contrast} - fill OverlayBox withcolor \MPcolor{color-4} ; -\stopuniqueMPgraphic - -\defineoverlay[page] [\useMPgraphic{page}] -\defineoverlay[frame] [\useMPgraphic{frame}] -\defineoverlay[contrast][\useMPgraphic{contrast}] - -\setupexternalfigures - [background=frame] - -\definecombination - [sixpages] - [%inbetween=\blank, - style=mono, - distance=.5\bodyfontsize, - width=\textwidth] - -\definecombination - [fourpages] - [%inbetween=\blank, - style=mono, - distance=.5\bodyfontsize, - width=\textwidth] - -\definecombination - [twopages] - [style=mono] - -\definemeasure[twopages] [\dimexpr\dimexpr\textwidth-3 \bodyfontsize\relax/4\relax] -\definemeasure[fourpages] [\dimexpr\dimexpr\textwidth-3 \bodyfontsize\relax/4\relax] -\definemeasure[eightpages][\dimexpr\dimexpr\textwidth-3 \bodyfontsize\relax/4\relax] -\definemeasure[sixpages] [\dimexpr\dimexpr\textwidth-2.5\bodyfontsize\relax/6\relax] - -\starttexdefinition unexpanded OnePage #1 - \startlinecorrection[blank] - \startcombination[twopages][1*1] - {\typesetfile[#1.tex][page=1,lines=15]} {1} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded OneSpread #1 - \startlinecorrection[blank] - \startcombination[twopages][1*1] - {\typesetfile[#1.tex][page=2,lines=15]} {2} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded TwoPages #1 - \startlinecorrection[blank] - \startcombination[twopages][2*1] - {\typesetfile[#1.tex][page=1,width=\measure{twopages}]} {1} - {\typesetfile[#1.tex][page=2,width=\measure{twopages}]} {2} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded TwoSpread #1 - \startlinecorrection[blank] - \startcombination[twopages][2*1] - {\typesetfile[#1.tex][page=2,width=\measure{twopages}]} {2} - {\typesetfile[#1.tex][page=3,width=\measure{twopages}]} {3} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded FourPages #1 - \startlinecorrection[blank] - \startcombination[fourpages][4*1] - {\typesetfile[#1.tex][page=1,width=\measure{fourpages}]} {1} - {\typesetfile[#1.tex][page=2,width=\measure{fourpages}]} {2} - {\typesetfile[#1.tex][page=3,width=\measure{fourpages}]} {3} - {\typesetfile[#1.tex][page=4,width=\measure{fourpages}]} {4} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded FourSpread #1 - \startlinecorrection[blank] - \startcombination[fourpages][4*1] - {\typesetfile[#1.tex][page=2,width=\measure{fourpages}]} {2} - {\typesetfile[#1.tex][page=3,width=\measure{fourpages}]} {3} - {\typesetfile[#1.tex][page=4,width=\measure{fourpages}]} {4} - {\typesetfile[#1.tex][page=5,width=\measure{fourpages}]} {5} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded SixPages #1 - \startlinecorrection[blank] - \startcombination[sixpages][6*1] - {\typesetfile[#1.tex][page=1,width=\measure{sixpages}]} {1} - {\typesetfile[#1.tex][page=2,width=\measure{sixpages}]} {2} - {\typesetfile[#1.tex][page=3,width=\measure{sixpages}]} {3} - {\typesetfile[#1.tex][page=4,width=\measure{sixpages}]} {4} - {\typesetfile[#1.tex][page=5,width=\measure{sixpages}]} {5} - {\typesetfile[#1.tex][page=6,width=\measure{sixpages}]} {6} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded SixSpread #1 - \startlinecorrection[blank] - \startcombination[sixpages][6*1] - {\typesetfile[#1.tex][page=2,width=\measure{sixpages}]} {2} - {\typesetfile[#1.tex][page=3,width=\measure{sixpages}]} {3} - {\typesetfile[#1.tex][page=4,width=\measure{sixpages}]} {4} - {\typesetfile[#1.tex][page=5,width=\measure{sixpages}]} {5} - {\typesetfile[#1.tex][page=6,width=\measure{sixpages}]} {6} - {\typesetfile[#1.tex][page=7,width=\measure{sixpages}]} {7} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded EightPages #1 - \startlinecorrection[blank] - \startcombination[fourpages][4*2] - {\typesetfile[#1.tex][page=1,width=\measure{eightpages}]} {#1 / 1} - {\typesetfile[#1.tex][page=2,width=\measure{eightpages}]} {#1 / 2} - {\typesetfile[#1.tex][page=3,width=\measure{eightpages}]} {#1 / 3} - {\typesetfile[#1.tex][page=4,width=\measure{eightpages}]} {#1 / 4} - {\typesetfile[#1.tex][page=5,width=\measure{eightpages}]} {#1 / 5} - {\typesetfile[#1.tex][page=6,width=\measure{eightpages}]} {#1 / 6} - {\typesetfile[#1.tex][page=7,width=\measure{eightpages}]} {#1 / 7} - {\typesetfile[#1.tex][page=8,width=\measure{eightpages}]} {#1 / 8} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\starttexdefinition unexpanded EightSpread #1 - \startlinecorrection[blank] - \startcombination[fourpages][4*2] - {\typesetfile[#1.tex][page=2,width=\measure{eightpages}]} {#1 / 2} - {\typesetfile[#1.tex][page=3,width=\measure{eightpages}]} {#1 / 3} - {\typesetfile[#1.tex][page=4,width=\measure{eightpages}]} {#1 / 4} - {\typesetfile[#1.tex][page=5,width=\measure{eightpages}]} {#1 / 5} - {\typesetfile[#1.tex][page=6,width=\measure{eightpages}]} {#1 / 6} - {\typesetfile[#1.tex][page=7,width=\measure{eightpages}]} {#1 / 7} - {\typesetfile[#1.tex][page=8,width=\measure{eightpages}]} {#1 / 8} - {\typesetfile[#1.tex][page=9,width=\measure{eightpages}]} {#1 / 9} - \stopcombination - \stoplinecorrection -\stoptexdefinition - -\setuphead - [chapter] - [style=\QuiteLarge, - color=color-3, - number=no] - -\setuplist - [chapter] - [command=\MyListCommand, - alternative=command] - -\starttexdefinition unexpanded MyListCommand #1#2#3 - \snaptogrid - [line,-line]\vbox { - \tfb - \setstrut - \strut#2 - \quad#3 - } -\stoptexdefinition - -\setupmargindata - [style=\tttf, - color=color-3] - -\starttexdefinition unexpanded ShowFile #1 - \margintext - {\cldcontext{string.match("#1","\letterpercent d+")}} - \typefile - [range={environment}] - {#1} -\stoptexdefinition - -% \typefile[range=4] {...} -% \typefile[range={=}]{...} % start after comment lines - -\starttexdefinition unexpanded ShowEnvironmentFile #1 - \margintext - {\cldcontext{string.match("#1","\letterpercent d+")}} - \typefile - [range={=startenvironment}] - {#1} -\stoptexdefinition - -\startdocument - -\startMPpage -StartPage ; - path p ; numeric w, h, d ; picture q ; - if true : - q := image(draw textext.urt("\ssbf COLUMNS") withcolor \MPcolor{color-6}) ; - else : - q := image(draw textext.urt("\ssbf COLUMNSETS") withcolor \MPcolor{color-6}) ; - fi ; - w := bbwidth(Page) ; - h := bbheight(Page) ; - d := h/100 ; - fill Page withcolor \MPcolor{color-1} ; - p := Page xysized (w,d) ; - for i := 5d step 2d until h-5d : - fill p shifted (0,i) withcolor \MPcolor{color-2} ; - endfor - p := Page xysized(w/10,h) ; - for i = 0, .3, .6, .9 : - fill p shifted (i*w,0) withcolor \MPcolor{color-1} withtransparency(1,.75) ; - endfor ; - def do_it(expr sz, sh) = - p := Page xysized sz ; - fill p shifted sh withcolor \MPcolor{color-3} withtransparency(1,.5) ; - draw q xysized (bbwidth(p),bbheight(p)) shifted sh ; - enddef ; - if true : - do_it ((2w/10,17d),(.1w,20d)) ; - do_it ((2w/10,15d),(.1w,56d)) ; - do_it ((2w/10,21d),(.4w,66d)) ; - do_it ((2w/10,13d),(.7w,38d)) ; - do_it ((5w/10,13d),(.4w,13d)) ; - draw textext.urt("\ssbf Hans Hagen") - xysized (5w/10,5d) - shifted (.4w,6d) - withcolor \MPcolor{color-5} ; - else : - do_it ((2w/10,17d),(.1w,15d)) ; - do_it ((2w/10,15d),(.1w,51d)) ; - do_it ((2w/10,21d),(.4w,61d)) ; - do_it ((2w/10,13d),(.7w,31d)) ; - do_it ((5w/10,13d),(.4w, 7d)) ; - fi ; -StopPage ; -\stopMPpage - -\page[empty] \setuppagenumber[number=1] - -\setupbackgrounds - [page] - [background=page] - -\starttitle[title=Contents] - - \placelist[chapter] - -\stoptitle - -\startchapter[title=Introduction] - -This manual introduces {\em column sets}, one of the output routines of \CONTEXT. -Although column sets are mainly meant for typesetting journals in a -semi||automated way, you can also use them for books. We assume that the user is -familiar with \CONTEXT\ and only discuss the commands that are related to column -sets. - -This mechanism performs okay but it needs to be used with care: an occasional -manual intervention is needed to get optimal results. After all, we're operating -in the area where normally click and point desktop publishing is used. - -{\bf For the moment you need to load the new code with: \type{\usemodule[newcolumnsets]}} - -\startlines -Hans Hagen -PRAGMA ADE -Hasselt, 2003\endash2016 -\stoplines - -\stopchapter - -\startchapter[title=Basics] - -As soon as enough content is collected to build a page, \TEX\ will invoke the -output routine. This is not a fixed piece of code, but a collection of macro -calls. The default output routine is a meant for typesetting a single column, as -in this document. A multi||column output routine is available as well. This -routine mixes well with the single column one, and is activated by: - -\starttyping -\startcolumns -some text ... -\stopcolumns -\stoptyping - -In \MKIV\ a new mixed column mechanism has been introduced that will be -developped further and eventually replace the old multi column handler. In \MKII\ -there is also a columnset mechanism that can be used to construct complex multi -column pages. In \MKIV\ this gets replaced by grid columns. All these multi -column mechanisms have in common that the output routine is more complex because -now a page is in fact a collection of pages wrapped onto one. Each column is -(from \TEX's perspective) similar to a one narrow column page. Here we focus on -columnsets (page grids). - -There are some limitations to what you can do with this kind of multi columns, -which is why we have a third routine at out disposal: {\em column sets}. This -routine can be used for rather complex layouts with graphics all over the place, -and text spanning columns or even spreads. There are of course some shortcomings, -which we will discuss later. - -In the examples that follow we use the following style to set up the layout. The -number in the margin serves a reference to the file where this snippet of \TEX\ -is stored. - -\ShowEnvironmentFile{columnsets-000} - -\page[mine] - -Before we will demonstrate more complex layouts, we will introduce a few -features. In the next series of examples we use fake text. You can enlarge the -pages in your viewer if you want to see more detail. - -\FourSpread{columnsets-001} - -These pages were typeset with the following code: - -\ShowFile{columnsets-001} - -We will showmost examples on a spread, so we don't show a first page. On a -spread like above we number columns from~1 to~4, which in practice means that in -this case columns starting on right page start with column~3! - -\SixPages{columnsets-001} - -\page[mine] - -The number of columns is not fixed to two. You can even have a different number -of columns on left and right pages. - -\FourSpread{columnsets-002} - -This time the input is: - -\ShowFile{columnsets-002} - -Again, we started on a right page but showed the spreads. You can see it from the -positioning of the header texts. - -\SixPages{columnsets-002} - -\page[mine] - -In order to get the balancing you want, you can manually influence the height of -a column. - -\FourSpread{columnsets-003} - -When you set the number of column lines to a positive value, that will be the -number of lines. A negative value will be subtracted from the maximum number of -lines. - -\ShowFile{columnsets-003} - -\page[mine] - -In articles you may want to let the introduction span multiple columns. A column -span is defined independent of a column set and shows up as follows: - -\FourSpread{columnsets-004} - -Here we've given the span a background so that it stands out. - -\ShowFile{columnsets-004} - -\page[mine] - -A column span can be positioned like any graphic. Later we will discuss the -placement options in more detail, for the moment all you need to know is that -\type {btlr} tells \CONTEXT\ to place the graphic in the left bottom of the the -text area. - -\FourSpread{columnsets-005} - -Here we pass the \type {default} placement as parameter to the span, but you can -also set it at definition time. We use a brute force simple column splitter to -fake columns inside the span. - -\ShowFile{columnsets-005} - -\page[mine] - -You are not limited to one column span. In this sense a span is like a graphic: -as long as there is room, it will be placed where you want it to be placed. The -main difference between a span and a graphic is that a span expects text and -tries to align the baselines with the rest of the text. In many ways a column -span behaves like a framed text. - -\FourSpread{columnsets-006} - -This time we flushed one of the spans from bottom to top, starting at the right -edge: \type {btrl}. - -\ShowFile{columnsets-006} - -\page[mine] - -Column spans are treated like graphics, which means that they will float if -needed. In the process, the width is limited to the available space, which in -some cases may lead to a smaller span than you may expect. Think of a column -span, calculated (and prepared) in the last column and ending up on the next page -in the first column, where a broader span would have been possible. - -\FourSpread{columnsets-007} - -\ShowFile{columnsets-007} - -\stopchapter - -\startchapter[title=Graphics] - -Most documents have graphics, and therefore column sets can contain them. The -main thing that you have to keep in mind when placing graphics, is that column -sets are based on grids. Therefore spacing around graphics is also grid based. - -\FourSpread{columnsets-101} - -\ShowFile{columnsets-101} - -\page[mine] - -You can tell \CONTEXT\ where it should place the graphic, but this will only be -honored when there is still place. - -\EightSpread{columnsets-102} - -The prefered location is passed as a four character directive: - -\ShowFile{columnsets-102} - -\page[mine] - -The following directives are available: - -\starttabulate[|lT|p|] -\NC btlr \NC flush from bottom to top and left to right \NC \NR -\NC btrl \NC flush from bottom to top and right to left \NC \NR -\NC tblr \NC flush from top to bottom and left to right \NC \NR -\NC tbrl \NC flush from top to bottom and right to left \NC \NR -\NC lrbt \NC flush from left to right and bottom to top \NC \NR -\NC lrtb \NC flush from left to right and top to bottom \NC \NR -\NC rlbt \NC flush from right to left and bottom to top \NC \NR -\NC rltb \NC flush from right to left and top to bottom \NC \NR -\NC here \NC try to place the graphic here \NC \NR -\NC fixd \NC force the graphic here and don't float \NC \NR -\NC fxtb:c*r \NC place the graphic at (c,r) or lower if needed \NC \NR -\NC fxbt:c*r \NC place the graphic at (c,r) or higher if needed \NC \NR -\NC tops \NC place the graphic at the top of the page \NC \NR -\NC bots \NC place the graphic at the bottom of the page \NC \NR -\NC page \NC place the graphic at a separate page \NC \NR -\stoptabulate - -In the next example we show the directional locations: - -\OneSpread{columnsets-103} - -\ShowFile{columnsets-103} - -\stopchapter - -\startchapter[title=Areas] - -So far we have seen texts and graphics that span multiple columns using span -commands and floats placement commands. We have also seen that you can define a -different number of columns for left and right pages. Now that we have arrives at -column areas you will see how we can span information over not only a page but -also over pages in a spread. - -\FourSpread{columnsets-201} - -Being a framed text, by default an area is aligned at the baseline. You can lower -an area by setting the \type {location} to \type {depth}. - -\ShowFile{columnsets-201} - -\page[mine] - -You can position areas on the left, right or next page or on both pages. When you -set \type {state} to \type {repeat}, an area is repeated, otherwise it is only -placed once. - -\FourSpread{columnsets-202} - -Here we just repeat the areas. Normally this only make sense when the content is -worth repeating. - -\ShowFile{columnsets-202} - -\page[mine] - -Areas can span a spread, as is demonstrated in the next example. - -\FourSpread{columnsets-203} - -\ShowFile{columnsets-203} - -\page[mine] - -An application of a spread area is a title. In the next example we show two -spread pages. - -\FourSpread{columnsets-204} - -Watch how we explicitly go to a left page. - -\ShowFile{columnsets-204} - -\page[mine] - -The \type {\GapText} macro is an experimental fun macro and is used to make sure -that we don't end up with a clipped character. - -\startlinecorrection[blank] -\startcombination - {\scale[width=.4\textwidth]{\clip - [nx=2,ny=6,x=2,y=2] - {\typesetfile[columnsets-204.tex][page=2]}}} - {left page} - {\scale[width=.4\textwidth]{\clip - [nx=2,ny=6,x=1,y=2] - {\typesetfile[columnsets-204.tex][page=3]}}} - {right page} -\stopcombination -\stoplinecorrection - -This is a typical example of the kind of optimizations that are needed when you -make documents of styles with text that spans a spread. In the next clip we -visualize the gap. - -\startlinecorrection[blank] -\startcombination - {\scale[width=.4\textwidth]{\clip - [nx=2,ny=6,x=2,y=2] - {\typesetfile[columnsets-205.tex][page=2]}}} - {left page} - {\scale[width=.4\textwidth]{\clip - [nx=2,ny=6,x=1,y=2] - {\typesetfile[columnsets-205.tex][page=3]}}} - {right page} -\stopcombination -\stoplinecorrection - -At some moment you may want to set up an area in advance as we have done in the -following example. - -\FourSpread{columnsets-206} - -The \type {page} key is used to specify the page in the column set that the area -should go into. Column set pages start numbering at~1. The \type {fixed} stands -for left or right, whatever comes first. - -\ShowFile{columnsets-206} - -\stopchapter - -\startchapter[title=Columns] - -You can use \type {\page} to go to a new page in a column set. Likewise you can -use \type {\column} to force a column break. - -\FourPages{columnsets-301} - -This example demonstrates that you can supply \type {\column} with explicit -directives. - -\ShowFile{columnsets-301} - -You can use \type {\column[page]} as an alternative for \type {\page}. - -\stopchapter - -\startchapter[title=Details] - -This chapter will cover a couple of cosmetic details of column sets. {\em Some -features need to be improved, especially in combination with areas, graphics and -alike. We will also provide side floats etc.} - -\FourSpread{columnsets-401} - -You can set the distance between columns for each pair of columns. {\em Todo: -left and right page distances and margins.} - -\ShowFile{columnsets-401} - -\page[mine] - -When you can the distance of the first column as well. This creates a margin. - -\FourSpread{columnsets-402} - -This time we used equal distances: - -\ShowFile{columnsets-402} - -\page[mine] - -The width of columns is normally calculated automatically, but you can also set -the width explicitly: - -\FourSpread{columnsets-403} - -In code: - -\ShowFile{columnsets-403} - -\page[mine] - -For special effects, you can set the width per column. In that case you need to -be aware of the fact that \TEX\ works its way through the document per paragraph. -Changing the width halfway a paragraph is possible but will affect the whole -paragraph. Therefore, this feature works best when you also goto the next column -explicitly. - -\FourSpread{columnsets-404} - -In code: - -\ShowFile{columnsets-404} - -\page[mine] - -If you really want to change the width in the middle of a paragraph, you can do a -trial run and include a breakpoint at the palce where you want it to occur: - -\FourSpread{columnsets-405} - -In the second spread you see how the narrow hsize carries on in the wider -column. A \type {\column} command will synchronize the hsize. - -\ShowFile{columnsets-405} - -% \page[mine] - -\stopchapter - -\startchapter[title=Directions] - -\FourSpread{columnsets-601} - -The direction of flushing columns is determined by the \type {direction} -parameters as demonstrated below. - -\ShowFile{columnsets-601} - -% \page[mine] - -\stopchapter - -\startchapter[title=Backgrounds] - -As with many \CONTEXT\ components, column sets can have backgrounds. - -\FourSpread{columnsets-701} - -Watch how we use the \type {each} keyword to tell \CONTEXT\ that we want to apply -the background to each column of the set. - -\ShowFile{columnsets-701} - -\page[mine] - -Normally, if you apply backgrounds this way, you will also set the background -offset. In a similar fashion you can apply backgrounds to areas and spans. Such -backgrounds can be a color, or any overlay or layer you want. - -\FourSpread{columnsets-702} - -Here we've set the background offset as well as the frame. - -\ShowFile{columnsets-702} - -\page[mine] - -When dealing with areas, you need to be aware of the fact that they are clipped, -the content as well as the background. - -\FourSpread{columnsets-703} - -De default clip offset is two times the lineheight, except in the binding, where -it is set to zero points. You can set the clip offset with the \type {clipoffset} -parameter. - -\ShowFile{columnsets-703} - -\page[mine] - -The text background mechanism is rather well adapted to column sets. The -following example is a variant on an example shown in the manual titled -{details}. - -\EightSpread{columnsets-704} - -Watch how we adapt the background to the fact and extent that the text spans one -or more columns. - -\ShowFile{columnsets-704} - -Backgrounds that follow the paragraph shape also work ok in column sets. - -{\em todo: an example of a bleeding graphic with column feed back (from -techniek)} - -% \page[mine] - -\stopchapter - -\startchapter[title=Numbering lines] - -\FourSpread{columnsets-901} - -This example shows how numbering lines in columns works out. In a two column -layout the numbers end up in the outer margins by default. If you want you can -set the \type {location} to for instance \type {left} or \type {right}. - -\ShowFile{columnsets-901} - -\page[mine] - -\FourSpread{columnsets-902} - -In a three column setup the numbers end up in the left margins.Make sure you make -the distance large enough. - -\ShowFile{columnsets-902} - -% \page[mine] -% -% \FourSpread{columnsets-903} -% -% This example shows again lune numbers but here we made sure that there is no -% stretch in the whitespace. -% -% \ShowFile{columnsets-903} - -\stopchapter - -% \startchapter[title=Spanning and More] -% -% {\em todo: explanation} \page -% -% \TwoPages{columnsets-801} \ShowFile{columnsets-801} \page[mine] -% \TwoPages{columnsets-802} \ShowFile{columnsets-802} \page[mine] -% \TwoPages{columnsets-803} \ShowFile{columnsets-803} \page[mine] -% \TwoPages{columnsets-804} \ShowFile{columnsets-804} \page[mine] -% \TwoPages{columnsets-805} \ShowFile{columnsets-805} \page[mine] -% \TwoPages{columnsets-806} \ShowFile{columnsets-806} \page[mine] -% -% \stopchapter - -\stopdocument diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-000.tex b/doc/context/sources/general/manuals/columnsets/columnsets-000.tex new file mode 100644 index 000000000..429a067de --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-000.tex @@ -0,0 +1,63 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\usemodule[visual] +\usemodule[simulate] + +\dontcomplain + +\startenvironment columnsets-000 + +\useMPlibrary[dum] + +\setupbodyfont + [palatino] + +\setuplayout + [grid=yes] + +\setuplayout + [backspace=20mm, + cutspace=15mm, + width=middle, + height=middle] + +\setupsystem + [random=1234] + +\setuppagenumbering + [alternative=doublesided, + location=] + +\setupheadertexts + [pagenumber][right] + [left][pagenumber] + +\setupfootertexts + [\inputfilename] + +\setupfooter + [style=\tttf] + +\setuptolerance + [verytolerant,stretch] + +\definecolor[color-1][.5(red,green)] +\definecolor[color-2][.5(green,blue)] +\definecolor[color-3][.5(blue,red)] +\definecolor[color-4][.5(white,black)] +\definecolor[color-5][.5(white,color-4)] + +\startuniqueMPgraphic{frame} + fill OverlayBox withcolor \MPcolor{color-1} ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{contrast} + fill OverlayBox withcolor \MPcolor{color-3} ; +\stopuniqueMPgraphic + +\defineoverlay[frame] [\uniqueMPgraphic{frame}] +\defineoverlay[contrast][\uniqueMPgraphic{contrast}] + +\stopenvironment diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-001.tex b/doc/context/sources/general/manuals/columnsets/columnsets-001.tex new file mode 100644 index 000000000..689f4e044 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-001.tex @@ -0,0 +1,17 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=2] + +\starttext + +\startcolumnset[example] + + \dorecurse{20}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-002.tex b/doc/context/sources/general/manuals/columnsets/columnsets-002.tex new file mode 100644 index 000000000..a67dd3161 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-002.tex @@ -0,0 +1,17 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][nleft=3,nright=2,width=5cm] + +\starttext + +\startcolumnset[example] + + \dorecurse{15}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-003.tex b/doc/context/sources/general/manuals/columnsets/columnsets-003.tex new file mode 100644 index 000000000..eed0286f8 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-003.tex @@ -0,0 +1,35 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=2,page=left] + +\setupbackgrounds[text][background=color,backgroundcolor=color-1] + +\setupcolumnsetstart[example][1][1][2] +\setupcolumnsetstart[example][1][2][4] +\setupcolumnsetstart[example][2][1][6] +\setupcolumnsetstart[example][2][2][6] +\setupcolumnsetstart[example][3][1][4] +\setupcolumnsetstart[example][3][2][2] + +\setupcolumnsetlines[example][1][1][-2] +\setupcolumnsetlines[example][1][2][-4] +\setupcolumnsetlines[example][2][1][-6] +\setupcolumnsetlines[example][2][2][-6] +\setupcolumnsetlines[example][3][1][-4] +\setupcolumnsetlines[example][3][2][-2] +\setupcolumnsetlines[example][4][1][4] +\setupcolumnsetlines[example][4][2][10] + +\starttext + +\startcolumnset[example] + + \dorecurse{20}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-004.tex b/doc/context/sources/general/manuals/columnsets/columnsets-004.tex new file mode 100644 index 000000000..a58ddf621 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-004.tex @@ -0,0 +1,32 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left] + +\definecolor[fakerulecolor] + +\definecolumnsetspan[wide] [n=2,background=contrast,color=white] +\definecolumnsetspan[wider][n=4,background=contrast,color=white] + +\starttext + +\startcolumnset[example] + + \startcolumnsetspan[wider] + wider: \dorecurse{2}{#1: \fakewords{25}{50}\par} + \stopcolumnsetspan + + inbetween: \fakewords{25}{50}\par + + \startcolumnsetspan[wide] + wide : \dorecurse{2}{#1: \fakewords{25}{50}\par} + \stopcolumnsetspan + + after: \dorecurse{15}{#1: \fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-005.tex b/doc/context/sources/general/manuals/columnsets/columnsets-005.tex new file mode 100644 index 000000000..f1d970d9e --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-005.tex @@ -0,0 +1,29 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left] + +\definecolumnsetspan[wide][n=2,background=contrast,color=white] + +\definecolor[fakerulecolor] + +\starttext + +\startcolumnset[example] + + \startcolumnsetspan[wide][default=btlr] + + \startsimplecolumns + \dorecurse{2}{\fakewords{25}{40}\par} + \stopsimplecolumns + + \stopcolumnsetspan + + \dorecurse{15}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-006.tex b/doc/context/sources/general/manuals/columnsets/columnsets-006.tex new file mode 100644 index 000000000..033619970 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-006.tex @@ -0,0 +1,35 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left] + +\definecolor[fakerulecolor] + +\definecolumnsetspan[wide][n=2,background=contrast,color=white] + +\starttext + +\startcolumnset[example] + + \startcolumnsetspan[wide] + \fakewords{25}{50} + \stopcolumnsetspan + + \fakewords{25}{50} + + \startcolumnsetspan[wide] + \fakewords{25}{50} + \stopcolumnsetspan + + \startcolumnsetspan[wide][default=btrl] + \fakewords{25}{50} + \stopcolumnsetspan + + \dorecurse{15}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-007.tex b/doc/context/sources/general/manuals/columnsets/columnsets-007.tex new file mode 100644 index 000000000..137a414d9 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-007.tex @@ -0,0 +1,43 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left] + +\definecolor[fakerulecolor] + +\definecolumnsetspan[wide][n=2,background=contrast,color=white] + +\starttext + +\startbuffer + + \startcolumnsetspan[wide] + \fakewords{25}{50} + \stopcolumnsetspan + + \fakewords{25}{50} + + \startcolumnsetspan[wide] + \fakewords{25}{50} + \stopcolumnsetspan + + \startcolumnsetspan[wide][default=btrl] + \fakewords{25}{50} + \stopcolumnsetspan + + \dorecurse{3}{\fakewords{100}{200}\par} + +\stopbuffer + +\startcolumnset[example] + + \dorecurse{4}{\getbuffer} + + \dorecurse{5}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-101.tex b/doc/context/sources/general/manuals/columnsets/columnsets-101.tex new file mode 100644 index 000000000..f9c7b59cb --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-101.tex @@ -0,0 +1,30 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\starttext + +\startbuffer +\fakewords{100}{200} +\placefigure + {} + {\externalfigure[placeholder][width=\columnsetspanwidth{1}]} +\fakewords{100}{200} +\placefigure + {} + {\externalfigure[placeholder][width=\columnsetspanwidth{2}]} +\fakewords{100}{200} +\stopbuffer + +\startcolumnset[example] + + \dorecurse {5}{\getbuffer} + \dorecurse{10}{\fakewords{100}{200}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-102.tex b/doc/context/sources/general/manuals/columnsets/columnsets-102.tex new file mode 100644 index 000000000..3cf4dcd0e --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-102.tex @@ -0,0 +1,36 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\starttext + +\startbuffer +\placefigure [tbrl] + {tblr} + {\externalfigure[fake][width=\columnsetspanwidth{1},lines=5]} +\placefigure [fxtb:6*4] + {fxtb} + {\externalfigure[fake][width=\columnsetspanwidth{2},lines=5]} +\placefigure [btlr] + {btlr} + {\externalfigure[fake][width=\columnsetspanwidth{2},lines=5]} +\placefigure [btlr] + {btlr} + {\externalfigure[fake][width=\columnsetspanwidth{3},lines=5]} + +\dorecurse {5} { + \fakewords{100}{200}\par +} +\stopbuffer + +\startcolumnset[example] + + \dorecurse{6}{\getbuffer} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-103.tex b/doc/context/sources/general/manuals/columnsets/columnsets-103.tex new file mode 100644 index 000000000..f1d4dbedc --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-103.tex @@ -0,0 +1,37 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\starttext + +\startcolumnset[example] + +\useexternalfigure[fake][fake][width=\textwidth,lines=3] + +\placefigure[btlr]{brlr}{\externalfigure[fake]} +\placefigure[btlr]{brlr}{\externalfigure[fake]} +\placefigure[btrl]{btrl}{\externalfigure[fake]} +\placefigure[btrl]{btrl}{\externalfigure[fake]} +\placefigure[tblr]{tblr}{\externalfigure[fake]} +\placefigure[tblr]{tblr}{\externalfigure[fake]} +\placefigure[tbrl]{tbrl}{\externalfigure[fake]} +\placefigure[tbrl]{tbrl}{\externalfigure[fake]} + +\placefigure[lrbt]{lrbt}{\externalfigure[fake]} +\placefigure[lrbt]{lrbt}{\externalfigure[fake]} +\placefigure[lrtb]{lrtb}{\externalfigure[fake]} +\placefigure[lrtb]{lrtb}{\externalfigure[fake]} +\placefigure[rlbt]{rlbt}{\externalfigure[fake]} +\placefigure[rlbt]{rlbt}{\externalfigure[fake]} +\placefigure[rltb]{rltb}{\externalfigure[fake]} +\placefigure[rltb]{rltb}{\externalfigure[fake]} + +\dorecurse{10}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-201.tex b/doc/context/sources/general/manuals/columnsets/columnsets-201.tex new file mode 100644 index 000000000..37b26c391 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-201.tex @@ -0,0 +1,31 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [one] + [type=both, + x=1,y=1,nx=2,ny=6, + background=contrast, + state=repeat] + +\definecolumnsetarea + [two] + [type=both, + x=4,y=10,nx=1,ny=6, + background=contrast, + state=repeat] + +\starttext + +\startcolumnset[example] + + \dorecurse{40}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-202.tex b/doc/context/sources/general/manuals/columnsets/columnsets-202.tex new file mode 100644 index 000000000..1721d9cbc --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-202.tex @@ -0,0 +1,32 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [one][left] + [x=1,y=1,nx=2,ny=6, + background=contrast,state=repeat] + +\definecolumnsetarea + [two][right] + [x=3,y=1,nx=2,ny=6, + background=contrast,state=repeat] + +\definecolumnsetarea + [three][both] + [x=2,y=10,nx=2,ny=6, + background=contrast,state=repeat] + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{\fakewords{50}{100}} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-203.tex b/doc/context/sources/general/manuals/columnsets/columnsets-203.tex new file mode 100644 index 000000000..6c15578bc --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-203.tex @@ -0,0 +1,29 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [one]% [left] + [x=1,y=1,nx=6,ny=6, + background=contrast,state=start] + +\definecolumnsetarea + [two]%[left] + [x=3,y=10,nx=4,ny=6, + background=contrast,state=start] + +\stopsetups + +\starttext + +\startcolumnset[example] + + \dorecurse{25}{\fakewords{50}{100}} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-204.tex b/doc/context/sources/general/manuals/columnsets/columnsets-204.tex new file mode 100644 index 000000000..d390f468e --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-204.tex @@ -0,0 +1,41 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\usemodule[oldfun] + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [title] + [x=1,y=1,nx=8,ny=8, + background=contrast, + color=white, + align={lohi,right}, + state=start] + +\setupcolumnsetareatext + [title] + [\setups{the title}] + +\startsetups[the title] + + \GapText + {\dimexpr\makeupwidth+\backspace\relax} + {6pt} + {RegularBold*default} {sa 4} + {A Title Spanni\+ng 2 Pages} + +\stopsetups + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-205.tex b/doc/context/sources/general/manuals/columnsets/columnsets-205.tex new file mode 100644 index 000000000..b53709770 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-205.tex @@ -0,0 +1,42 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\usemodule[oldfun] + +\environment columnsets-000 + +\unprotected \def\SpreadGapText#1#2{{\def\+{\blackrule[\c!width=#1]}#2}} + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [title] + [x=1,y=1,nx=8,ny=8, + background=contrast, + color=white, + align={lohi,right}, + state=start] + +\setupcolumnsetareatext + [title] + [\setups{the title}] + +\startsetups[the title] + + \GapText + {\dimexpr(\makeupwidth+\backspace)} {6pt} + {RegularBold} {sa 4} + {A Title Spanni\+ng 2 Pages} + +\stopsetups + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-206.tex b/doc/context/sources/general/manuals/columnsets/columnsets-206.tex new file mode 100644 index 000000000..8b9f524b1 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-206.tex @@ -0,0 +1,29 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [first] + [x=2,y=4,nx=2,ny=8, + background=contrast, + state=start] + +\definecolumnsetarea + [second] + [x=1,y=20,nx=1,ny=3, + background=contrast, + state=start] + +\starttext + +\startcolumnset[example] + + \dorecurse{50}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-301.tex b/doc/context/sources/general/manuals/columnsets/columnsets-301.tex new file mode 100644 index 000000000..4d21f2b02 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-301.tex @@ -0,0 +1,29 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4] + +\starttext + +\startcolumnset[example] + + 1: \fakewords{50}{75} \column + 2: [] \fakewords{50}{75} \column[yes] + 3: [yes] \fakewords{50}{75} \column[page] + \column[page] % redundant + 4: [page] \fakewords{50}{75} \column[3] + 5: [3] \fakewords{50}{75} \column[4] + 6: [4] \fakewords{50}{75} \column[first] + 7: [first] \fakewords{50}{75} \column[last] + 8: [last] \fakewords{50}{75} \page + 9: (page) \fakewords{50}{75} \page + \page % redundant + 10: (page) \fakewords{50}{75} \column[3*5] + 11: [3*5] \fakewords{50}{75} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-401.tex b/doc/context/sources/general/manuals/columnsets/columnsets-401.tex new file mode 100644 index 000000000..ee91e608c --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-401.tex @@ -0,0 +1,26 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\setupbackgrounds[text][text][background=contrast] + +\definecolor[fakerulecolor][white] + +\setupcolumnset[example:2][distance=36pt] +\setupcolumnset[example:3][distance=72pt] +\setupcolumnset[example:4][distance=24pt] +\setupcolumnset[example:5][distance=48pt] + +\starttext + +\startcolumnset[example] + + \dorecurse{25}{\fakewords{100}{150}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-402.tex b/doc/context/sources/general/manuals/columnsets/columnsets-402.tex new file mode 100644 index 000000000..00db6017c --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-402.tex @@ -0,0 +1,24 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\setupbackgrounds[text][text][background=contrast] + +\setupcolumnset[example] [distance=24pt] +\setupcolumnset[example:1][distance=96pt] + +\definecolor[fakerulecolor][white] + +\starttext + +\startcolumnset[example] + + \dorecurse{25}{\fakewords{100}{150}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-403.tex b/doc/context/sources/general/manuals/columnsets/columnsets-403.tex new file mode 100644 index 000000000..c9bc2e648 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-403.tex @@ -0,0 +1,23 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\setupbackgrounds[text][text][background=contrast] + +\definecolor[fakerulecolor][white] + +\setupcolumnset[example][width=.15\makeupwidth] + +\starttext + +\startcolumnset[example] + + \dorecurse{25}{\fakewords{100}{150}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-404.tex b/doc/context/sources/general/manuals/columnsets/columnsets-404.tex new file mode 100644 index 000000000..05a25acfe --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-404.tex @@ -0,0 +1,34 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left] + +\setupbackgrounds[text][text][background=contrast] + +\setupcolumnset[frame=on,framecolor=color-4,rulethickness=1mm] + +\definecolor[fakerulecolor][white] + +\setupcolumnset[example:1][width=2cm] +\setupcolumnset[example:2][width=4cm] +\setupcolumnset[example:3][width=3cm] + +\setupcolumnset[example:4][width=3cm] +\setupcolumnset[example:5][width=4cm] +\setupcolumnset[example:6][width=6cm] + +\starttext + +\startcolumnset[example] + +\dorecurse{15}{ + \dorecurse{3}{\fakewords{10}{15}\par} + \column[yes] +} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-405.tex b/doc/context/sources/general/manuals/columnsets/columnsets-405.tex new file mode 100644 index 000000000..fa20ef34c --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-405.tex @@ -0,0 +1,29 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\setupbackgrounds[text][text][background=contrast] + +\setupcolumnset[frame=on,framecolor=color-4,rulethickness=1mm] + +\definecolor[fakerulecolor][white] + +\setupcolumnset[example:1][width=.3\makeupwidth] + +\starttext + +\startcolumnset[example] + + \fakewords{150}{150} + \column + \fakewords{25}{50} + + \dorecurse{25}{\fakewords{50}{75}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-601.tex b/doc/context/sources/general/manuals/columnsets/columnsets-601.tex new file mode 100644 index 000000000..b139210f4 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-601.tex @@ -0,0 +1,29 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left,direction=reverse] + +\setupbackgrounds[text][text][background=contrast] + +\definecolor[fakerulecolor][color-1] + +\starttext + +\startcolumnset[example] + + \dorecurse{50}{ + \dontleavehmode + \snaptogrid\hbox + {\scale[height=2.5\lineheight]{\color[white]{#1}}}% + \space + \fakewords{30}{60} + %\simulatewords[n=30,m=60,min=1,max=5,color=color-1,line=yes]\par + \par + } + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-701.tex b/doc/context/sources/general/manuals/columnsets/columnsets-701.tex new file mode 100644 index 000000000..b2c50cfaf --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-701.tex @@ -0,0 +1,23 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\setupcolumnset + [example] + [background=contrast] + +\definecolor[fakerulecolor][white] + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-702.tex b/doc/context/sources/general/manuals/columnsets/columnsets-702.tex new file mode 100644 index 000000000..5b9a879c1 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-702.tex @@ -0,0 +1,27 @@ +content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\setupcolumnset + [example] + [background=contrast, + backgroundoffset=4pt, + frame=on, + framecolor=white, + rulethickness=2pt] + +\definecolor[fakerulecolor][white] + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-703.tex b/doc/context/sources/general/manuals/columnsets/columnsets-703.tex new file mode 100644 index 000000000..549b49f61 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-703.tex @@ -0,0 +1,34 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=4,page=left] + +\definecolumnsetarea + [title][left] + [x=1,y=1,nx=8,ny=8, + background=contrast,state=repeat] + +\setupcolumnsetareatext + [title][left][\setups{cow}] + +\startsetups[cow] + + \externalfigure + [cow.pdf] + [height=15\lineheight, + width=2\dimexpr\makeupwidth+\backspace\relax] + +\stopsetups + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{\fakewords{50}{100}\par} + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-704.tex b/doc/context/sources/general/manuals/columnsets/columnsets-704.tex new file mode 100644 index 000000000..7fa6cb313 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-704.tex @@ -0,0 +1,69 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\startuseMPgraphic{mpos:par:columns} + path p ; numeric h ; + for i=1 upto nofmultipars : + p := multipars[i] ; + h := bbheight(p) ; + if multikind[i] = "single" : + fill p topenlarged -.5h + withshademethod "linear" + withshadedirection shadedup + withcolor \MPcolor{color-1} shadedinto white ; + fill p bottomenlarged -.5h + withshademethod "linear" + withshadedirection shadedup + withcolor white shadedinto \MPcolor{color-1} ; + elseif multikind[i] = "first" : + fill p + withshademethod "linear" + withshadedirection shadedup + withcolor \MPcolor{color-2} shadedinto white ; + elseif multikind[i] = "middle" : + fill p topenlarged -.5h + withshademethod "linear" + withshadedirection shadedup + withcolor \MPcolor{color-2} shadedinto white ; + fill p bottomenlarged -.5h + withshademethod "linear" + withshadedirection shadedup + withcolor white shadedinto \MPcolor{color-3} ; + elseif multikind[i] = "last" : + fill p + withshademethod "linear" + withshadedirection shadedup + withcolor white shadedinto \MPcolor{color-3} ; + fi ; + endfor ; +\stopuseMPgraphic + +\definecolumnset + [example] + [n=4, + page=left] + +\definetextbackground + [shade] + [location=paragraph, + mp=mpos:par:columns, + before=\blank, + after=\blank] + +\starttext + +\startcolumnset[example] + + \dorecurse {40} { + \starttextbackground[shade] + \fakewords{10}{200} + \stoptextbackground + \par + } + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-801.tex b/doc/context/sources/general/manuals/columnsets/columnsets-801.tex new file mode 100644 index 000000000..1a84f99ab --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-801.tex @@ -0,0 +1,19 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset [example-1] [n=2] +\definecolumnset [example-2] [n=3] + +\starttext \showgrid + + \startcolumnset [example-1] + \dorecurse {1}{\input tufte \par} + \stopcolumnset + \startcolumnset [example-2] + \dorecurse {2}{\input ward \par} + \stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-802.tex b/doc/context/sources/general/manuals/columnsets/columnsets-802.tex new file mode 100644 index 000000000..a126d0012 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-802.tex @@ -0,0 +1,22 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset [example-1] [n=2,balance=yes] +\definecolumnset [example-2] [n=3,balance=yes] + +\starttext \showgrid + + \setupcolumnsetlines[example-1][1][1] [8] + \setupcolumnsetlines[example-1][1][2][10] + + \startcolumnset [example-1] + \dorecurse {1}{\input tufte \par} + \stopcolumnset + \startcolumnset [example-2] + \dorecurse {2}{\input ward \par} + \stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-803.tex b/doc/context/sources/general/manuals/columnsets/columnsets-803.tex new file mode 100644 index 000000000..58a278bb1 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-803.tex @@ -0,0 +1,26 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset [example-1] [n=2,balance=yes] +\definecolumnset [example-2] [n=3,balance=yes] + +\starttext \showgrid + + \setupcolumnsetlines[example-1][1][1] [8] + \setupcolumnsetlines[example-1][1][2][10] + + \setupcolumnsetlines[example-2][1][1][19] + \setupcolumnsetlines[example-2][1][2][18] + \setupcolumnsetlines[example-2][1][3][19] + + \startcolumnset [example-1] + \dorecurse {1}{\input tufte \par} + \stopcolumnset + \startcolumnset [example-2] + \dorecurse {2}{\input ward \par} + \stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-804.tex b/doc/context/sources/general/manuals/columnsets/columnsets-804.tex new file mode 100644 index 000000000..c2b7a6b1e --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-804.tex @@ -0,0 +1,26 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset [example-1] [n=2,balance=yes] +\definecolumnset [example-2] [n=3,balance=yes] + +\starttext \showgrid + + \setupcolumnsetlines[example-1][1][1] [8] + \setupcolumnsetlines[example-1][1][2][10] + + \setupcolumnsetlines[example-2][1][1] [0] + \setupcolumnsetlines[example-2][1][2][-2] + \setupcolumnsetlines[example-2][1][3] [0] + + \startcolumnset [example-1] + \dorecurse {1}{\input tufte \par} + \stopcolumnset + \startcolumnset [example-2] + \dorecurse {6}{\input ward \par} + \stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-805.tex b/doc/context/sources/general/manuals/columnsets/columnsets-805.tex new file mode 100644 index 000000000..fc80e7e9c --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-805.tex @@ -0,0 +1,26 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset [example-1] [n=2,balance=yes] +\definecolumnset [example-2] [n=3,balance=yes] + +\starttext \showgrid + + \setupcolumnsetlines[example-1][1][1] [8] + \setupcolumnsetlines[example-1][1][2][10] + + \setupcolumnsetstart[example-2][1][1][19] + \setupcolumnsetstart[example-2][1][2][17] + \setupcolumnsetstart[example-2][1][3][19] + + \startcolumnset [example-1] + \dorecurse {1}{\input tufte \par} + \stopcolumnset + \startcolumnset [example-2] + \dorecurse {2}{\input ward \par} + \stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-806.tex b/doc/context/sources/general/manuals/columnsets/columnsets-806.tex new file mode 100644 index 000000000..0322a336f --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-806.tex @@ -0,0 +1,26 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset [example-1] [n=2,balance=yes] +\definecolumnset [example-2] [n=3,balance=yes] + +\starttext \showgrid + + \setupcolumnsetlines[example-1][1][1] [8] + \setupcolumnsetlines[example-1][1][2][10] + + \setupcolumnsetstart[example-2][1][1][29] + \setupcolumnsetstart[example-2][1][2][29] + \setupcolumnsetstart[example-2][1][3][29] + + \startcolumnset [example-1] + \dorecurse {1}{\input tufte \par} + \stopcolumnset + \startcolumnset [example-2] + \dorecurse {2}{\input ward \par} + \stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-901.tex b/doc/context/sources/general/manuals/columnsets/columnsets-901.tex new file mode 100644 index 000000000..300458bf5 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-901.tex @@ -0,0 +1,38 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=2,page=left,distance=1cm] + +\setupcolumnset + [example] + [background=contrast] + +\definecolor[fakerulecolor][white] \faketriggertrue + +\setuphead + [section] + [style=\bfd] + +\setuplinenumbering + [style=bold, + distance=0pt, + align=inner] + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{ + \startsection[title=foo #1] + \startlinenumbering + \fakewords{50}{100}\par + \stoplinenumbering + \stopsection + } + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-902.tex b/doc/context/sources/general/manuals/columnsets/columnsets-902.tex new file mode 100644 index 000000000..fda2969af --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-902.tex @@ -0,0 +1,38 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left,distance=1cm] + +\setupcolumnset + [example] + [background=contrast] + +\definecolor[fakerulecolor][white] \faketriggertrue + +\setuphead + [section] + [style=\bfd] + +\setuplinenumbering + [style=bold, + distance=0pt, + align=inner] + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{ + \startsection[title=foo #1] + \startlinenumbering + \fakewords{50}{100}\par + \stoplinenumbering + \stopsection + } + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets-903.tex b/doc/context/sources/general/manuals/columnsets/columnsets-903.tex new file mode 100644 index 000000000..68cd31ae2 --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets-903.tex @@ -0,0 +1,41 @@ +% content=tex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\environment columnsets-000 + +\definecolumnset[example][n=3,page=left,distance=1cm] + +\setupcolumnset + [example] + [background=contrast] + +\definecolor[fakerulecolor][white] \faketriggertrue + +\setupblank + [line] + +\setuphead + [section] + [style=\bfd] + +\setuplinenumbering + [style=bold, + distance=0pt, + align=inner] + +\starttext + +\startcolumnset[example] + + \dorecurse{30}{ + \startsection[title=foo #1] + \startlinenumbering + \fakewords{50}{100}\par + \stoplinenumbering + \stopsection + } + +\stopcolumnset + +\stoptext diff --git a/doc/context/sources/general/manuals/columnsets/columnsets.tex b/doc/context/sources/general/manuals/columnsets/columnsets.tex new file mode 100644 index 000000000..7d68872ef --- /dev/null +++ b/doc/context/sources/general/manuals/columnsets/columnsets.tex @@ -0,0 +1,873 @@ +% engine=luatex +% +% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa + +\dontcomplain + +\definepagebreak[mine][yes] + +% A complete otf optima pack is too expensive for this (I only have the +% type one set). +% +% \usetypescriptfile +% [type-ghz] +% +% \usetypescript +% [sans] +% [optima-nova] +% +% \setupbodyfont +% [optima-nova,11pt] +% +% \definefont[QuiteLarge][SansBold sa 3] +% \definefont[NotSoLarge][SansBold sa 1.5] +% +% So we could use: +% +% \setupbodyfont +% [pagella,11pt] +% +% \definefont[QuiteLarge][Bold sa 2.50] +% \definefont[NotSoLarge][Bold sa 1.25] +% +% But this one has a matching sans: + +\setupbodyfont + [dejavu,11pt] + +\definefont[QuiteLarge][SansBold sa 2.50] +\definefont[NotSoLarge][SansBold sa 1.25] + +\setuplayout + [backspace=.1\paperwidth, + topspace=.025\paperheight, + header=0.025\paperheight, + footer=0.025\paperheight, + headerdistance=0.025\paperheight, + footerdistance=0.025\paperheight, + width=middle, + height=middle] + +\setuppagenumbering + [alternative=doublesided, + location=] + +\setupwhitespace + [line] + +\setupblank + [line] + +\setuptyping + [blank=halfline] + +\startsetups [pagenumber] + \hbox to .2\paperwidth { + \hss + Page \pagenumber + \hss + } +\stopsetups + +\setupfooter [before=\vfill,after=\vfill,style=\bf,color=color-4] +\setupheader [before=\vfill,after=\vfill,style=\bf,color=color-4] + +\setupfootertexts [] [\setups{pagenumber}] +\setupheadertexts [] [\setups{chapterhead}] + +\startsetups [chapterhead] + \hbox to .2\paperwidth { + \hss + \getmarking[chapter] + \hss + } +\stopsetups + +\setuphead + [chapter] + [header=empty] + +\definecolor[color-1][.5(red,green)] +\definecolor[color-2][.5(green,blue)] +\definecolor[color-3][.5(blue,red)] +\definecolor[color-4][.5(white,black)] +\definecolor[color-5][.5(white,color-4)] +\definecolor[color-6][.2(white,color-4)] + +\startuseMPgraphic{page} +StartPage ; + path p ; + numeric n; n := PageNumber ; + numeric w; w := bbwidth(Page) ; + numeric h; h := bbheight(Page) ; + def DrawBit (expr bit, dx, dy) = + path p ; p := unitsquare xyscaled(w/5,h/40) shifted (dx*w/10,dy*(h-h/40)) ; + if n div bit > 0 : + n := n - (n div bit)*bit ; + fill p withcolor \MPcolor{color-1} ; + else : + fill p withcolor \MPcolor{color-2} ; + fi ; + enddef ; + DrawBit(32,7,1) ; + DrawBit(16,4,1) ; + DrawBit( 8,1,1) ; + DrawBit( 4,7,0) ; + DrawBit( 2,4,0) ; + DrawBit( 1,1,0) ; +StopPage ; +\stopuseMPgraphic + +\startuniqueMPgraphic{frame} + fill OverlayBox withcolor \MPcolor{color-5} ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{contrast} + fill OverlayBox withcolor \MPcolor{color-4} ; +\stopuniqueMPgraphic + +\defineoverlay[page] [\useMPgraphic{page}] +\defineoverlay[frame] [\useMPgraphic{frame}] +\defineoverlay[contrast][\useMPgraphic{contrast}] + +\setupexternalfigures + [background=frame] + +\definecombination + [sixpages] + [%inbetween=\blank, + style=mono, + distance=.5\bodyfontsize, + width=\textwidth] + +\definecombination + [fourpages] + [%inbetween=\blank, + style=mono, + distance=.5\bodyfontsize, + width=\textwidth] + +\definecombination + [twopages] + [style=mono] + +\definemeasure[twopages] [\dimexpr\dimexpr\textwidth-3 \bodyfontsize\relax/4\relax] +\definemeasure[fourpages] [\dimexpr\dimexpr\textwidth-3 \bodyfontsize\relax/4\relax] +\definemeasure[eightpages][\dimexpr\dimexpr\textwidth-3 \bodyfontsize\relax/4\relax] +\definemeasure[sixpages] [\dimexpr\dimexpr\textwidth-2.5\bodyfontsize\relax/6\relax] + +\starttexdefinition unexpanded OnePage #1 + \startlinecorrection[blank] + \startcombination[twopages][1*1] + {\typesetfile[#1.tex][page=1,lines=15]} {1} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded OneSpread #1 + \startlinecorrection[blank] + \startcombination[twopages][1*1] + {\typesetfile[#1.tex][page=2,lines=15]} {2} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded TwoPages #1 + \startlinecorrection[blank] + \startcombination[twopages][2*1] + {\typesetfile[#1.tex][page=1,width=\measure{twopages}]} {1} + {\typesetfile[#1.tex][page=2,width=\measure{twopages}]} {2} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded TwoSpread #1 + \startlinecorrection[blank] + \startcombination[twopages][2*1] + {\typesetfile[#1.tex][page=2,width=\measure{twopages}]} {2} + {\typesetfile[#1.tex][page=3,width=\measure{twopages}]} {3} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded FourPages #1 + \startlinecorrection[blank] + \startcombination[fourpages][4*1] + {\typesetfile[#1.tex][page=1,width=\measure{fourpages}]} {1} + {\typesetfile[#1.tex][page=2,width=\measure{fourpages}]} {2} + {\typesetfile[#1.tex][page=3,width=\measure{fourpages}]} {3} + {\typesetfile[#1.tex][page=4,width=\measure{fourpages}]} {4} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded FourSpread #1 + \startlinecorrection[blank] + \startcombination[fourpages][4*1] + {\typesetfile[#1.tex][page=2,width=\measure{fourpages}]} {2} + {\typesetfile[#1.tex][page=3,width=\measure{fourpages}]} {3} + {\typesetfile[#1.tex][page=4,width=\measure{fourpages}]} {4} + {\typesetfile[#1.tex][page=5,width=\measure{fourpages}]} {5} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded SixPages #1 + \startlinecorrection[blank] + \startcombination[sixpages][6*1] + {\typesetfile[#1.tex][page=1,width=\measure{sixpages}]} {1} + {\typesetfile[#1.tex][page=2,width=\measure{sixpages}]} {2} + {\typesetfile[#1.tex][page=3,width=\measure{sixpages}]} {3} + {\typesetfile[#1.tex][page=4,width=\measure{sixpages}]} {4} + {\typesetfile[#1.tex][page=5,width=\measure{sixpages}]} {5} + {\typesetfile[#1.tex][page=6,width=\measure{sixpages}]} {6} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded SixSpread #1 + \startlinecorrection[blank] + \startcombination[sixpages][6*1] + {\typesetfile[#1.tex][page=2,width=\measure{sixpages}]} {2} + {\typesetfile[#1.tex][page=3,width=\measure{sixpages}]} {3} + {\typesetfile[#1.tex][page=4,width=\measure{sixpages}]} {4} + {\typesetfile[#1.tex][page=5,width=\measure{sixpages}]} {5} + {\typesetfile[#1.tex][page=6,width=\measure{sixpages}]} {6} + {\typesetfile[#1.tex][page=7,width=\measure{sixpages}]} {7} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded EightPages #1 + \startlinecorrection[blank] + \startcombination[fourpages][4*2] + {\typesetfile[#1.tex][page=1,width=\measure{eightpages}]} {#1 / 1} + {\typesetfile[#1.tex][page=2,width=\measure{eightpages}]} {#1 / 2} + {\typesetfile[#1.tex][page=3,width=\measure{eightpages}]} {#1 / 3} + {\typesetfile[#1.tex][page=4,width=\measure{eightpages}]} {#1 / 4} + {\typesetfile[#1.tex][page=5,width=\measure{eightpages}]} {#1 / 5} + {\typesetfile[#1.tex][page=6,width=\measure{eightpages}]} {#1 / 6} + {\typesetfile[#1.tex][page=7,width=\measure{eightpages}]} {#1 / 7} + {\typesetfile[#1.tex][page=8,width=\measure{eightpages}]} {#1 / 8} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\starttexdefinition unexpanded EightSpread #1 + \startlinecorrection[blank] + \startcombination[fourpages][4*2] + {\typesetfile[#1.tex][page=2,width=\measure{eightpages}]} {#1 / 2} + {\typesetfile[#1.tex][page=3,width=\measure{eightpages}]} {#1 / 3} + {\typesetfile[#1.tex][page=4,width=\measure{eightpages}]} {#1 / 4} + {\typesetfile[#1.tex][page=5,width=\measure{eightpages}]} {#1 / 5} + {\typesetfile[#1.tex][page=6,width=\measure{eightpages}]} {#1 / 6} + {\typesetfile[#1.tex][page=7,width=\measure{eightpages}]} {#1 / 7} + {\typesetfile[#1.tex][page=8,width=\measure{eightpages}]} {#1 / 8} + {\typesetfile[#1.tex][page=9,width=\measure{eightpages}]} {#1 / 9} + \stopcombination + \stoplinecorrection +\stoptexdefinition + +\setuphead + [chapter] + [style=\QuiteLarge, + color=color-3, + number=no] + +\setuplist + [chapter] + [command=\MyListCommand, + alternative=command] + +\starttexdefinition unexpanded MyListCommand #1#2#3 + \snaptogrid + [line,-line]\vbox { + \tfb + \setstrut + \strut#2 + \quad#3 + } +\stoptexdefinition + +\setupmargindata + [style=\tttf, + color=color-3] + +\starttexdefinition unexpanded ShowFile #1 + \margintext + {\cldcontext{string.match("#1","\letterpercent d+")}} + \typefile + [range={environment}] + {#1} +\stoptexdefinition + +% \typefile[range=4] {...} +% \typefile[range={=}]{...} % start after comment lines + +\starttexdefinition unexpanded ShowEnvironmentFile #1 + \margintext + {\cldcontext{string.match("#1","\letterpercent d+")}} + \typefile + [range={=startenvironment}] + {#1} +\stoptexdefinition + +\startdocument + +\startMPpage +StartPage ; + path p ; numeric w, h, d ; picture q ; + if true : + q := image(draw textext.urt("\ssbf COLUMNS") withcolor \MPcolor{color-6}) ; + else : + q := image(draw textext.urt("\ssbf COLUMNSETS") withcolor \MPcolor{color-6}) ; + fi ; + w := bbwidth(Page) ; + h := bbheight(Page) ; + d := h/100 ; + fill Page withcolor \MPcolor{color-1} ; + p := Page xysized (w,d) ; + for i := 5d step 2d until h-5d : + fill p shifted (0,i) withcolor \MPcolor{color-2} ; + endfor + p := Page xysized(w/10,h) ; + for i = 0, .3, .6, .9 : + fill p shifted (i*w,0) withcolor \MPcolor{color-1} withtransparency(1,.75) ; + endfor ; + def do_it(expr sz, sh) = + p := Page xysized sz ; + fill p shifted sh withcolor \MPcolor{color-3} withtransparency(1,.5) ; + draw q xysized (bbwidth(p),bbheight(p)) shifted sh ; + enddef ; + if true : + do_it ((2w/10,17d),(.1w,20d)) ; + do_it ((2w/10,15d),(.1w,56d)) ; + do_it ((2w/10,21d),(.4w,66d)) ; + do_it ((2w/10,13d),(.7w,38d)) ; + do_it ((5w/10,13d),(.4w,13d)) ; + draw textext.urt("\ssbf Hans Hagen") + xysized (5w/10,5d) + shifted (.4w,6d) + withcolor \MPcolor{color-5} ; + else : + do_it ((2w/10,17d),(.1w,15d)) ; + do_it ((2w/10,15d),(.1w,51d)) ; + do_it ((2w/10,21d),(.4w,61d)) ; + do_it ((2w/10,13d),(.7w,31d)) ; + do_it ((5w/10,13d),(.4w, 7d)) ; + fi ; +StopPage ; +\stopMPpage + +\page[empty] \setuppagenumber[number=1] + +\setupbackgrounds + [page] + [background=page] + +\starttitle[title=Contents] + + \placelist[chapter] + +\stoptitle + +\startchapter[title=Introduction] + +This manual introduces {\em column sets}, one of the output routines of \CONTEXT. +Although column sets are mainly meant for typesetting journals in a +semi||automated way, you can also use them for books. We assume that the user is +familiar with \CONTEXT\ and only discuss the commands that are related to column +sets. + +This mechanism performs okay but it needs to be used with care: an occasional +manual intervention is needed to get optimal results. After all, we're operating +in the area where normally click and point desktop publishing is used. + +{\bf For the moment you need to load the new code with: \type{\usemodule[newcolumnsets]}} + +\startlines +Hans Hagen +PRAGMA ADE +Hasselt, 2003\endash2016 +\stoplines + +\stopchapter + +\startchapter[title=Basics] + +As soon as enough content is collected to build a page, \TEX\ will invoke the +output routine. This is not a fixed piece of code, but a collection of macro +calls. The default output routine is a meant for typesetting a single column, as +in this document. A multi||column output routine is available as well. This +routine mixes well with the single column one, and is activated by: + +\starttyping +\startcolumns +some text ... +\stopcolumns +\stoptyping + +In \MKIV\ a new mixed column mechanism has been introduced that will be +developped further and eventually replace the old multi column handler. In \MKII\ +there is also a columnset mechanism that can be used to construct complex multi +column pages. In \MKIV\ this gets replaced by grid columns. All these multi +column mechanisms have in common that the output routine is more complex because +now a page is in fact a collection of pages wrapped onto one. Each column is +(from \TEX's perspective) similar to a one narrow column page. Here we focus on +columnsets (page grids). + +There are some limitations to what you can do with this kind of multi columns, +which is why we have a third routine at out disposal: {\em column sets}. This +routine can be used for rather complex layouts with graphics all over the place, +and text spanning columns or even spreads. There are of course some shortcomings, +which we will discuss later. + +In the examples that follow we use the following style to set up the layout. The +number in the margin serves a reference to the file where this snippet of \TEX\ +is stored. + +\ShowEnvironmentFile{columnsets-000} + +\page[mine] + +Before we will demonstrate more complex layouts, we will introduce a few +features. In the next series of examples we use fake text. You can enlarge the +pages in your viewer if you want to see more detail. + +\FourSpread{columnsets-001} + +These pages were typeset with the following code: + +\ShowFile{columnsets-001} + +We will showmost examples on a spread, so we don't show a first page. On a +spread like above we number columns from~1 to~4, which in practice means that in +this case columns starting on right page start with column~3! + +\SixPages{columnsets-001} + +\page[mine] + +The number of columns is not fixed to two. You can even have a different number +of columns on left and right pages. + +\FourSpread{columnsets-002} + +This time the input is: + +\ShowFile{columnsets-002} + +Again, we started on a right page but showed the spreads. You can see it from the +positioning of the header texts. + +\SixPages{columnsets-002} + +\page[mine] + +In order to get the balancing you want, you can manually influence the height of +a column. + +\FourSpread{columnsets-003} + +When you set the number of column lines to a positive value, that will be the +number of lines. A negative value will be subtracted from the maximum number of +lines. + +\ShowFile{columnsets-003} + +\page[mine] + +In articles you may want to let the introduction span multiple columns. A column +span is defined independent of a column set and shows up as follows: + +\FourSpread{columnsets-004} + +Here we've given the span a background so that it stands out. + +\ShowFile{columnsets-004} + +\page[mine] + +A column span can be positioned like any graphic. Later we will discuss the +placement options in more detail, for the moment all you need to know is that +\type {btlr} tells \CONTEXT\ to place the graphic in the left bottom of the the +text area. + +\FourSpread{columnsets-005} + +Here we pass the \type {default} placement as parameter to the span, but you can +also set it at definition time. We use a brute force simple column splitter to +fake columns inside the span. + +\ShowFile{columnsets-005} + +\page[mine] + +You are not limited to one column span. In this sense a span is like a graphic: +as long as there is room, it will be placed where you want it to be placed. The +main difference between a span and a graphic is that a span expects text and +tries to align the baselines with the rest of the text. In many ways a column +span behaves like a framed text. + +\FourSpread{columnsets-006} + +This time we flushed one of the spans from bottom to top, starting at the right +edge: \type {btrl}. + +\ShowFile{columnsets-006} + +\page[mine] + +Column spans are treated like graphics, which means that they will float if +needed. In the process, the width is limited to the available space, which in +some cases may lead to a smaller span than you may expect. Think of a column +span, calculated (and prepared) in the last column and ending up on the next page +in the first column, where a broader span would have been possible. + +\FourSpread{columnsets-007} + +\ShowFile{columnsets-007} + +\stopchapter + +\startchapter[title=Graphics] + +Most documents have graphics, and therefore column sets can contain them. The +main thing that you have to keep in mind when placing graphics, is that column +sets are based on grids. Therefore spacing around graphics is also grid based. + +\FourSpread{columnsets-101} + +\ShowFile{columnsets-101} + +\page[mine] + +You can tell \CONTEXT\ where it should place the graphic, but this will only be +honored when there is still place. + +\EightSpread{columnsets-102} + +The prefered location is passed as a four character directive: + +\ShowFile{columnsets-102} + +\page[mine] + +The following directives are available: + +\starttabulate[|lT|p|] +\NC btlr \NC flush from bottom to top and left to right \NC \NR +\NC btrl \NC flush from bottom to top and right to left \NC \NR +\NC tblr \NC flush from top to bottom and left to right \NC \NR +\NC tbrl \NC flush from top to bottom and right to left \NC \NR +\NC lrbt \NC flush from left to right and bottom to top \NC \NR +\NC lrtb \NC flush from left to right and top to bottom \NC \NR +\NC rlbt \NC flush from right to left and bottom to top \NC \NR +\NC rltb \NC flush from right to left and top to bottom \NC \NR +\NC here \NC try to place the graphic here \NC \NR +\NC fixd \NC force the graphic here and don't float \NC \NR +\NC fxtb:c*r \NC place the graphic at (c,r) or lower if needed \NC \NR +\NC fxbt:c*r \NC place the graphic at (c,r) or higher if needed \NC \NR +\NC tops \NC place the graphic at the top of the page \NC \NR +\NC bots \NC place the graphic at the bottom of the page \NC \NR +\NC page \NC place the graphic at a separate page \NC \NR +\stoptabulate + +In the next example we show the directional locations: + +\OneSpread{columnsets-103} + +\ShowFile{columnsets-103} + +\stopchapter + +\startchapter[title=Areas] + +So far we have seen texts and graphics that span multiple columns using span +commands and floats placement commands. We have also seen that you can define a +different number of columns for left and right pages. Now that we have arrives at +column areas you will see how we can span information over not only a page but +also over pages in a spread. + +\FourSpread{columnsets-201} + +Being a framed text, by default an area is aligned at the baseline. You can lower +an area by setting the \type {location} to \type {depth}. + +\ShowFile{columnsets-201} + +\page[mine] + +You can position areas on the left, right or next page or on both pages. When you +set \type {state} to \type {repeat}, an area is repeated, otherwise it is only +placed once. + +\FourSpread{columnsets-202} + +Here we just repeat the areas. Normally this only make sense when the content is +worth repeating. + +\ShowFile{columnsets-202} + +\page[mine] + +Areas can span a spread, as is demonstrated in the next example. + +\FourSpread{columnsets-203} + +\ShowFile{columnsets-203} + +\page[mine] + +An application of a spread area is a title. In the next example we show two +spread pages. + +\FourSpread{columnsets-204} + +Watch how we explicitly go to a left page. + +\ShowFile{columnsets-204} + +\page[mine] + +The \type {\GapText} macro is an experimental fun macro and is used to make sure +that we don't end up with a clipped character. + +\startlinecorrection[blank] +\startcombination + {\scale[width=.4\textwidth]{\clip + [nx=2,ny=6,x=2,y=2] + {\typesetfile[columnsets-204.tex][page=2]}}} + {left page} + {\scale[width=.4\textwidth]{\clip + [nx=2,ny=6,x=1,y=2] + {\typesetfile[columnsets-204.tex][page=3]}}} + {right page} +\stopcombination +\stoplinecorrection + +This is a typical example of the kind of optimizations that are needed when you +make documents of styles with text that spans a spread. In the next clip we +visualize the gap. + +\startlinecorrection[blank] +\startcombination + {\scale[width=.4\textwidth]{\clip + [nx=2,ny=6,x=2,y=2] + {\typesetfile[columnsets-205.tex][page=2]}}} + {left page} + {\scale[width=.4\textwidth]{\clip + [nx=2,ny=6,x=1,y=2] + {\typesetfile[columnsets-205.tex][page=3]}}} + {right page} +\stopcombination +\stoplinecorrection + +At some moment you may want to set up an area in advance as we have done in the +following example. + +\FourSpread{columnsets-206} + +The \type {page} key is used to specify the page in the column set that the area +should go into. Column set pages start numbering at~1. The \type {fixed} stands +for left or right, whatever comes first. + +\ShowFile{columnsets-206} + +\stopchapter + +\startchapter[title=Columns] + +You can use \type {\page} to go to a new page in a column set. Likewise you can +use \type {\column} to force a column break. + +\FourPages{columnsets-301} + +This example demonstrates that you can supply \type {\column} with explicit +directives. + +\ShowFile{columnsets-301} + +You can use \type {\column[page]} as an alternative for \type {\page}. + +\stopchapter + +\startchapter[title=Details] + +This chapter will cover a couple of cosmetic details of column sets. {\em Some +features need to be improved, especially in combination with areas, graphics and +alike. We will also provide side floats etc.} + +\FourSpread{columnsets-401} + +You can set the distance between columns for each pair of columns. {\em Todo: +left and right page distances and margins.} + +\ShowFile{columnsets-401} + +\page[mine] + +When you can the distance of the first column as well. This creates a margin. + +\FourSpread{columnsets-402} + +This time we used equal distances: + +\ShowFile{columnsets-402} + +\page[mine] + +The width of columns is normally calculated automatically, but you can also set +the width explicitly: + +\FourSpread{columnsets-403} + +In code: + +\ShowFile{columnsets-403} + +\page[mine] + +For special effects, you can set the width per column. In that case you need to +be aware of the fact that \TEX\ works its way through the document per paragraph. +Changing the width halfway a paragraph is possible but will affect the whole +paragraph. Therefore, this feature works best when you also goto the next column +explicitly. + +\FourSpread{columnsets-404} + +In code: + +\ShowFile{columnsets-404} + +\page[mine] + +If you really want to change the width in the middle of a paragraph, you can do a +trial run and include a breakpoint at the palce where you want it to occur: + +\FourSpread{columnsets-405} + +In the second spread you see how the narrow hsize carries on in the wider +column. A \type {\column} command will synchronize the hsize. + +\ShowFile{columnsets-405} + +% \page[mine] + +\stopchapter + +\startchapter[title=Directions] + +\FourSpread{columnsets-601} + +The direction of flushing columns is determined by the \type {direction} +parameters as demonstrated below. + +\ShowFile{columnsets-601} + +% \page[mine] + +\stopchapter + +\startchapter[title=Backgrounds] + +As with many \CONTEXT\ components, column sets can have backgrounds. + +\FourSpread{columnsets-701} + +Watch how we use the \type {each} keyword to tell \CONTEXT\ that we want to apply +the background to each column of the set. + +\ShowFile{columnsets-701} + +\page[mine] + +Normally, if you apply backgrounds this way, you will also set the background +offset. In a similar fashion you can apply backgrounds to areas and spans. Such +backgrounds can be a color, or any overlay or layer you want. + +\FourSpread{columnsets-702} + +Here we've set the background offset as well as the frame. + +\ShowFile{columnsets-702} + +\page[mine] + +When dealing with areas, you need to be aware of the fact that they are clipped, +the content as well as the background. + +\FourSpread{columnsets-703} + +De default clip offset is two times the lineheight, except in the binding, where +it is set to zero points. You can set the clip offset with the \type {clipoffset} +parameter. + +\ShowFile{columnsets-703} + +\page[mine] + +The text background mechanism is rather well adapted to column sets. The +following example is a variant on an example shown in the manual titled +{details}. + +\EightSpread{columnsets-704} + +Watch how we adapt the background to the fact and extent that the text spans one +or more columns. + +\ShowFile{columnsets-704} + +Backgrounds that follow the paragraph shape also work ok in column sets. + +{\em todo: an example of a bleeding graphic with column feed back (from +techniek)} + +% \page[mine] + +\stopchapter + +\startchapter[title=Numbering lines] + +\FourSpread{columnsets-901} + +This example shows how numbering lines in columns works out. In a two column +layout the numbers end up in the outer margins by default. If you want you can +set the \type {location} to for instance \type {left} or \type {right}. + +\ShowFile{columnsets-901} + +\page[mine] + +\FourSpread{columnsets-902} + +In a three column setup the numbers end up in the left margins.Make sure you make +the distance large enough. + +\ShowFile{columnsets-902} + +% \page[mine] +% +% \FourSpread{columnsets-903} +% +% This example shows again lune numbers but here we made sure that there is no +% stretch in the whitespace. +% +% \ShowFile{columnsets-903} + +\stopchapter + +% \startchapter[title=Spanning and More] +% +% {\em todo: explanation} \page +% +% \TwoPages{columnsets-801} \ShowFile{columnsets-801} \page[mine] +% \TwoPages{columnsets-802} \ShowFile{columnsets-802} \page[mine] +% \TwoPages{columnsets-803} \ShowFile{columnsets-803} \page[mine] +% \TwoPages{columnsets-804} \ShowFile{columnsets-804} \page[mine] +% \TwoPages{columnsets-805} \ShowFile{columnsets-805} \page[mine] +% \TwoPages{columnsets-806} \ShowFile{columnsets-806} \page[mine] +% +% \stopchapter + +\stopdocument diff --git a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex index 0507a56e0..e59e09e1e 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-modifications.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-modifications.tex @@ -67,7 +67,17 @@ most still comes from the original. But we divert a bit. \stopitem \startitem - Magnification (\type {\mag}) is only supported in \DVI\ output mode. + Magnification (\type {\mag}) is only supported in \DVI\ output mode. You can + set this parameter and it even works with \type {true} units till you switch + to \PDF\ output mode. When you use \PDF\ output you can best not touch the + \type {\mag} variable. This fuzzy behaviour is not much different from using + \PDF\ backend related functionality while eventually \DVI\ output is + required. + + After the output mode has been frozen (normally that happens when the first + page is shipped out) or when \PDF\ output is enabled, the \type {true} + specification is ignored. When you preload a plain format adapted to + \LUATEX\ it can be that the \type {\mag} parameter already has been set. \stopitemize \stopsubsection diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex index 32e641789..21ef0232d 100644 --- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex +++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex @@ -201,6 +201,26 @@ its internal link structure is correct, otherwise an error may be result. The subtype numbers~4 and~5 belong to the \quote {of-f-ice} explanation given elsewhere. +These disc nodes are kind of special as at some point they also keep information +about breakpoints and nested ligatures. The \type {pre}, \type {post} and \type +{replace} fields at the \LUA\ end are in fact indirectly accessed and have a +\type {prev} pointer that is not \type {nil}. This means that when you mess +around with the head of these (three) lists, you also need to reassign them +because that will restore the proper \type {prev} pointer, so: + +\starttyping +pre = d.pre +-- change the list starting with pre +d.pre = pre +\stoptyping + +Otherwise you can end up with an invalid internal perception of reality and +\LUATEX\ might even decide to crash on you. It also means that running forward +over for instance \type {pre} is ok but backward you need to stop at \type {pre}. +And you definitely must not mess with the node that \type {prev} points to, if +only because it is not really an node but part of the disc data structure (so +freeing it again might crash \LUATEX). + \subsubsection{math nodes} \starttabulate[|lT|l|p|] diff --git a/doc/context/sources/general/manuals/math/math-mkiv.tex b/doc/context/sources/general/manuals/math/math-mkiv.tex new file mode 100644 index 000000000..0148a8807 --- /dev/null +++ b/doc/context/sources/general/manuals/math/math-mkiv.tex @@ -0,0 +1,631 @@ +% language=uk + +\setupbodyfont + [pagella] + +\setupwhitespace + [big] + +\setuppagenumbering + [alternative=doublesided] + +\setuplayout + [backspace=2cm, + width=middle, + cutspace=2cm, + topspace=2cm, + header=2cm, + height=middle, + footer=0pt, + bottomspace=2cm] + +\usemodule[x][setups-basics] + +\usemodule[visual] + +\loadsetups[i-context] + +\starttext + +\startMPpage + +StartPage; + fill Page withcolor .35magenta ; + picture p ; p := image ( draw outlinetext.b + ("\textdollar") + (withcolor .35green) + (withcolor .5yellow withpen pencircle scaled .1) ; + ) ; + p := p xysized(PaperWidth - 20pt,PaperHeight - 20pt ) ; + p := p shifted - llcorner p shifted (10pt,10pt) ; + draw p ; + picture p ; p := image ( draw outlinetext.b + ("math") + (withcolor .35green) + (withcolor .5yellow withpen pencircle scaled .2) ; + ) ; + p := p xsized(PaperWidth/2 - 40pt) ; + p := p shifted - llcorner p shifted (10pt,10pt) ; + draw p shifted (PaperWidth/2 + 20pt,20pt); +StopPage; + +\stopMPpage + +\page[empty] \setuppagenumber[number=1] + +\setuplayout + [backspace=2cm, + topspace=2cm, + header=2cm, + height=middle, + width=middle] + +\setuphead + [chapter] + [header=high, + style=\bfc, + color=darkmagenta] + +\setuphead + [section] + [style=\bfb] + +\setuphead + [subsection] + [style=\bfa] + +\starttitle[title=Introduction] + +This manual is not a systematic discussion about math in \CONTEXT\ but more a +collection of wrap|-|ups. The file also serves as testcase. The content can +change over time and can also serve as a trigger for discussions on the mailing +list. Feel free to contribute. + +\startlines +Hans Hagen +Hasselt NL +% May 2016 +\stoplines + +\stoptitle + +\startchapter[title=Vertical spacing] + +The low level way to input inline math in \TEX\ is + +\starttyping +$ e = mc^2 $ +\stoptyping + +while display math can be entered like: + +\starttyping +$$ e = mc^2 $$ +\stoptyping + +The inline method is still valid, but for display math the \type {$$} method +should not be used. This has to do with the fact that we want to control spacing +in a consistent way. In \CONTEXT\ the vertical spacing model is rather stable +although in \MKIV\ the implementation is quite different. It has always been a +challenge to let this mechanism work well with space round display formulas. This +has to do with the fact that (in the kind of documents that we have to produce) +interaction with already present spacing is somewhat tricky. + +Of course much can be achieved in \TEX\ but in \CONTEXT\ we need to have control +over the many mechanisms that can interact. Given the way \TEX\ handles space +around display math there is no real robust solution possible that gives visually +consistent space in all cases so that is why we basically disable the existing +spacing model. Disabling is easier in \LUATEX\ and recent versions of \MKIV\ have +been adapted to that. + +In pure \TEX\ what happens is this: + +\startbuffer +$$ x $$ +\stopbuffer + +\typebuffer \par \start \showboxes \getbuffer \par \stop + +A horizontal box get added which triggers a baselineskip. Then the formula is put +below it. We can get rid of that box with \type {\noindent}: + +\startbuffer +\noindent $$ x $$ +\stopbuffer + +\typebuffer \par \start \showboxes \getbuffer \par \stop + +In addition (not shown here) vertical space is added before and after the formula +and left- and rightskip on the edges. In fact typesetting display math goes like this: + +\startitemize[packed] + \startitem + typeset the formula using display mode and wrap it in a box + \stopitem + \startitem + add an equation number, if possible in the same line, otherwise on a line + below + \stopitem + \startitem + in the process center the formula using the available display width and + required display indentation + \stopitem + \startitem + add vertical space above and below (depending also in displays being + short in relation to the previous line + \stopitem + \startitem + at the same time also add penalties that determine the break across + pages + \stopitem +\stopitemize + +Apart from the spacing around the formula and the equation number, typesetting is +not different from: + +\starttyping +\hbox {$ \displaystyle x $} +\stoptyping + +This spacing around math is a sensitive issue. Because math itself can have a +narrow band, for instance a lone $x$, or relative much depth, as with $y$, or +both depth and height as in $(1,2)$ and $x^2 + y_2$ and because a preceding line +can have no or little depth and a following line little height, the visual +appearance can become inconsistent. The default approach is to force consistent +spacing, but when needed we can implement variants. + +Spacing around display math is set up with \type {\setupformulas}: + +\starttyping + \setupformulas + [spacebefore=big, + spaceafter=big] +\stoptyping + +When the whitespace is larger that setting wins because as usual the larger +of blanks or whitespace wins. + +% \showdefinition[setupformula] +% \showdefinition[setupmathematics] + +In \in {figures} [whitespace-no], \in {figures} [whitespace-medium] \in {and} +[whitespace-big] we see how things interact. We show lines with and without +maximum line height and depth (enforced by struts) alongside. + +% no whitespace + +\startbuffer[demo-1] +\disablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=none,spaceafter=none] +\setupwhitespace[none] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-2] +\enablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=none,spaceafter=none] +\setupwhitespace[none] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-3] +\disablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=medium,spaceafter=medium] +\setupwhitespace[none] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-4] +\enablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=medium,spaceafter=medium] +\setupwhitespace[none] +\input math-spacing-001.tex +\stopbuffer + +\startplacefigure[location=page,reference=whitespace-no,title={No whitespace.}] + \startcombination[2*2] + {\typesetbuffer[demo-1][height=.45\textheight]} {\tttf natural + none + ws none} + {\typesetbuffer[demo-2][height=.45\textheight]} {\tttf strut + none + ws none} + {\typesetbuffer[demo-3][height=.45\textheight]} {\tttf natural + medium + ws none} + {\typesetbuffer[demo-4][height=.45\textheight]} {\tttf strut + medium + ws none} + \stopcombination +\stopplacefigure + +% whitespace medium same as medium spacing around math + +\startbuffer[demo-1] +\disablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=none,spaceafter=none] +\setupwhitespace[medium] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-2] +\enablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=none,spaceafter=none] +\setupwhitespace[medium] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-3] +\disablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=medium,spaceafter=medium] +\setupwhitespace[medium] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-4] +\enablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=medium,spaceafter=medium] +\setupwhitespace[medium] +\input math-spacing-001.tex +\stopbuffer + +\startplacefigure[location=page,reference=whitespace-medium,title={Whitespace the same as display spacing.}] + \startcombination[2*2] + {\typesetbuffer[demo-1][height=.45\textheight]} {\tttf natural + none + ws medium} + {\typesetbuffer[demo-2][height=.45\textheight]} {\tttf strut + none + ws medium} + {\typesetbuffer[demo-3][height=.45\textheight]} {\tttf natural + medium + ws medium} + {\typesetbuffer[demo-4][height=.45\textheight]} {\tttf strut + medium + ws medium} + \stopcombination +\stopplacefigure + +% whitespace big wins from medium spacing around math + +\startbuffer[demo-1] +\disablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=none,spaceafter=none] +\setupwhitespace[big] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-2] +\enablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=none,spaceafter=none] +\setupwhitespace[big] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-3] +\disablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=medium,spaceafter=medium] +\setupwhitespace[big] +\input math-spacing-001.tex +\stopbuffer + +\startbuffer[demo-4] +\enablemode[with-struts] +\showmakeup +\setupformulas[spacebefore=medium,spaceafter=medium] +\setupwhitespace[big] +\input math-spacing-001.tex +\stopbuffer + +\startplacefigure[location=page,reference=whitespace-big,title={Whitespace larger than display spacing.}] + \startcombination[2*2] + {\typesetbuffer[demo-1][height=.45\textheight]} {\tttf natural + none + ws big} + {\typesetbuffer[demo-2][height=.45\textheight]} {\tttf strut + none + ws big} + {\typesetbuffer[demo-3][height=.45\textheight]} {\tttf natural + medium + ws big} + {\typesetbuffer[demo-4][height=.45\textheight]} {\tttf strut + medium + ws big} + \stopcombination +\stopplacefigure + +Because we want to have control over the placement of the formula number but also +want to be able to align the formula with the left or right edge of the text +area, we don't use the native display handler by default. We still have a way to +force this, but this is only for testing purposes. By default a formula is placed +centered relative to the current text, including left and right margins. + +\startbuffer +\fakewords{20}{40} + +\startitemize + \startitem + \fakewords{20}{40} + \placeformula + \startformula + \fakeformula + \stopformula + \stopitem + \startitem + \fakewords{20}{40} + \stopitem +\stopitemize + +\fakewords{20}{40}\epar +\stopbuffer + +\typebuffer + +\start \getbuffer \stop + +In the next examples we explicitly align formulas to the left (\type +{flushleft}), center (\type {middle}) and right (\type {flushright}): + +\startbuffer[demo] +\setupformulas[align=flushleft] +\startformula\fakeformula\stopformula +\setupformulas[align=middle] +\startformula\fakeformula\stopformula +\setupformulas[align=flushright] +\startformula\fakeformula\stopformula +\stopbuffer + +\typebuffer[demo] + +The three cases show up as: + +\start \getbuffer[demo] \stop + +You can also set a left and|/|or right margin: + +\startbuffer[setting] +\setupformulas + [leftmargin=3cm, + rightmargin=3cm] +\stopbuffer + +\start \getbuffer[setting] \getbuffer[demo] \stop + +With formula numbers these formulas look as follows: + +\startbuffer[demo] +\setupformulas[align=flushleft] +\placeformula \startformula\fakeformula\stopformula +\setupformulas[align=middle] +\placeformula \startformula\fakeformula\stopformula +\setupformulas[align=flushright] +\placeformula \startformula\fakeformula\stopformula +\stopbuffer + +\start \getbuffer[demo] \stop + +and the same with margins: + +\start \getbuffer[setting] \getbuffer[demo] \stop + +\page + +When the \type {margin} option is set to \type {standard} or \type {yes} the +current indentation (when set) or left skip is added to the left side. + +\startbuffer +\setupformulas[align=flushleft] +\startformula \fakeformula \stopformula +\placeformula \startformula \fakeformula \stopformula +\stopbuffer + +\typebuffer \start \getbuffer \stop + +\startbuffer +\setupformulas[align=flushleft,margin=standard] +\startformula \fakeformula \stopformula +\placeformula \startformula \fakeformula \stopformula +\stopbuffer + +\typebuffer \start \getbuffer \stop + +The distance between the formula and the number is only applied when the formula +is left or right aligned. + +\startbuffer +\setupformulas[align=flushright,distance=0pt] +\startformula \fakeformula \stopformula +\placeformula \startformula \fakeformula \stopformula +\stopbuffer + +\typebuffer \start \getbuffer \stop + +\startbuffer +\setupformulas[align=flushright,distance=2em] +\startformula \fakeformula \stopformula +\placeformula \startformula \fakeformula \stopformula +\stopbuffer + +\typebuffer \start \getbuffer \stop + +\stopchapter + +% \startchapter[title=Numbering] + +% \stopchapter + +\startchapter[title=Framing] + +The \type {\framed} macro is one of the core constructors in \CONTEXT\ and it's +used all over the place. This macro is unlikely to change its behaviour and as it +has evolved over years it comes with quite some options and some can interfere +with the expectations one has. In general using this macro works out well but you +need to keep an eye on using struts and alignment. + +\startbuffer +\framed{$e=mc^2$} +\stopbuffer + +\typebuffer + +The outcome of this is: + +\startlinecorrection \getbuffer \stoplinecorrection + +There is a bit of offset (that you can set) but also struts are added as can be +seen when we visualize them: + +\startlinecorrection \showstruts \getbuffer \stoplinecorrection + +These struts can be disabled: + +\startbuffer +\framed[strut=no]{$e=mc^2$} +\stopbuffer + +\typebuffer + +Now the result is more tight. + +\startlinecorrection \showstruts \getbuffer \stoplinecorrection + +These struts are the way to get a consistent look and feel and are used +frequently in \CONTEXT. We mention these struts because they get in the way when +we frame a display formula. Let's first look at what happens when we +just package a formula in a box: + +\startbuffer +\vbox\bgroup + \startformula + e = mc^2 + \stopformula +\egroup +\stopbuffer + +\typebuffer + +We get: + +\startlinecorrection \start \showmakeup \getbuffer \stop \stoplinecorrection + +Now there are a few properties of displaymath that one needs to keep in mind when +messing around with them this way. First of all display math is meant to be used +as part of the page stream. This means that spacing above and below is adapted to +what comes before and after. It also means that, because formulas can be numbered, +we have some settings that relate to horizontal placement. + +The default vertical spacing is easy to get rid of: + +\startbuffer +\vbox\bgroup + \startformula[packed] + e = mc^2 + \stopformula +\egroup +\stopbuffer + +\typebuffer + +This gives: + +\startlinecorrection \start \showmakeup \getbuffer \stop \stoplinecorrection + +Another handy keyword is \type {tight}: + +\startbuffer +\vbox\bgroup + \startformula[tight] + e = mc^2 + \stopformula +\egroup +\stopbuffer + +\typebuffer + +This gives: + +\startlinecorrection \start \showmakeup \getbuffer \stop \stoplinecorrection + +We can combine these two: + +\startbuffer +\vbox\bgroup + \startformula[packed,tight] + e = mc^2 + \stopformula +\egroup +\stopbuffer + +\typebuffer + +This gives: + +\startlinecorrection \start \showmakeup \getbuffer \stop \stoplinecorrection + +Just in case you wonder why we need to go through these troubles: keep in mind +that we are wrapping something (math) that normally goes in a vertical list with +text above and below. + +The \type {packed} and \type {tight} options can help when we want to wrap +a formula in a frame: + +\startbuffer +\framed + [strut=no] + { + \startformula[packed,tight] + e = mc^2 + \stopformula + } +\stopbuffer + +\typebuffer + +which renders as: + +\startlinecorrection \getbuffer \stoplinecorrection + +There is a dedicated math framed instance that is tuned to give better results +and automatically switches to math mode: + +\startbuffer +\mframed { + e = mc^2 +} +\stopbuffer + +\typebuffer + +becomes: + +\startlinecorrection \getbuffer \stoplinecorrection + +Multiple formulas can be combined: + +\startbuffer +\startformulas + \startformula + a + b = c + \stopformula + \startformula + d - e = f + \stopformula +\stopformulas +\stopbuffer + +\typebuffer + +We might add some more control in the future, but this is what you get: + +\startlinecorrection \getbuffer \stoplinecorrection + +\stopchapter + +\stoptext + +% when we compare these tables with the one that the ff loader produces we notice +% some differences: this is because (deduced from source) that ff does some kind +% of interpolation for missing heights for the last kern (for n=2 adding 100 and +% for adding 1 the max height) ... this is probably a side effect if missing specs +% here we don't do that +% \enabledirectives[fontgoodies.mathkerning] + +% \startTEXpage[offset=2mm] +% \startcombination[4*2] +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [modern]$V_i^i = W_i^i$\hss}} {\infofont modern} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [cambria]$V_i^i = W_i^i$\hss}} {\infofont cambria} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont[lucidaot]$V_i^i = W_i^i$\hss}} {\infofont lucida} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [dejavu]$V_i^i = W_i^i$\hss}} {\infofont dejavu} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [pagella]$V_i^i = W_i^i$\hss}} {\infofont pagella} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [termes]$V_i^i = W_i^i$\hss}} {\infofont termes} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [bonum]$V_i^i = W_i^i$\hss}} {\infofont bonum} +% {\hbox to 50pt{\hss\showboxes\switchtobodyfont [schola]$V_i^i = W_i^i$\hss}} {\infofont schola} +% \stopcombination +% \stopTEXpage diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv.tex b/doc/context/sources/general/manuals/xml/xml-mkiv.tex index 42ec7df9a..3933c0063 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv.tex @@ -2747,6 +2747,83 @@ Tags like \type {t7}, \type {t8} etc.\ can represent versions. \stopsection +\startsection[title=preprocessing] + +% local match = lpeg.match +% local replacer = lpeg.replacer("BAD TITLE:","BAD TITLE:") +% +% function lxml.preprocessor(data,settings) +% return match(replacer,data) +% end + +\startbuffer[pre-code] +\startluacode + function lxml.preprocessor(data,settings) + return string.find(data,"BAD TITLE:") + and string.gsub(data,"BAD TITLE:","BAD TITLE:") + or data + end +\stopluacode +\stopbuffer + +\startbuffer[pre-xml] +\startxmlsetups pre:demo:initialize + \xmlsetsetup{#1}{*}{pre:demo:*} +\stopxmlsetups + +\xmlregisterdocumentsetup{pre:demo}{pre:demo:initialize} + +\startxmlsetups pre:demo:root + \xmlflush{#1} +\stopxmlsetups + +\startxmlsetups pre:demo:bold + \begingroup\bf\xmlflush{#1}\endgroup +\stopxmlsetups + +\starttext + \xmlprocessbuffer{pre:demo}{demo}{} +\stoptext +\stopbuffer + +Say that you have the following \XML\ setup: + +\typebuffer[pre-xml] + +and that (such things happen) the input looks like this: + +\startbuffer[demo] + +BAD TITLE: crap crap crap ... + +BAD TITLE: crap crap crap ... + +\stopbuffer + +\typebuffer[demo] + +You can then clean up these \type {BAD TITLE}'s as follows: + +\typebuffer[pre-code] + +and get as result: + +\start \getbuffer[pre-code,pre-xml] \stop + +The preprocessor function gets as second argument the current settings, an d +the field \type {currentresource} can be used to limit the actions to +specific resources, in our case it's \type {buffer: demo}. Afterwards you can +reset the proprocessor with: + +\startluacode +lxml.preprocessor = nil +\stopluacode + +Future versions might give some more control over preprocessors. For now consider +it to be a quick hack. + +\stopsection + \stopchapter \startchapter[title={Lookups using lpaths}] diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index bba8fcf65..49867488e 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -9996,7 +9996,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 56926, stripped down to: 35829 +-- original size: 57132, stripped down to: 35990 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -10775,6 +10775,10 @@ local grammar_unparsed_text=P { "preamble", local function _xmlconvert_(data,settings) settings=settings or {} preparexmlstate(settings) + local preprocessor=settings.preprocessor + if data and data~="" and type(preprocessor)=="function" then + data=preprocessor(data,settings) or data + end if settings.parent_root then mt=getmetatable(settings.parent_root) else @@ -18743,8 +18747,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 797155 --- stripped bytes : 289131 +-- original bytes : 797361 +-- stripped bytes : 289176 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index bba8fcf65..49867488e 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -9996,7 +9996,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 56926, stripped down to: 35829 +-- original size: 57132, stripped down to: 35990 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -10775,6 +10775,10 @@ local grammar_unparsed_text=P { "preamble", local function _xmlconvert_(data,settings) settings=settings or {} preparexmlstate(settings) + local preprocessor=settings.preprocessor + if data and data~="" and type(preprocessor)=="function" then + data=preprocessor(data,settings) or data + end if settings.parent_root then mt=getmetatable(settings.parent_root) else @@ -18743,8 +18747,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 797155 --- stripped bytes : 289131 +-- original bytes : 797361 +-- stripped bytes : 289176 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index bba8fcf65..49867488e 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -9996,7 +9996,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 56926, stripped down to: 35829 +-- original size: 57132, stripped down to: 35990 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -10775,6 +10775,10 @@ local grammar_unparsed_text=P { "preamble", local function _xmlconvert_(data,settings) settings=settings or {} preparexmlstate(settings) + local preprocessor=settings.preprocessor + if data and data~="" and type(preprocessor)=="function" then + data=preprocessor(data,settings) or data + end if settings.parent_root then mt=getmetatable(settings.parent_root) else @@ -18743,8 +18747,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 797155 --- stripped bytes : 289131 +-- original bytes : 797361 +-- stripped bytes : 289176 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index bba8fcf65..49867488e 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -9996,7 +9996,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-tab"] = package.loaded["lxml-tab"] or true --- original size: 56926, stripped down to: 35829 +-- original size: 57132, stripped down to: 35990 if not modules then modules={} end modules ['lxml-tab']={ version=1.001, @@ -10775,6 +10775,10 @@ local grammar_unparsed_text=P { "preamble", local function _xmlconvert_(data,settings) settings=settings or {} preparexmlstate(settings) + local preprocessor=settings.preprocessor + if data and data~="" and type(preprocessor)=="function" then + data=preprocessor(data,settings) or data + end if settings.parent_root then mt=getmetatable(settings.parent_root) else @@ -18743,8 +18747,8 @@ end -- of closure -- used libraries : l-lua.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-mrg.lua util-tpl.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 797155 --- stripped bytes : 289131 +-- original bytes : 797361 +-- stripped bytes : 289176 -- end library merge diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf index 11024640d..50c1120d2 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii index 0762fadfc..dbadca7c5 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{splitoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} +\setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{start} \setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{status} diff --git a/tex/context/base/mkii/mult-en.mkii b/tex/context/base/mkii/mult-en.mkii index a16b87a48..751235942 100644 --- a/tex/context/base/mkii/mult-en.mkii +++ b/tex/context/base/mkii/mult-en.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{splitoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} +\setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{start} \setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{state} diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii index 6c71d4aad..aff330d76 100644 --- a/tex/context/base/mkii/mult-fr.mkii +++ b/tex/context/base/mkii/mult-fr.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{splitoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} +\setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{demarre} \setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{etat} diff --git a/tex/context/base/mkii/mult-it.mkii b/tex/context/base/mkii/mult-it.mkii index a875555bd..2c7dd13e9 100644 --- a/tex/context/base/mkii/mult-it.mkii +++ b/tex/context/base/mkii/mult-it.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{splitoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} +\setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{inizia} \setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{stato} diff --git a/tex/context/base/mkii/mult-nl.mkii b/tex/context/base/mkii/mult-nl.mkii index efc0d2be3..163628a2f 100644 --- a/tex/context/base/mkii/mult-nl.mkii +++ b/tex/context/base/mkii/mult-nl.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{splitsoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stapel} +\setinterfaceconstant{stackname}{stapelnaam} \setinterfaceconstant{start}{start} \setinterfaceconstant{starter}{opener} \setinterfaceconstant{state}{status} diff --git a/tex/context/base/mkii/mult-pe.mkii b/tex/context/base/mkii/mult-pe.mkii index 7e5c53791..c2db11315 100644 --- a/tex/context/base/mkii/mult-pe.mkii +++ b/tex/context/base/mkii/mult-pe.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{شکافتن‌آفست} \setinterfaceconstant{spot}{لکه} \setinterfaceconstant{stack}{توده} +\setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{شروع} \setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{وضعیت} diff --git a/tex/context/base/mkii/mult-ro.mkii b/tex/context/base/mkii/mult-ro.mkii index f7121f703..9698bffa5 100644 --- a/tex/context/base/mkii/mult-ro.mkii +++ b/tex/context/base/mkii/mult-ro.mkii @@ -1160,6 +1160,7 @@ \setinterfaceconstant{splitoffset}{splitoffset} \setinterfaceconstant{spot}{spot} \setinterfaceconstant{stack}{stack} +\setinterfaceconstant{stackname}{stackname} \setinterfaceconstant{start}{start} \setinterfaceconstant{starter}{starter} \setinterfaceconstant{state}{stare} diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua index 77816111d..2cb2e70ee 100644 --- a/tex/context/base/mkiv/anch-pos.lua +++ b/tex/context/base/mkiv/anch-pos.lua @@ -468,6 +468,15 @@ function jobpositions.enhance(name) enhance(tobesaved[name]) end +function jobpositions.gettobesaved(name,tag) + local t = tobesaved[name] + if t and tag then + return t[tag] + else + return t + end +end + -- scanners.pos = function(name,t) -- name t -- local name = scanstring() -- tobesaved[name] = scanstring() diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index 4c62d968e..6e7b66a5b 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{2016.05.31 09:02} +\newcontextversion{2016.06.02 21:28} %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-todo.tex b/tex/context/base/mkiv/context-todo.tex index 0e69b3df8..4df9dc816 100644 --- a/tex/context/base/mkiv/context-todo.tex +++ b/tex/context/base/mkiv/context-todo.tex @@ -9,9 +9,6 @@ \subsubject{\LUATEX} \startitemize - \startitem - head||tail cleanup in disc nodes (get rid of temp i.e.\ delay till linebreak) - \stopitem \startitem cleanup passive nodes \stopitem @@ -46,6 +43,9 @@ \startitem play with par callback and properties \stopitem + \startitem + add flag to font for math engine + \stopitem \startitem get rid of components \stopitem diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 66946af45..06455ca91 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -39,7 +39,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2016.05.31 09:02} +\edef\contextversion{2016.06.02 21:28} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua index 61e8c8179..7ab11ffb0 100644 --- a/tex/context/base/mkiv/font-ext.lua +++ b/tex/context/base/mkiv/font-ext.lua @@ -36,6 +36,7 @@ local fontdata = hashes.identifiers local allocate = utilities.storage.allocate local settings_to_array = utilities.parsers.settings_to_array local getparameters = utilities.parsers.getparameters +local gettexdimen = tex.getdimen local setmetatableindex = table.setmetatableindex @@ -625,12 +626,20 @@ local function manipulatedimensions(tfmdata,key,value) if type(value) == "string" and value ~= "" then local characters = tfmdata.characters local parameters = tfmdata.parameters - local emwidth = parameters.quad - local exheight = parameters.xheight - local spec = settings_to_array(value) - local width = (spec[1] or 0) * emwidth - local height = (spec[2] or 0) * exheight - local depth = (spec[3] or 0) * exheight + local emwidth = parameters.quad + local exheight = parameters.xheight + local width = 0 + local height = 0 + local depth = 0 + if value == "strut" then + height = gettexdimen("strutht") + depth = gettexdimen("strutdp") + else + local spec = settings_to_array(value) + width = (spec[1] or 0) * emwidth + height = (spec[2] or 0) * exheight + depth = (spec[3] or 0) * exheight + end if width > 0 then local resources = tfmdata.resources local additions = { } @@ -687,7 +696,7 @@ local function manipulatedimensions(tfmdata,key,value) elseif height > 0 and depth > 0 then for unicode, old_c in next, characters do old_c.height = height - old_c.depth = depth + old_c.depth = depth end elseif height > 0 then for unicode, old_c in next, characters do diff --git a/tex/context/base/mkiv/font-gds.lua b/tex/context/base/mkiv/font-gds.lua deleted file mode 100644 index c24bef315..000000000 --- a/tex/context/base/mkiv/font-gds.lua +++ /dev/null @@ -1,941 +0,0 @@ -if not modules then modules = { } end modules ['font-gds'] = { - version = 1.000, - comment = "companion to font-gds.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- depends on ctx - -local type, next, tonumber = type, next, tonumber -local gmatch, lower, find, splitup = string.gmatch, string.lower, string.find, string.splitup - -local fonts = fonts -local nodes = nodes -local attributes = attributes -local node = node - -local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) -local report_goodies = logs.reporter("fonts","goodies") - -local allocate = utilities.storage.allocate -local setmetatableindex = table.setmetatableindex - -local implement = interfaces.implement - -local texsp = tex.sp -local formatters = string.formatters - -local otf = fonts.handlers.otf -local afm = fonts.handlers.afm -local tfm = fonts.handlers.tfm - -local registerotffeature = otf.features.register -local registerafmfeature = afm.features.register -local registertfmfeature = tfm.features.register - -local fontgoodies = fonts.goodies or { } -fonts.goodies = fontgoodies - -local typefaces = fonts.typefaces or allocate() -fonts.typefaces = typefaces - -local data = fontgoodies.data or allocate() -fontgoodies.data = data - -local list = fontgoodies.list or { } -fontgoodies.list = list -- no allocate as we want to see what is there - -local addotffeature = otf.enhancers.addfeature - -local findfile = resolvers.findfile - -local glyph_code = nodes.nodecodes.glyph - -local nuts = nodes.nuts -local tonut = nuts.tonut -local getfont = nuts.getfont -local getchar = nuts.getchar -local getattr = nuts.getattr -local traverse_id = nuts.traverse_id - -function fontgoodies.report(what,trace,goodies) - if trace_goodies or trace then - local whatever = goodies[what] - if whatever then - report_goodies("goodie %a found in %a",what,goodies.name) - end - end -end - -local function loadgoodies(filename) -- maybe a merge is better - local goodies = data[filename] -- we assume no suffix is given - if goodies ~= nil then - -- found or tagged unfound - elseif type(filename) == "string" then - local fullname = findfile(file.addsuffix(filename,"lfg")) or "" -- prefered suffix - if fullname == "" then - fullname = findfile(file.addsuffix(filename,"lua")) or "" -- fallback suffix - end - if fullname == "" then - report_goodies("goodie file '%s.lfg' is not found",filename) - data[filename] = false -- signal for not found - else - goodies = dofile(fullname) or false - if not goodies then - report_goodies("goodie file %a is invalid",fullname) - return nil - elseif trace_goodies then - report_goodies("goodie file %a is loaded",fullname) - end - goodies.name = goodies.name or "no name" - for name, fnc in next, list do - if trace_goodies then - report_goodies("handling goodie %a",name) - end - fnc(goodies) - end - goodies.initialized = true - data[filename] = goodies - end - end - return goodies -end - -function fontgoodies.register(name,fnc) -- will be a proper sequencer - list[name] = fnc -end - -fontgoodies.load = loadgoodies - --- register goodies file - -local function setgoodies(tfmdata,value) - local goodies = tfmdata.goodies - if not goodies then -- actually an error - goodies = { } - tfmdata.goodies = goodies - end - for filename in gmatch(value,"[^, ]+") do - -- we need to check for duplicates - local ok = loadgoodies(filename) - if ok then - if trace_goodies then - report_goodies("assigning goodie %a",filename) - end - goodies[#goodies+1] = ok - end - end -end - --- this will be split into good-* files and this file might become good-ini.lua - --- featuresets - -local function flattenedfeatures(t,tt) - -- first set value dominates - local tt = tt or { } - for i=1,#t do - local ti = t[i] - if type(ti) == "table" then - flattenedfeatures(ti,tt) - elseif tt[ti] == nil then - tt[ti] = true - end - end - for k, v in next, t do - if type(k) ~= "number" then -- not tonumber(k) - if type(v) == "table" then - flattenedfeatures(v,tt) - elseif tt[k] == nil then - tt[k] = v - end - end - end - return tt -end - --- fonts.features.flattened = flattenedfeatures - -local function prepare_features(goodies,name,set) - if set then - local ff = flattenedfeatures(set) - local fullname = goodies.name .. "::" .. name - local n, s = fonts.specifiers.presetcontext(fullname,"",ff) - goodies.featuresets[name] = s -- set - if trace_goodies then - report_goodies("feature set %a gets number %a and name %a",name,n,fullname) - end - return n - end -end - -fontgoodies.prepare_features = prepare_features - -local function initialize(goodies) - local featuresets = goodies.featuresets - if featuresets then - if trace_goodies then - report_goodies("checking featuresets in %a",goodies.name) - end - for name, set in next, featuresets do - prepare_features(goodies,name,set) - end - end -end - -fontgoodies.register("featureset",initialize) - -local function setfeatureset(tfmdata,set,features) - local goodies = tfmdata.goodies -- shared ? - if goodies then - local properties = tfmdata.properties - local what - for i=1,#goodies do - -- last one wins - local g = goodies[i] - what = g.featuresets and g.featuresets[set] or what - end - if what then - for feature, value in next, what do - if features[feature] == nil then - features[feature] = value - end - end - properties.mode = what.mode or properties.mode - end - end -end - --- postprocessors (we could hash processor and share code) - -function fontgoodies.registerpostprocessor(tfmdata,f,prepend) - local postprocessors = tfmdata.postprocessors - if not postprocessors then - tfmdata.postprocessors = { f } - elseif prepend then - table.insert(postprocessors,f,1) - else - table.insert(postprocessors,f) - end -end - -local function setpostprocessor(tfmdata,processor) - local goodies = tfmdata.goodies - if goodies and type(processor) == "string" then - local found = { } - local asked = utilities.parsers.settings_to_array(processor) - for i=1,#goodies do - local g = goodies[i] - local p = g.postprocessors - if p then - for i=1,#asked do - local a = asked[i] - local f = p[a] - if type(f) == "function" then - found[a] = f - end - end - end - end - local postprocessors = tfmdata.postprocessors or { } - for i=1,#asked do - local a = asked[i] - local f = found[a] - if f then - postprocessors[#postprocessors+1] = f - end - end - if #postprocessors > 0 then - tfmdata.postprocessors = postprocessors - end - end -end - --- colorschemes - -local colorschemes = fontgoodies.colorschemes or allocate { } -fontgoodies.colorschemes = colorschemes -colorschemes.data = colorschemes.data or { } - -local function setcolorscheme(tfmdata,scheme) - if type(scheme) == "string" then - local goodies = tfmdata.goodies - -- todo : check for already defined in shared - if goodies then - local what - for i=1,#goodies do - -- last one counts - local g = goodies[i] - what = g.colorschemes and g.colorschemes[scheme] or what - end - if type(what) == "table" then - -- this is font bound but we can share them if needed - -- just as we could hash the conversions (per font) - local hash = tfmdata.resources.unicodes - local reverse = { } - local characters = tfmdata.characters - for i=1,#what do - local w = what[i] - for j=1,#w do - local name = w[j] - if name == "*" then - -- inefficient but only used for tracing anyway - for _, unicode in next, hash do - reverse[unicode] = i - end - elseif type(name) == "number" then - reverse[name] = i - elseif find(name,":",1,true) then - local start, stop = splitup(name,":") - start = tonumber(start) - stop = tonumber(stop) - if start and stop then - -- limited usage: we only deal with non reassigned - -- maybe some day I'll also support the ones with a - -- tounicode in this range - for unicode=start,stop do - if characters[unicode] then - reverse[unicode] = i - end - end - end - else - local unicode = hash[name] - if unicode then - reverse[unicode] = i - end - end - end - end - tfmdata.properties.colorscheme = reverse - return - end - end - end - tfmdata.properties.colorscheme = false -end - -local fontproperties = fonts.hashes.properties - -local a_colorscheme = attributes.private('colorscheme') -local setnodecolor = nodes.tracers.colors.set - --- function colorschemes.coloring(head) --- local lastfont, lastscheme --- local done = false --- for n in traverse_id(glyph_code,tonut(head)) do --- local a = getattr(n,a_colorscheme) --- if a then --- local f = getfont(n) --- if f ~= lastfont then --- lastscheme = fontproperties[f].colorscheme --- lastfont = f --- end --- if lastscheme then --- local sc = lastscheme[getchar(n)] --- if sc then --- done = true --- setnodecolor(n,"colorscheme:"..a..":"..sc) -- slow --- end --- end --- end --- end --- return head, done --- end - --- seldom used, mostly in manuals, so non critical .. anyhow, somewhat faster: - --- function colorschemes.coloring(head) --- local lastfont = nil --- local lastattr = nil --- local lastscheme = nil --- local lastprefix = nil --- local done = nil --- for n in traverse_id(glyph_code,tonut(head)) do --- local a = getattr(n,a_colorscheme) --- if a then --- if a ~= lastattr then --- lastattr = a --- lastprefix = "colorscheme:" .. a .. ":" --- end --- local f = getfont(n) --- if f ~= lastfont then --- lastfont = f --- lastscheme = fontproperties[f].colorscheme --- end --- if lastscheme then --- local sc = lastscheme[getchar(n)] --- if sc then --- setnodecolor(n,lastprefix .. sc) -- slow --- done = true --- end --- end --- end --- end --- return head, done --- end - --- ok, in case we have hundreds of pages colored: - -local cache = { } -- this could be a weak table - -setmetatableindex(cache,function(t,a) - local v = { } - setmetatableindex(v,function(t,c) - local v = "colorscheme:" .. a .. ":" .. c - t[c] = v - return v - end) - t[a]= v - return v -end) - -function colorschemes.coloring(head) - local lastfont = nil - local lastattr = nil - local lastcache = nil - local lastscheme = nil - local done = nil - for n in traverse_id(glyph_code,tonut(head)) do - local a = getattr(n,a_colorscheme) - if a then - local f = getfont(n) - if f ~= lastfont then - lastfont = f - lastscheme = fontproperties[f].colorscheme - end - if a ~= lastattr then - lastattr = a - lastcache = cache[a] - end - if lastscheme then - local sc = lastscheme[getchar(n)] - if sc then - setnodecolor(n,lastcache[sc]) -- we could inline this one - done = true - end - end - end - end - return head, done -end - -function colorschemes.enable() - nodes.tasks.appendaction("processors","fonts","fonts.goodies.colorschemes.coloring") - function colorschemes.enable() end -end - -local function setextrafeatures(tfmdata) - local goodies = tfmdata.goodies - if goodies then - for i=1,#goodies do - local g = goodies[i] - local f = g.features - if f then - for feature, specification in next, f do - addotffeature(tfmdata.shared.rawdata,feature,specification) - registerotffeature { - name = feature, - description = formatters["extra: %s"](feature) - } - end - end - end - end -end - -local function setextensions(tfmdata) - local goodies = tfmdata.goodies - if goodies then - for i=1,#goodies do - local g = goodies[i] - local e = g.extensions - if e then - local goodie = g.name or "unknown" - for i=1,#e do - local name = "extension-" .. i - -- report_goodies("adding extension %s from %s",name,goodie) - otf.enhancers.addfeature(tfmdata.shared.rawdata,name,e[i]) - end - end - end - end -end - --- installation - -local goodies_specification = { - name = "goodies", - description = "goodies on top of built in features", - initializers = { - position = 1, - base = setgoodies, - node = setgoodies, - } -} - -registerotffeature(goodies_specification) -registerafmfeature(goodies_specification) -registertfmfeature(goodies_specification) - --- maybe more of the following could be for type one too - -registerotffeature { - name = "extrafeatures", - description = "extra features", - default = true, - initializers = { - position = 2, - base = setextrafeatures, - node = setextrafeatures, - } -} - -registerotffeature { - name = "extensions", - description = "extensions to features", - default = true, - initializers = { - position = 2, - base = setextensions, - node = setextensions, - } -} - -registerotffeature { - name = "featureset", - description = "goodie feature set", - initializers = { - position = 3, - base = setfeatureset, - node = setfeatureset, - } -} - -registerotffeature { - name = "colorscheme", - description = "goodie color scheme", - initializers = { - base = setcolorscheme, - node = setcolorscheme, - } -} - -registerotffeature { - name = "postprocessor", - description = "goodie postprocessor", - initializers = { - base = setpostprocessor, - node = setpostprocessor, - } -} - --- experiment, we have to load the definitions immediately as they precede --- the definition so they need to be initialized in the typescript - -local function initialize(goodies) - local mathgoodies = goodies.mathematics - if mathgoodies then - local virtuals = mathgoodies.virtuals - local mapfiles = mathgoodies.mapfiles - local maplines = mathgoodies.maplines - if virtuals then - for name, specification in next, virtuals do - -- beware, they are all constructed - mathematics.makefont(name,specification,goodies) - end - end - if mapfiles then - for i=1,#mapfiles do - fonts.mappings.loadfile(mapfiles[i]) -- todo: backend function - end - end - if maplines then - for i=1,#maplines do - fonts.mappings.loadline(maplines[i]) -- todo: backend function - end - end - end -end - -fontgoodies.register("mathematics", initialize) - --- the following takes care of explicit file specifications --- --- files = { --- name = "antykwapoltawskiego", --- list = { --- ["AntPoltLtCond-Regular.otf"] = { --- -- name = "antykwapoltawskiego", --- style = "regular", --- weight = "light", --- width = "condensed", --- }, --- }, --- } - --- math italics (not rteally needed) --- --- it would be nice to have a \noitalics\font option - -local function initialize(tfmdata) - local goodies = tfmdata.goodies - if goodies then - local shared = tfmdata.shared - for i=1,#goodies do - local mathgoodies = goodies[i].mathematics - if mathgoodies then - local mathitalics = mathgoodies.italics - if mathitalics then - local properties = tfmdata.properties - if properties.setitalics then - mathitalics = mathitalics[file.nameonly(properties.name)] or mathitalics - if mathitalics then - if trace_goodies then - report_goodies("loading mathitalics for font %a",properties.name) - end - local corrections = mathitalics.corrections - local defaultfactor = mathitalics.defaultfactor - -- properties.mathitalic_defaultfactor = defaultfactor -- we inherit outer one anyway (name will change) - if corrections then - fontgoodies.registerpostprocessor(tfmdata, function(tfmdata) -- this is another tfmdata (a copy) - -- better make a helper so that we have less code being defined - local properties = tfmdata.properties - local parameters = tfmdata.parameters - local characters = tfmdata.characters - properties.mathitalic_defaultfactor = defaultfactor - properties.mathitalic_defaultvalue = defaultfactor * parameters.quad - if trace_goodies then - report_goodies("assigning mathitalics for font %a",properties.name) - end - local quad = parameters.quad - local hfactor = parameters.hfactor - for k, v in next, corrections do - local c = characters[k] - if c then - if v > -1 and v < 1 then - c.italic = v * quad - else - c.italic = v * hfactor - end - else - report_goodies("invalid mathitalics entry %U for font %a",k,properties.name) - end - end - end) - end - return -- maybe not as these can accumulate - end - end - end - end - end - end -end - -registerotffeature { - name = "mathitalics", - description = "additional math italic corrections", - -- default = true, - initializers = { - base = initialize, - node = initialize, - } -} - --- fontgoodies.register("mathitalics", initialize) - --- files - -local function initialize(goodies) - local files = goodies.files - if files then - fonts.names.register(files) - end -end - -fontgoodies.register("files", initialize) - --- some day we will have a define command and then we can also do some --- proper tracing --- --- fonts.typefaces["antykwapoltawskiego-condensed"] = { --- shortcut = "rm", --- shape = "serif", --- fontname = "antykwapoltawskiego", --- normalweight = "light", --- boldweight = "medium", --- width = "condensed", --- size = "default", --- features = "default", --- } - -local function initialize(goodies) - local typefaces = goodies.typefaces - if typefaces then - local ft = fonts.typefaces - for k, v in next, typefaces do - ft[k] = v - end - end -end - -fontgoodies.register("typefaces", initialize) - -local compositions = { } - -function fontgoodies.getcompositions(tfmdata) - return compositions[file.nameonly(tfmdata.properties.filename or "")] -end - -local function initialize(goodies) - local gc = goodies.compositions - if gc then - for k, v in next, gc do - compositions[k] = v - end - end -end - -fontgoodies.register("compositions", initialize) - --- extra treatments (on top of defaults): \loadfontgoodies[mytreatments] - -local treatmentdata = fonts.treatments.data - -local function initialize(goodies) - local treatments = goodies.treatments - if treatments then - for name, data in next, treatments do - treatmentdata[name] = data -- always wins - end - end -end - -fontgoodies.register("treatments", initialize) - -local filenames = fontgoodies.filenames or allocate() -fontgoodies.filenames = filenames - -local filedata = filenames.data or allocate() -filenames.data = filedata - -local function initialize(goodies) -- design sizes are registered global - local fn = goodies.filenames - if fn then - for usedname, alternativenames in next, fn do - filedata[usedname] = alternativenames - end - end -end - -fontgoodies.register("filenames", initialize) - -function fontgoodies.filenames.resolve(name) - local fd = filedata[name] - if fd and findfile(name) == "" then - for i=1,#fd do - local fn = fd[i] - if findfile(fn) ~= "" then - return fn - end - end - else - -- no lookup, just use the regular mechanism - end - return name -end - -local designsizes = fontgoodies.designsizes or allocate() -fontgoodies.designsizes = designsizes - -local designdata = designsizes.data or allocate() -designsizes.data = designdata - -local function initialize(goodies) -- design sizes are registered global - local gd = goodies.designsizes - if gd then - for name, data in next, gd do - local ranges = { } - for size, file in next, data do - if size ~= "default" then - ranges[#ranges+1] = { texsp(size), file } -- also lower(file) - end - end - table.sort(ranges,function(a,b) return a[1] < b[1] end) - designdata[lower(name)] = { -- overloads, doesn't merge! - default = data.default, - ranges = ranges, - } - end - end -end - -fontgoodies.register("designsizes", initialize) - -function fontgoodies.designsizes.register(name,size,specification) - local d = designdata[name] - if not d then - d = { - ranges = { }, - default = nil, -- so we have no default set - } - designdata[name] = d - end - if size == "default" then - d.default = specification - else - if type(size) == "string" then - size = texsp(size) -- hm - end - local ranges = d.ranges - ranges[#ranges+1] = { size, specification } - end -end - -function fontgoodies.designsizes.filename(name,spec,size) -- returns nil of no match - local data = designdata[lower(name)] - if data then - if not spec or spec == "" or spec == "default" then - return data.default - elseif spec == "auto" then - local ranges = data.ranges - if ranges then - for i=1,#ranges do - local r = ranges[i] - if r[1] >= size then -- todo: rounding so maybe size - 100 - return r[2] - end - end - end - return data.default or (ranges and ranges[#ranges][2]) - end - end -end - --- The following file (husayni.lfg) is the experimental setup that we used --- for Idris font. For the moment we don't store this in the cache and quite --- probably these files sit in one of the paths: --- --- tex/context/fonts/goodies --- tex/fonts/goodies/context --- tex/fonts/data/foundry/collection --- --- see lfg files in distribution - --- interface - -implement { - name = "loadfontgoodies", - actions = fontgoodies.load, - arguments = "string", - overload = true, -- for now, permits new font loader -} - -implement { - name = "enablefontcolorschemes", - onlyonce = true, - actions = colorschemes.enable, - overload = true, -- for now, permits new font loader -} - --- weird place ... depends on math - -local function finalize(tfmdata,feature,value) - mathematics.overloaddimensions(tfmdata,tfmdata,value) -end - -registerotffeature { - name = "mathdimensions", - description = "manipulate math dimensions", - -- default = true, - manipulators = { - base = finalize, - node = finalize, - } -} - -local enabled = false directives.register("fontgoodies.mathkerning",function(v) enabled = v end) - -local function initialize(tfmdata) - if enabled and tfmdata.mathparameters then -- funny, cambria text has this - local goodies = tfmdata.goodies - if goodies then - local characters = tfmdata.characters - if characters[0x1D44E] then -- 119886 - -- we have at least an italic a - for i=1,#goodies do - local mathgoodies = goodies[i].mathematics - if mathgoodies then - local kerns = mathgoodies.kerns - if kerns then - for unicode, specification in next, kerns do - local chardata = characters[unicode] - if chardata and (not chardata.mathkerns or specification.force) then - chardata.mathkerns = specification - end - end - return - end - end - end - else - return -- no proper math font anyway - end - end - end -end - -registerotffeature { - name = "mathkerns", - description = "math kerns", - default = true, - initializers = { - base = initialize, - node = initialize, - } -} - --- kern hackery: --- --- yes : use goodies table --- auto : assume features to be set (often ccmp only) - -local function setkeepligatures(tfmdata) - if not tfmdata.properties.keptligatures then - local goodies = tfmdata.goodies - if goodies then - for i=1,#goodies do - local g = goodies[i] - local letterspacing = g.letterspacing - if letterspacing then - local keptligatures = letterspacing.keptligatures - if keptligatures then - local unicodes = tfmdata.resources.unicodes -- so we accept names - local hash = { } - for k, v in next, keptligatures do - local u = unicodes[k] - if u then - hash[u] = true - else - -- error: unknown name - end - end - tfmdata.properties.keptligatures = hash - end - end - end - end - end -end - -registerotffeature { - name = "keepligatures", - description = "keep ligatures in letterspacing", - initializers = { - base = setkeepligatures, - node = setkeepligatures, - } -} diff --git a/tex/context/base/mkiv/font-lib.mkvi b/tex/context/base/mkiv/font-lib.mkvi index fd6f70d69..d13de4b3e 100644 --- a/tex/context/base/mkiv/font-lib.mkvi +++ b/tex/context/base/mkiv/font-lib.mkvi @@ -76,7 +76,11 @@ \registerctxluafile{font-vf} {1.001} \registerctxluafile{font-enh}{1.001} -\registerctxluafile{font-gds}{1.001} +%registerctxluafile{font-gds}{1.001} +\registerctxluafile{good-ini}{1.001} +\registerctxluafile{good-gen}{1.001} +\registerctxluafile{good-ctx}{1.001} +\registerctxluafile{good-mth}{1.001} \registerctxluafile{font-def}{1.001} \registerctxluafile{font-ctx}{1.001} % after def as it overloads diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua index 0db30c646..d1408fd52 100644 --- a/tex/context/base/mkiv/font-otj.lua +++ b/tex/context/base/mkiv/font-otj.lua @@ -24,6 +24,8 @@ if not modules then modules = { } end modules ['font-otj'] = { -- The use_advance code is just a test and is meant for testing and manuals. There is no -- performance (or whatever) gain and using kerns is somewhat cleaner (at least for now). +-- Maybe: subtype fontkern when pure kerns. + if not nodes.properties then return end local next, rawget = next, rawget diff --git a/tex/context/base/mkiv/font-sel.lua b/tex/context/base/mkiv/font-sel.lua index 02dc9e686..4620319f5 100644 --- a/tex/context/base/mkiv/font-sel.lua +++ b/tex/context/base/mkiv/font-sel.lua @@ -70,7 +70,7 @@ local report_selectfont = logs.reporter("selectfont") local report_files = logs.reporter("selectfont","files") local report_features = logs.reporter("selectfont","features") local report_goodies = logs.reporter("selectfont","goodies") -local report_alternatives = logs.reporter("selectfont","alternatives") +----- report_alternatives = logs.reporter("selectfont","alternatives") local report_typescript = logs.reporter("selectfont","typescripts") defaults["rm"] = { features = { ["sc"] = "*,f:smallcaps" } } @@ -919,4 +919,4 @@ implement { name = "definefontfamilypreset", actions = selectfont.definefontfamilypreset, arguments = { "string", "string" } -} \ No newline at end of file +} diff --git a/tex/context/base/mkiv/good-ctx.lua b/tex/context/base/mkiv/good-ctx.lua new file mode 100644 index 000000000..4c8b9fcff --- /dev/null +++ b/tex/context/base/mkiv/good-ctx.lua @@ -0,0 +1,275 @@ +if not modules then modules = { } end modules ['good-ctx'] = { + version = 1.000, + comment = "companion to font-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- depends on ctx + +local type, next, tonumber = type, next, tonumber +local find, splitup = string.find, string.splitup + +local fonts = fonts +local nodes = nodes +local attributes = attributes + +----- trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) +----- report_goodies = logs.reporter("fonts","goodies") + +local allocate = utilities.storage.allocate +local setmetatableindex = table.setmetatableindex + +local implement = interfaces.implement + +local registerotffeature = fonts.handlers.otf.features.register +----- registerafmfeature = fonts.handlers.afm.features.register +----- registertfmfeature = fonts.handlers.tfm.features.register + +local fontgoodies = fonts.goodies or { } + +local glyph_code = nodes.nodecodes.glyph + +local nuts = nodes.nuts +local tonut = nuts.tonut +local getfont = nuts.getfont +local getchar = nuts.getchar +local getattr = nuts.getattr +local traverse_id = nuts.traverse_id + +-- colorschemes + +local colorschemes = fontgoodies.colorschemes or allocate { } +fontgoodies.colorschemes = colorschemes +colorschemes.data = colorschemes.data or { } + +local function setcolorscheme(tfmdata,scheme) + if type(scheme) == "string" then + local goodies = tfmdata.goodies + -- todo : check for already defined in shared + if goodies then + local what + for i=1,#goodies do + -- last one counts + local g = goodies[i] + what = g.colorschemes and g.colorschemes[scheme] or what + end + if type(what) == "table" then + -- this is font bound but we can share them if needed + -- just as we could hash the conversions (per font) + local hash = tfmdata.resources.unicodes + local reverse = { } + local characters = tfmdata.characters + for i=1,#what do + local w = what[i] + for j=1,#w do + local name = w[j] + if name == "*" then + -- inefficient but only used for tracing anyway + for _, unicode in next, hash do + reverse[unicode] = i + end + elseif type(name) == "number" then + reverse[name] = i + elseif find(name,":",1,true) then + local start, stop = splitup(name,":") + start = tonumber(start) + stop = tonumber(stop) + if start and stop then + -- limited usage: we only deal with non reassigned + -- maybe some day I'll also support the ones with a + -- tounicode in this range + for unicode=start,stop do + if characters[unicode] then + reverse[unicode] = i + end + end + end + else + local unicode = hash[name] + if unicode then + reverse[unicode] = i + end + end + end + end + tfmdata.properties.colorscheme = reverse + return + end + end + end + tfmdata.properties.colorscheme = false +end + +local fontproperties = fonts.hashes.properties + +local a_colorscheme = attributes.private('colorscheme') +local setnodecolor = nodes.tracers.colors.set + +-- function colorschemes.coloring(head) +-- local lastfont, lastscheme +-- local done = false +-- for n in traverse_id(glyph_code,tonut(head)) do +-- local a = getattr(n,a_colorscheme) +-- if a then +-- local f = getfont(n) +-- if f ~= lastfont then +-- lastscheme = fontproperties[f].colorscheme +-- lastfont = f +-- end +-- if lastscheme then +-- local sc = lastscheme[getchar(n)] +-- if sc then +-- done = true +-- setnodecolor(n,"colorscheme:"..a..":"..sc) -- slow +-- end +-- end +-- end +-- end +-- return head, done +-- end + +-- seldom used, mostly in manuals, so non critical .. anyhow, somewhat faster: + +-- function colorschemes.coloring(head) +-- local lastfont = nil +-- local lastattr = nil +-- local lastscheme = nil +-- local lastprefix = nil +-- local done = nil +-- for n in traverse_id(glyph_code,tonut(head)) do +-- local a = getattr(n,a_colorscheme) +-- if a then +-- if a ~= lastattr then +-- lastattr = a +-- lastprefix = "colorscheme:" .. a .. ":" +-- end +-- local f = getfont(n) +-- if f ~= lastfont then +-- lastfont = f +-- lastscheme = fontproperties[f].colorscheme +-- end +-- if lastscheme then +-- local sc = lastscheme[getchar(n)] +-- if sc then +-- setnodecolor(n,lastprefix .. sc) -- slow +-- done = true +-- end +-- end +-- end +-- end +-- return head, done +-- end + +-- ok, in case we have hundreds of pages colored: + +local cache = { } -- this could be a weak table + +setmetatableindex(cache,function(t,a) + local v = { } + setmetatableindex(v,function(t,c) + local v = "colorscheme:" .. a .. ":" .. c + t[c] = v + return v + end) + t[a]= v + return v +end) + +function colorschemes.coloring(head) + local lastfont = nil + local lastattr = nil + local lastcache = nil + local lastscheme = nil + local done = nil + for n in traverse_id(glyph_code,tonut(head)) do + local a = getattr(n,a_colorscheme) + if a then + local f = getfont(n) + if f ~= lastfont then + lastfont = f + lastscheme = fontproperties[f].colorscheme + end + if a ~= lastattr then + lastattr = a + lastcache = cache[a] + end + if lastscheme then + local sc = lastscheme[getchar(n)] + if sc then + setnodecolor(n,lastcache[sc]) -- we could inline this one + done = true + end + end + end + end + return head, done +end + +function colorschemes.enable() + nodes.tasks.appendaction("processors","fonts","fonts.goodies.colorschemes.coloring") + function colorschemes.enable() end +end + +registerotffeature { + name = "colorscheme", + description = "goodie color scheme", + initializers = { + base = setcolorscheme, + node = setcolorscheme, + } +} + +-- kern hackery: +-- +-- yes : use goodies table +-- auto : assume features to be set (often ccmp only) + +local function setkeepligatures(tfmdata) + if not tfmdata.properties.keptligatures then + local goodies = tfmdata.goodies + if goodies then + for i=1,#goodies do + local g = goodies[i] + local letterspacing = g.letterspacing + if letterspacing then + local keptligatures = letterspacing.keptligatures + if keptligatures then + local unicodes = tfmdata.resources.unicodes -- so we accept names + local hash = { } + for k, v in next, keptligatures do + local u = unicodes[k] + if u then + hash[u] = true + else + -- error: unknown name + end + end + tfmdata.properties.keptligatures = hash + end + end + end + end + end +end + +registerotffeature { + name = "keepligatures", + description = "keep ligatures in letterspacing", + initializers = { + base = setkeepligatures, + node = setkeepligatures, + } +} + +if implement then + + implement { + name = "enablefontcolorschemes", + onlyonce = true, + actions = colorschemes.enable, + overload = true, -- for now, permits new font loader + } + +end diff --git a/tex/context/base/mkiv/good-gen.lua b/tex/context/base/mkiv/good-gen.lua new file mode 100644 index 000000000..cee6b3172 --- /dev/null +++ b/tex/context/base/mkiv/good-gen.lua @@ -0,0 +1,208 @@ +if not modules then modules = { } end modules ['good-gen'] = { + version = 1.000, + comment = "companion to font-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- depends on ctx + +local type, next = type, next +local lower = string.lower + +local fonts = fonts + +----- trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) +----- report_goodies = logs.reporter("fonts","goodies") + +local allocate = utilities.storage.allocate +local texsp = tex.sp +local fontgoodies = fonts.goodies or { } +local findfile = resolvers.findfile + + +local typefaces = fonts.typefaces or { } +fonts.typefaces = typefaces + +-- the following takes care of explicit file specifications +-- +-- files = { +-- name = "antykwapoltawskiego", +-- list = { +-- ["AntPoltLtCond-Regular.otf"] = { +-- -- name = "antykwapoltawskiego", +-- style = "regular", +-- weight = "light", +-- width = "condensed", +-- }, +-- }, +-- } + +-- files + +local function initialize(goodies) + local files = goodies.files + if files then + fonts.names.register(files) + end +end + +fontgoodies.register("files", initialize) + +-- some day we will have a define command and then we can also do some +-- proper tracing +-- +-- fonts.typefaces["antykwapoltawskiego-condensed"] = { +-- shortcut = "rm", +-- shape = "serif", +-- fontname = "antykwapoltawskiego", +-- normalweight = "light", +-- boldweight = "medium", +-- width = "condensed", +-- size = "default", +-- features = "default", +-- } + +local function initialize(goodies) + local typefaces = goodies.typefaces + if typefaces then + local ft = fonts.typefaces + for k, v in next, typefaces do + ft[k] = v + end + end +end + +fontgoodies.register("typefaces", initialize) + +local compositions = { } + +function fontgoodies.getcompositions(tfmdata) + return compositions[file.nameonly(tfmdata.properties.filename or "")] +end + +local function initialize(goodies) + local gc = goodies.compositions + if gc then + for k, v in next, gc do + compositions[k] = v + end + end +end + +fontgoodies.register("compositions", initialize) + +-- extra treatments (on top of defaults): \loadfontgoodies[mytreatments] + +local treatmentdata = fonts.treatments.data + +local function initialize(goodies) + local treatments = goodies.treatments + if treatments then + for name, data in next, treatments do + treatmentdata[name] = data -- always wins + end + end +end + +fontgoodies.register("treatments", initialize) + +local filenames = fontgoodies.filenames or allocate() +fontgoodies.filenames = filenames + +local filedata = filenames.data or allocate() +filenames.data = filedata + +local function initialize(goodies) -- design sizes are registered global + local fn = goodies.filenames + if fn then + for usedname, alternativenames in next, fn do + filedata[usedname] = alternativenames + end + end +end + +fontgoodies.register("filenames", initialize) + +function fontgoodies.filenames.resolve(name) + local fd = filedata[name] + if fd and findfile(name) == "" then + for i=1,#fd do + local fn = fd[i] + if findfile(fn) ~= "" then + return fn + end + end + else + -- no lookup, just use the regular mechanism + end + return name +end + +local designsizes = fontgoodies.designsizes or allocate() +fontgoodies.designsizes = designsizes + +local designdata = designsizes.data or allocate() +designsizes.data = designdata + +local function initialize(goodies) -- design sizes are registered global + local gd = goodies.designsizes + if gd then + for name, data in next, gd do + local ranges = { } + for size, file in next, data do + if size ~= "default" then + ranges[#ranges+1] = { texsp(size), file } -- also lower(file) + end + end + table.sort(ranges,function(a,b) return a[1] < b[1] end) + designdata[lower(name)] = { -- overloads, doesn't merge! + default = data.default, + ranges = ranges, + } + end + end +end + +fontgoodies.register("designsizes", initialize) + +function fontgoodies.designsizes.register(name,size,specification) + local d = designdata[name] + if not d then + d = { + ranges = { }, + default = nil, -- so we have no default set + } + designdata[name] = d + end + if size == "default" then + d.default = specification + else + if type(size) == "string" then + size = texsp(size) -- hm + end + local ranges = d.ranges + ranges[#ranges+1] = { size, specification } + end +end + +function fontgoodies.designsizes.filename(name,spec,size) -- returns nil of no match + local data = designdata[lower(name)] + if data then + if not spec or spec == "" or spec == "default" then + return data.default + elseif spec == "auto" then + local ranges = data.ranges + if ranges then + for i=1,#ranges do + local r = ranges[i] + if r[1] >= size then -- todo: rounding so maybe size - 100 + return r[2] + end + end + end + return data.default or (ranges and ranges[#ranges][2]) + end + end +end diff --git a/tex/context/base/mkiv/good-ini.lua b/tex/context/base/mkiv/good-ini.lua new file mode 100644 index 000000000..f11b0f004 --- /dev/null +++ b/tex/context/base/mkiv/good-ini.lua @@ -0,0 +1,349 @@ +if not modules then modules = { } end modules ['good-ini'] = { + version = 1.000, + comment = "companion to font-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- depends on ctx + +local type, next = type, next +local gmatch = string.gmatch + +local fonts = fonts + +local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) +local report_goodies = logs.reporter("fonts","goodies") + +local allocate = utilities.storage.allocate +local implement = interfaces.implement +local findfile = resolvers.findfile +local formatters = string.formatters + +local otf = fonts.handlers.otf +local afm = fonts.handlers.afm +local tfm = fonts.handlers.tfm + +local registerotffeature = otf.features.register +local registerafmfeature = afm.features.register +local registertfmfeature = tfm.features.register + +local addotffeature = otf.enhancers.addfeature + +local fontgoodies = fonts.goodies or { } +fonts.goodies = fontgoodies + +local data = fontgoodies.data or { } +fontgoodies.data = data -- no allocate as we want to see what is there + +local list = fontgoodies.list or { } +fontgoodies.list = list -- no allocate as we want to see what is there + +fontgoodies.suffixes = { "lfg", "lua" } -- lfg is context specific and should not be used elsewhere + +function fontgoodies.report(what,trace,goodies) + if trace_goodies or trace then + local whatever = goodies[what] + if whatever then + report_goodies("goodie %a found in %a",what,goodies.name) + end + end +end + +local function locate(filename) + local suffixes = fontgoodies.suffixes + for i=1,#suffixes do + local suffix = suffixes[i] + local fullname = findfile(file.addsuffix(filename,suffix)) + if fullname and fullname ~= "" then + return fullname + end + end +end + +local function loadgoodies(filename) -- maybe a merge is better + local goodies = data[filename] -- we assume no suffix is given + if goodies ~= nil then + -- found or tagged unfound + elseif type(filename) == "string" then + local fullname = locate(filename) + if not fullname or fullname == "" then + report_goodies("goodie file %a is not found (suffixes: % t)",filename,fontgoodies.suffixes) + data[filename] = false -- signal for not found + else + goodies = dofile(fullname) or false + if not goodies then + report_goodies("goodie file %a is invalid",fullname) + return nil + elseif trace_goodies then + report_goodies("goodie file %a is loaded",fullname) + end + goodies.name = goodies.name or "no name" + for name, fnc in next, list do + if trace_goodies then + report_goodies("handling goodie %a",name) + end + fnc(goodies) + end + goodies.initialized = true + data[filename] = goodies + end + end + return goodies +end + +function fontgoodies.register(name,fnc) -- will be a proper sequencer + list[name] = fnc +end + +fontgoodies.load = loadgoodies + +if implement then + + implement { + name = "loadfontgoodies", + actions = loadgoodies, + arguments = "string", + overload = true, -- for now, permits new font loader + } + +end + +-- register goodies file + +local function setgoodies(tfmdata,value) + local goodies = tfmdata.goodies + if not goodies then -- actually an error + goodies = { } + tfmdata.goodies = goodies + end + for filename in gmatch(value,"[^, ]+") do + -- we need to check for duplicates + local ok = loadgoodies(filename) + if ok then + if trace_goodies then + report_goodies("assigning goodie %a",filename) + end + goodies[#goodies+1] = ok + end + end +end + +-- featuresets + +local function flattenedfeatures(t,tt) + -- first set value dominates + local tt = tt or { } + for i=1,#t do + local ti = t[i] + if type(ti) == "table" then + flattenedfeatures(ti,tt) + elseif tt[ti] == nil then + tt[ti] = true + end + end + for k, v in next, t do + if type(k) ~= "number" then -- not tonumber(k) + if type(v) == "table" then + flattenedfeatures(v,tt) + elseif tt[k] == nil then + tt[k] = v + end + end + end + return tt +end + +-- fonts.features.flattened = flattenedfeatures + +local function prepare_features(goodies,name,set) + if set then + local ff = flattenedfeatures(set) + local fullname = goodies.name .. "::" .. name + local n, s = fonts.specifiers.presetcontext(fullname,"",ff) + goodies.featuresets[name] = s -- set + if trace_goodies then + report_goodies("feature set %a gets number %a and name %a",name,n,fullname) + end + return n + end +end + +fontgoodies.prepare_features = prepare_features + +local function initialize(goodies) + local featuresets = goodies.featuresets + if featuresets then + if trace_goodies then + report_goodies("checking featuresets in %a",goodies.name) + end + for name, set in next, featuresets do + prepare_features(goodies,name,set) + end + end +end + +fontgoodies.register("featureset",initialize) + +local function setfeatureset(tfmdata,set,features) + local goodies = tfmdata.goodies -- shared ? + if goodies then + local properties = tfmdata.properties + local what + for i=1,#goodies do + -- last one wins + local g = goodies[i] + what = g.featuresets and g.featuresets[set] or what + end + if what then + for feature, value in next, what do + if features[feature] == nil then + features[feature] = value + end + end + properties.mode = what.mode or properties.mode + end + end +end + +-- postprocessors (we could hash processor and share code) + +function fontgoodies.registerpostprocessor(tfmdata,f,prepend) + local postprocessors = tfmdata.postprocessors + if not postprocessors then + tfmdata.postprocessors = { f } + elseif prepend then + table.insert(postprocessors,f,1) + else + table.insert(postprocessors,f) + end +end + +local function setpostprocessor(tfmdata,processor) + local goodies = tfmdata.goodies + if goodies and type(processor) == "string" then + local found = { } + local asked = utilities.parsers.settings_to_array(processor) + for i=1,#goodies do + local g = goodies[i] + local p = g.postprocessors + if p then + for i=1,#asked do + local a = asked[i] + local f = p[a] + if type(f) == "function" then + found[a] = f + end + end + end + end + local postprocessors = tfmdata.postprocessors or { } + for i=1,#asked do + local a = asked[i] + local f = found[a] + if f then + postprocessors[#postprocessors+1] = f + end + end + if #postprocessors > 0 then + tfmdata.postprocessors = postprocessors + end + end +end + +local function setextrafeatures(tfmdata) + local goodies = tfmdata.goodies + if goodies then + for i=1,#goodies do + local g = goodies[i] + local f = g.features + if f then + for feature, specification in next, f do + addotffeature(tfmdata.shared.rawdata,feature,specification) + registerotffeature { + name = feature, + description = formatters["extra: %s"](feature) + } + end + end + end + end +end + +local function setextensions(tfmdata) + local goodies = tfmdata.goodies + if goodies then + for i=1,#goodies do + local g = goodies[i] + local e = g.extensions + if e then + local goodie = g.name or "unknown" + for i=1,#e do + local name = "extension-" .. i + -- report_goodies("adding extension %s from %s",name,goodie) + otf.enhancers.addfeature(tfmdata.shared.rawdata,name,e[i]) + end + end + end + end +end + +-- installation + +local goodies_specification = { + name = "goodies", + description = "goodies on top of built in features", + initializers = { + position = 1, + base = setgoodies, + node = setgoodies, + } +} + +registerotffeature(goodies_specification) +registerafmfeature(goodies_specification) +registertfmfeature(goodies_specification) + +-- maybe more of the following could be for type one too + +registerotffeature { + name = "extrafeatures", + description = "extra features", + default = true, + initializers = { + position = 2, + base = setextrafeatures, + node = setextrafeatures, + } +} + +registerotffeature { + name = "extensions", + description = "extensions to features", + default = true, + initializers = { + position = 2, + base = setextensions, + node = setextensions, + } +} + +registerotffeature { + name = "featureset", + description = "goodie feature set", + initializers = { + position = 3, + base = setfeatureset, + node = setfeatureset, + } +} + +registerotffeature { + name = "postprocessor", + description = "goodie postprocessor", + initializers = { + base = setpostprocessor, + node = setpostprocessor, + } +} diff --git a/tex/context/base/mkiv/good-mth.lua b/tex/context/base/mkiv/good-mth.lua new file mode 100644 index 000000000..7533a17c3 --- /dev/null +++ b/tex/context/base/mkiv/good-mth.lua @@ -0,0 +1,173 @@ +if not modules then modules = { } end modules ['good-mth'] = { + version = 1.000, + comment = "companion to font-lib.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local type, next = type, next + +local fonts = fonts + +local trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end) +local report_goodies = logs.reporter("fonts","goodies") + +local registerotffeature = fonts.handlers.otf.features.register +local fontgoodies = fonts.goodies or { } + +-- experiment, we have to load the definitions immediately as they precede +-- the definition so they need to be initialized in the typescript + +local function finalize(tfmdata,feature,value) + mathematics.overloaddimensions(tfmdata,tfmdata,value) +end + +registerotffeature { + name = "mathdimensions", + description = "manipulate math dimensions", + -- default = true, + manipulators = { + base = finalize, + node = finalize, + } +} + +local function initialize(goodies) + local mathgoodies = goodies.mathematics + if mathgoodies then + local virtuals = mathgoodies.virtuals + local mapfiles = mathgoodies.mapfiles + local maplines = mathgoodies.maplines + if virtuals then + for name, specification in next, virtuals do + -- beware, they are all constructed + mathematics.makefont(name,specification,goodies) + end + end + if mapfiles then + for i=1,#mapfiles do + fonts.mappings.loadfile(mapfiles[i]) -- todo: backend function + end + end + if maplines then + for i=1,#maplines do + fonts.mappings.loadline(maplines[i]) -- todo: backend function + end + end + end +end + +fontgoodies.register("mathematics", initialize) + +local enabled = false directives.register("fontgoodies.mathkerning",function(v) enabled = v end) + +local function initialize(tfmdata) + if enabled and tfmdata.mathparameters then -- funny, cambria text has this + local goodies = tfmdata.goodies + if goodies then + local characters = tfmdata.characters + if characters[0x1D44E] then -- 119886 + -- we have at least an italic a + for i=1,#goodies do + local mathgoodies = goodies[i].mathematics + if mathgoodies then + local kerns = mathgoodies.kerns + if kerns then + for unicode, specification in next, kerns do + local chardata = characters[unicode] + if chardata and (not chardata.mathkerns or specification.force) then + chardata.mathkerns = specification + end + end + return + end + end + end + else + return -- no proper math font anyway + end + end + end +end + +registerotffeature { + name = "mathkerns", + description = "math kerns", + default = true, + initializers = { + base = initialize, + node = initialize, + } +} + +-- math italics (not really needed) +-- +-- it would be nice to have a \noitalics\font option + +local function initialize(tfmdata) + local goodies = tfmdata.goodies + if goodies then + local shared = tfmdata.shared + for i=1,#goodies do + local mathgoodies = goodies[i].mathematics + if mathgoodies then + local mathitalics = mathgoodies.italics + if mathitalics then + local properties = tfmdata.properties + if properties.setitalics then + mathitalics = mathitalics[file.nameonly(properties.name)] or mathitalics + if mathitalics then + if trace_goodies then + report_goodies("loading mathitalics for font %a",properties.name) + end + local corrections = mathitalics.corrections + local defaultfactor = mathitalics.defaultfactor + -- properties.mathitalic_defaultfactor = defaultfactor -- we inherit outer one anyway (name will change) + if corrections then + fontgoodies.registerpostprocessor(tfmdata, function(tfmdata) -- this is another tfmdata (a copy) + -- better make a helper so that we have less code being defined + local properties = tfmdata.properties + local parameters = tfmdata.parameters + local characters = tfmdata.characters + properties.mathitalic_defaultfactor = defaultfactor + properties.mathitalic_defaultvalue = defaultfactor * parameters.quad + if trace_goodies then + report_goodies("assigning mathitalics for font %a",properties.name) + end + local quad = parameters.quad + local hfactor = parameters.hfactor + for k, v in next, corrections do + local c = characters[k] + if c then + if v > -1 and v < 1 then + c.italic = v * quad + else + c.italic = v * hfactor + end + else + report_goodies("invalid mathitalics entry %U for font %a",k,properties.name) + end + end + end) + end + return -- maybe not as these can accumulate + end + end + end + end + end + end +end + +registerotffeature { + name = "mathitalics", + description = "additional math italic corrections", + -- default = true, + initializers = { + base = initialize, + node = initialize, + } +} + +-- fontgoodies.register("mathitalics", initialize) diff --git a/tex/context/base/mkiv/layo-ini.lua b/tex/context/base/mkiv/layo-ini.lua index d35d7ef69..bfe33595d 100644 --- a/tex/context/base/mkiv/layo-ini.lua +++ b/tex/context/base/mkiv/layo-ini.lua @@ -18,7 +18,7 @@ layouts = { local status = layouts.status -function status.leftorrightpagection(left,right) +function status.leftorrightpageaction(left,right) if left == nil then left, right = false, true end @@ -41,14 +41,14 @@ function status.leftorrightpagection(left,right) end end -function status.isleftpage() +function status.isleftpage(r) if not conditionals.layoutisdoublesided then return false elseif conditionals.layoutissinglesided then return false elseif texgetcount("pagenoshift") % 2 == 0 then - return texgetcount("realpageno") % 2 == 0 + return (r or texgetcount("realpageno")) % 2 == 0 else - return not texgetcount("realpageno") % 2 == 0 + return not (r or texgetcount("realpageno")) % 2 == 0 end end diff --git a/tex/context/base/mkiv/lxml-tab.lua b/tex/context/base/mkiv/lxml-tab.lua index 2925af5f9..3c386b7a3 100644 --- a/tex/context/base/mkiv/lxml-tab.lua +++ b/tex/context/base/mkiv/lxml-tab.lua @@ -1049,9 +1049,13 @@ local grammar_unparsed_text = P { "preamble", -- maybe we will add settings to result as well -local function _xmlconvert_(data, settings) +local function _xmlconvert_(data,settings) settings = settings or { } -- no_root strip_cm_and_dt given_entities parent_root error_handler preparexmlstate(settings) + local preprocessor = settings.preprocessor + if data and data ~= "" and type(preprocessor) == "function" then + data = preprocessor(data,settings) or data -- settings.currentresource + end if settings.parent_root then mt = getmetatable(settings.parent_root) else diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua index 836286073..026cf520d 100644 --- a/tex/context/base/mkiv/lxml-tex.lua +++ b/tex/context/base/mkiv/lxml-tex.lua @@ -523,6 +523,8 @@ local function entityconverter(id,str,ent) -- todo: disable tex entities when ra return xmlprivatetoken(str) end +lxml.preprocessor = nil + local function lxmlconvert(id,data,compress,currentresource) local settings = { -- we're now roundtrip anyway unify_predefined_entities = false, -- is also default @@ -530,6 +532,7 @@ local function lxmlconvert(id,data,compress,currentresource) resolve_predefined_entities = true, -- is also default resolve_entities = function(str,ent) return entityconverter(id,str,ent) end, currentresource = tostring(currentresource or id), + preprocessor = lxml.preprocessor, } if compress and compress == variables.yes then settings.strip_cm_and_dt = true diff --git a/tex/context/base/mkiv/math-map.lua b/tex/context/base/mkiv/math-map.lua index 94dde4110..f3726cf72 100644 --- a/tex/context/base/mkiv/math-map.lua +++ b/tex/context/base/mkiv/math-map.lua @@ -164,6 +164,10 @@ local function toupper (n) local t = { } for i=0,25 do t[0x00041+i] = n+i end re local function tolower (n) local t = { } for i=0,25 do t[0x00061+i] = n+i end return t end local function tovector(t) return t end +-- how about 0x2A (ast) cq. 0x2217 +-- 0x2D (hyphen) cq. 0x2212 +-- 0x3A (colon) cq. 0x2236 + local regular_tf = { digits = todigit(0x00030), ucletters = toupper(0x00041), diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua index 681144816..b74ced203 100644 --- a/tex/context/base/mkiv/mult-def.lua +++ b/tex/context/base/mkiv/mult-def.lua @@ -10565,6 +10565,10 @@ return { ["pe"]="توده", ["ro"]="stack", }, + ["stackname"]={ + ["en"]="stackname", + ["nl"]="stapelnaam", + }, ["start"]={ ["cs"]="start", ["de"]="start", diff --git a/tex/context/base/mkiv/page-mix.lua b/tex/context/base/mkiv/page-mix.lua index 5ff1abf09..1154a24f5 100644 --- a/tex/context/base/mkiv/page-mix.lua +++ b/tex/context/base/mkiv/page-mix.lua @@ -44,7 +44,6 @@ local vpack = nuts.vpack local freenode = nuts.free local concatnodes = nuts.concat local slidenodes = nuts.slide -- ok here as we mess with prev links intermediately -local findtail = nuts.tail local getfield = nuts.getfield local setfield = nuts.setfield @@ -63,8 +62,6 @@ local getbox = nuts.getbox local getskip = nuts.getskip local getattribute = nuts.getattribute -local texgetskip = tex.getskip - local theprop = nuts.theprop local nodepool = nuts.pool diff --git a/tex/context/base/mkiv/spac-ali.lua b/tex/context/base/mkiv/spac-ali.lua index a67a30133..dc206a2a2 100644 --- a/tex/context/base/mkiv/spac-ali.lua +++ b/tex/context/base/mkiv/spac-ali.lua @@ -115,7 +115,7 @@ local function handler(head,leftpage,realpageno) end function alignments.handler(head) - local leftpage = isleftpage(true,false) + local leftpage = isleftpage() local realpageno = texgetcount("realpageno") local head, done = handler(tonut(head),leftpage,realpageno) return tonode(head), done diff --git a/tex/context/base/mkiv/spac-ver.mkiv b/tex/context/base/mkiv/spac-ver.mkiv index 250e4e396..7fe41c6de 100644 --- a/tex/context/base/mkiv/spac-ver.mkiv +++ b/tex/context/base/mkiv/spac-ver.mkiv @@ -1256,14 +1256,14 @@ %D Keyword based strutting: -\letvalue{\??struts\v!yes }\setstrut % \setvalue{\??struts\v!yes }{\setstrut} -\letvalue{\??struts\v!auto }\setautostrut % \setvalue{\??struts\v!auto }{\setautostrut} -\letvalue{\??struts\v!no }\setnostrut % \setvalue{\??struts\v!no }{\setnostrut} -\letvalue{\??struts\v!cap }\setcapstrut % \setvalue{\??struts\v!cap }{\setcapstrut} -\letvalue{\??struts\v!fit }\setfontstrut % \setvalue{\??struts\v!fit }{\setfontstrut} -\letvalue{\??struts\v!line }\setstrut % \setvalue{\??struts\v!line }{\setstrut} -\letvalue{\??struts\s!default}\setstrut % \setvalue{\??struts\s!default}{\setstrut} -\letvalue{\??struts\empty }\setstrut % \setvalue{\??struts\empty }{\setstrut} +\letvalue{\??struts\v!yes }\setstrut +\letvalue{\??struts\v!auto }\setautostrut +\letvalue{\??struts\v!no }\setnostrut +\letvalue{\??struts\v!cap }\setcapstrut +\letvalue{\??struts\v!fit }\setfontstrut +\letvalue{\??struts\v!line }\setstrut +\letvalue{\??struts\s!default}\setstrut +\letvalue{\??struts\empty }\setstrut %D Handy: diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index d80b8b645..05b5087c8 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index e5c33fd93..1d0b0b16e 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua index 080b72673..e37a31902 100644 --- a/tex/context/base/mkiv/trac-vis.lua +++ b/tex/context/base/mkiv/trac-vis.lua @@ -374,8 +374,11 @@ end local f_cache = { } local function fontkern(head,current) - local kern = getfield(current,"kern") + getfield(current,"expansion_factor") - local info = f_cache[kern] + local width = getfield(current,"kern") + local extra = getfield(current,"expansion_factor") + local kern = width + extra + local info = f_cache[kern] + -- report_visualize("fontkern: %p ex %p",width,extra) if info then -- print("hit fontkern") else diff --git a/tex/context/base/mkiv/typo-mar.lua b/tex/context/base/mkiv/typo-mar.lua index 2886c7887..fb03b23ea 100644 --- a/tex/context/base/mkiv/typo-mar.lua +++ b/tex/context/base/mkiv/typo-mar.lua @@ -9,70 +9,8 @@ if not modules then modules = { } end modules ['typo-mar'] = { -- todo: -- -- * autoleft/right depending on available space (or distance to margin) --- * stack across paragraphs, but that is messy and one should reconsider --- using margin data then as also vertical spacing kicks in -- * floating margin data, with close-to-call anchoring --- -- experiment (does not work, too much interference) --- --- local pdfprint = pdf.print --- local format = string.format --- --- anchors = anchors or { } --- --- local whatever = { } --- local factor = (7200/7227)/65536 --- --- function anchors.set(tag) --- whatever[tag] = { pdf.h, pdf.v } --- end --- --- function anchors.reset(tag) --- whatever[tag] = nil --- end --- --- function anchors.startmove(tag,how) -- save/restore nodes but they don't support moves --- local w = whatever[tag] --- if not w then --- -- error --- elseif how == "horizontal" or how == "h" then --- pdfprint("page",format(" q 1 0 0 1 %f 0 cm ", (w[1] - pdf.h) * factor)) --- elseif how == "vertical" or how == "v" then --- pdfprint("page",format(" q 1 0 0 1 0 %f cm ", (w[2] - pdf.v) * factor)) --- else --- pdfprint("page",format(" q 1 0 0 1 %f %f cm ", (w[1] - pdf.h) * factor, (w[2] - pdf.v) * factor)) --- end --- end --- --- function anchors.stopmove(tag) --- local w = whatever[tag] --- if not w then --- -- error --- else --- pdfprint("page"," Q ") --- end --- end --- --- local latelua = nodes.pool.latelua --- --- function anchors.node_set(tag) --- return latelua(formatters["anchors.set(%q)"](tag)) --- end --- --- function anchors.node_reset(tag) --- return latelua(formatters["anchors.reset(%q)"](tag)) --- end --- --- function anchors.node_start_move(tag,how) --- return latelua(formatters["anchors.startmove(%q,%q)](tag,how)) --- end --- --- function anchors.node_stop_move(tag) --- return latelua(formatters["anchors.stopmove(%q)"](tag)) --- end - --- so far - local format, validstring = string.format, string.valid local insert, remove, sortedkeys, fastcopy = table.insert, table.remove, table.sortedkeys, table.fastcopy local setmetatable, next = setmetatable, next @@ -138,6 +76,7 @@ local setattr = nuts.setattr local getsubtype = nuts.getsubtype local getlist = nuts.getlist local setlist = nuts.setlist +local setlink = nuts.setlink local getbox = nuts.getbox local takebox = nuts.takebox @@ -158,11 +97,12 @@ local userdefined_code = whatsitcodes.userdefined local nodepool = nuts.pool local new_usernumber = nodepool.usernumber +local new_hlist = nodepool.hlist local lateluafunction = nodepool.lateluafunction local texgetdimen = tex.getdimen ------ texgetcount = tex.getcount +local texgetcount = tex.getcount local texget = tex.get local isleftpage = layouts.status.isleftpage @@ -173,7 +113,6 @@ local addtoline = paragraphs.addtoline local moveinline = paragraphs.moveinline local calculatedelta = paragraphs.calculatedelta ------ a_specialcontent = attributes.private("specialcontent") local a_linenumber = attributes.private('linenumber') local inline_mark = nodepool.userids["margins.inline"] @@ -194,6 +133,7 @@ local nofsaved = 0 local nofstored = 0 local nofinlined = 0 local nofdelayed = 0 +local nofinjected = 0 local h_anchors = 0 local v_anchors = 0 @@ -257,7 +197,6 @@ end function margins.save(t) setmetatable(t,defaults) local content = takebox(t.number) - -- setattr(content,a_specialcontent,1) setprop(content,"specialcontent","margindata") local location = t.location local category = t.category @@ -392,7 +331,7 @@ local function realign(current,candidate) local atleft = true local hmove = 0 local delta = 0 - local leftpage = isleftpage(false,true) + local leftpage = isleftpage() local leftdelta = 0 local rightdelta = 0 local leftdistance = distance @@ -426,6 +365,8 @@ local function realign(current,candidate) if not leftpage then atleft = false end + else + -- v_left end local islocal = scope == v_local @@ -477,20 +418,23 @@ end -- table gets saved when the v_continue case is active. We use a special variant -- of position tracking, after all we only need the page number and vertical position. -local stacked = { } -- left/right keys depending on location +local validstacknames = { + [v_left ] = v_left , + [v_right] = v_right, + [v_inner] = v_inner, + [v_outer] = v_outer, +} + local cache = { } -local anchors = { } - -local function resetstacked(location) - if location then - local s = { } - stacked[location] = s - anchors[location] = false - return s - else - stacked = { } - anchors = { } - return stacked +local stacked = { [v_yes] = { }, [v_continue] = { } } +local anchors = { [v_yes] = { }, [v_continue] = { } } + +local function resetstacked(all) + stacked[v_yes] = { } + anchors[v_yes] = { } + if all then + stacked[v_continue] = { } + anchors[v_continue] = { } end end @@ -498,24 +442,45 @@ end local function sa(tag) -- maybe l/r keys ipv left/right keys local p = cache[tag] - if trace_marginstack then - report_margindata("updating anchor %a",tag) + if p then + if trace_marginstack then + report_margindata("updating anchor %a",tag) + end + p.p = true + p.y = true + setposition('md:v',tag,p) + cache[tag] = nil -- do this later, per page a cleanup end - p.p = true - p.y = true --- p.a = tag - setposition('md:v',tag,p) - cache[tag] = nil end local function setanchor(v_anchor) -- freezes the global here return lateluafunction(function() sa(v_anchor) end) end +local function aa(tag,n) -- maybe l/r keys ipv left/right keys + local p = jobpositions.gettobesaved('md:v',tag) + if p then + if trace_marginstack then + report_margindata("updating injected %a",tag) + end + local pages = p.pages + if not pages then + pages = { } + p.pages = pages + end + pages[n] = texgetcount("realpageno") + elseif trace_marginstack then + report_margindata("not updating injected %a",tag) + end +end + +local function addtoanchor(v_anchor,n) -- freezes the global here + return lateluafunction(function() aa(v_anchor,n) end) +end + local function markovershoot(current) -- todo: alleen als offset > line v_anchors = v_anchors + 1 cache[v_anchors] = fastcopy(stacked) --- cache[v_anchors] = stacked -- so we adapt the previous too local anchor = setanchor(v_anchors) -- local list = hpack_nodes(linked_nodes(anchor,getlist(current))) -- not ok, we need to retain width local list = hpack_nodes(linked_nodes(anchor,getlist(current)),getfield(current,"width"),"exactly")-- @@ -527,64 +492,6 @@ local function markovershoot(current) -- todo: alleen als offset > line setlist(current,list) end --- local function getovershoot(location) --- local p = getposition("md:v",v_anchors) --- local c = getposition("md:v",v_anchors+1) --- if p and c and p.p and p.p == c.p then --- local distance = p.y - c.y --- local offset = p[location] or 0 --- local overshoot = offset - distance --- if trace_marginstack then --- report_margindata("location %a, anchor %a, distance %p, offset %p, overshoot %p",location,v_anchors,distance,offset,overshoot) --- end --- if overshoot > 0 then --- return overshoot, offset, distance --- else --- return 0, offset, distance --- end --- elseif trace_marginstack then --- report_margindata("location %a, anchor %a, nothing to correct",location,v_anchors) --- end --- return 0, 0, 0 --- end - -local function getovershoot(location) - local c = getposition("md:v",v_anchors+1) - if c then - local p = false - local cp = c.p - for i=v_anchors,1,-1 do - local pi = getposition("md:v",i) - if pi.p == cp then - p = pi - else - break - end - end - if p then - local distance = p.y - c.y - local offset = p[location] or 0 - local overshoot = offset - distance - if trace_marginstack then - report_margindata("location %a, anchor %a, distance %p, offset %p, overshoot %p",location,v_anchors,distance,offset,overshoot) - end - if overshoot > 0 then - return overshoot, offset, distance - else - return 0, offset, distance - end - end - end - if trace_marginstack then - report_margindata("location %a, anchor %a, nothing to correct",location,v_anchors) - end - return 0, 0, 0 -end - -local function getanchor(location,anchor) - return getposition("md:v",anchor) -end - local function inject(parent,head,candidate) local box = candidate.box if not box then @@ -595,6 +502,7 @@ local function inject(parent,head,candidate) local depth = getfield(box,"depth") local shift = getfield(box,"shift") local stack = candidate.stack + local stackname = candidate.stackname local location = candidate.location local method = candidate.method local voffset = candidate.voffset @@ -604,8 +512,18 @@ local function inject(parent,head,candidate) local strutdepth = candidate.strutdepth local inline = candidate.inline local psubtype = getsubtype(parent) - local offset = stacked[location] + -- This stackname is experimental and therefore undocumented and basically + -- unsupported. It was introduced when we needed to support overlapping + -- of different anchors. + if not stackname or stackname == "" then + stackname = location + else + stackname = validstacknames[stackname] or location + end + local isstacked = stack == v_continue or stack == v_yes + local offset = stack and stack ~= "" and stacked[stack][stackname] local firstonstack = offset == false or offset == nil + nofinjected = nofinjected + 1 nofdelayed = nofdelayed + 1 -- yet untested baseline = tonumber(baseline) @@ -622,61 +540,79 @@ local function inject(parent,head,candidate) baseline = false -- strutheight -- actually a hack end end - candidate.width = width - candidate.hsize = getfield(parent,"width") -- we can also pass textwidth - candidate.psubtype = psubtype + candidate.width = width + candidate.hsize = getfield(parent,"width") -- we can also pass textwidth + candidate.psubtype = psubtype + candidate.stackname = stackname if trace_margindata then report_margindata("processing, index %s, height %p, depth %p, parent %a, method %a",candidate.n,height,depth,listcodes[psubtype],method) end - -- The next section handles the inline notes that are checked for overlap which - -- is somewhat tricky as that mechanism is mostly for paragraph boundnotes. - local stackedinline = inline and (stack == v_yes or stack == v_continue) - if stackedinline then + -- Overlap detection is somewhat complex because we have display and inline + -- notes mixed as well as inner and outer positioning. We do need to + -- handle it in the stream because we also keep lines together so we keep + -- track of page numbers of notes. + + if isstacked then firstonstack = true - if anchors[location] then - local a1 = getanchor(location,anchors[location]) - local a2 = getanchor(location,v_anchors+1) - if a1 and a2 and a1.p == a2.p then - local distance = a1.y - a2.y - if distance > offset then - -- report_margindata("location %s, no overlap, case 1",location) - elseif offset > 0 then - offset = offset - distance - firstonstack = false - -- report_margindata("location %s, overlap %a",location,offset) - -- else - -- report_margindata("location %s, no overlap, case 2",location) + local anchor = getposition("md:v") + if anchor and (location == v_inner or location == v_outer) then + local pages = anchor.pages + if pages then + local page = pages[nofinjected] + if page then + if isleftpage(page) then + stackname = location == v_inner and v_right or v_left + else + stackname = location == v_inner and v_left or v_right + end + candidate.stackname = stackname + offset = stack and stack ~= "" and stacked[stack][stackname] end - -- else - -- report_margindata("location %s, no overlap, case 3",location) end - -- else - -- report_margindata("location %s, no overlap, case 4",location) end - anchors[location] = v_anchors + 1 - end - -- end of special section - if firstonstack then - offset = 0 - else - -- offset = offset + height - end - if stack == v_yes then + local current = v_anchors + 1 + local previous = anchors[stack][stackname] + if trace_margindata then + report_margindata("anchor %i, offset so far %p",current,offset or 0) + end + local ap = anchor and anchor[previous] + local ac = anchor and anchor[current] + if not previous then + elseif previous == current then + firstonstack = false + elseif ap and ac and ap.p == ac.p then + local distance = ap.y - ac.y + if trace_margindata then + report_margindata("distance %p",distance) + end + if offset > distance then + -- we already overflow + offset = offset - distance + firstonstack = false + else + offset = 0 + end + else + -- what to do + end + anchors[v_yes] [stackname] = current + anchors[v_continue][stackname] = current + if firstonstack then + offset = 0 + end offset = offset + candidate.dy -- always shift = shift + offset - elseif stack == v_continue then - offset = offset + candidate.dy -- always + else if firstonstack then - offset = offset + getovershoot(location) + offset = 0 end - shift = shift + offset + offset = offset + candidate.dy -- always + shift = shift + offset end - -- -- -- -- Maybe we also need to patch offset when we apply methods, but how ... -- This needs a bit of playing as it depends on the stack setting of the -- following which we don't know yet ... so, consider stacking partially -- experimental. - -- -- -- if method == v_top then local delta = height - getfield(parent,"height") if trace_margindata then @@ -732,13 +668,19 @@ local function inject(parent,head,candidate) offset = offset + delta end setfield(box,"shift",shift) - setfield(box,"width",0) + setfield(box,"width",0) -- not needed when wrapped + -- + if isstacked then + setlink(box,addtoanchor(v_anchor,nofinjected)) + box = new_hlist(box) + -- set height / depth ? + end -- candidate.hook, candidate.node = addtoline(parent,box) -- setprop(box,"margindata",candidate) if trace_margindata then - report_margindata("injected, location %a, shift %p",location,shift) + report_margindata("injected, location %a, stack %a, shift %p",location,stackname,shift) end -- we need to add line etc to offset as well offset = offset + depth @@ -747,16 +689,17 @@ local function inject(parent,head,candidate) depth = offset, slack = candidate.bottomspace, -- todo: 'depth' => strutdepth lineheight = candidate.lineheight, -- only for tracing - stacked = stackedinline, + stacked = inline and isstacked, } offset = offset + height -- we need a restart ... when there is no overlap at all - stacked[location] = offset + stacked[v_yes] [stackname] = offset + stacked[v_continue][stackname] = offset -- todo: if no real depth then zero if trace_margindata then report_margindata("status, offset %s",offset) end - return getlist(parent), room, stackedinline or (stack == v_continue) + return getlist(parent), room, inline and isstacked or (stack == v_continue) end local function flushinline(parent,head) @@ -850,7 +793,6 @@ local function flushed(scope,parent) -- current is hlist setattr(parent,a_linenumber,a) end end - -- resetstacked() end return done, continue end @@ -890,9 +832,7 @@ local function handler(scope,head,group) report_margindata("flushing stage one, nothing done, %s left",nofstored) end end - -- if done then - resetstacked() -- why doesn't done work ok here? - -- end +resetstacked() return tonode(head), done else return head, false @@ -964,7 +904,6 @@ local function finalhandler(head) local id = getid(current) if id == hlist_code then -- only lines? local a = getprop(current,"margindata") --- if not a or a == 0 then if not a then finalhandler(getlist(current)) elseif realigned(current,a) then @@ -991,9 +930,11 @@ function margins.finalhandler(head) end head = tonut(head) local head, done = finalhandler(head) + resetstacked(true) head = tonode(head) return head, done else + resetstacked() return head, false end end @@ -1055,6 +996,7 @@ interfaces.implement { { "align" }, { "option" }, { "line", "integer" }, + { "stackname" }, { "stack" }, } } diff --git a/tex/context/base/mkiv/typo-mar.mkiv b/tex/context/base/mkiv/typo-mar.mkiv index 4c634a2d3..013974086 100644 --- a/tex/context/base/mkiv/typo-mar.mkiv +++ b/tex/context/base/mkiv/typo-mar.mkiv @@ -122,6 +122,7 @@ \c!scope=\v!global, \c!width=, % \c!stack=, + % \c!stackname=, % \c!option=, % \v!paragraph (follow shape) \c!line=0, \c!anchor=\v!text, @@ -131,8 +132,8 @@ \c!hoffset=\zeropoint, \c!voffset=\zeropoint] -\setupmarginframed % so, align should be set with the data command - [\c!strut=\v!yes, +\setupmarginframed % so, align should be set with the data command + [\c!strut=\v!yes, % so by default we scale the strut to the font ! \c!offset=\v!overlay, \c!fr!analyze=\v!yes, \c!frame=\v!off, @@ -303,6 +304,7 @@ % \fi align {\margindataparameter\c!align}% line \numexpr\margindataparameter\c!line\relax + stackname {\margindataparameter\c!stackname}% stack {\margindataparameter\c!stack}% \relax \else diff --git a/tex/context/interface/mkii/keys-cs.xml b/tex/context/interface/mkii/keys-cs.xml index ce8e41016..94f41a5a8 100644 --- a/tex/context/interface/mkii/keys-cs.xml +++ b/tex/context/interface/mkii/keys-cs.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index 5c7ecc651..edbba27c9 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-en.xml b/tex/context/interface/mkii/keys-en.xml index 621cbd763..9b0a7727a 100644 --- a/tex/context/interface/mkii/keys-en.xml +++ b/tex/context/interface/mkii/keys-en.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml index 301f94628..dbc2955f5 100644 --- a/tex/context/interface/mkii/keys-fr.xml +++ b/tex/context/interface/mkii/keys-fr.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-it.xml b/tex/context/interface/mkii/keys-it.xml index 458acd5c1..dcd6e4502 100644 --- a/tex/context/interface/mkii/keys-it.xml +++ b/tex/context/interface/mkii/keys-it.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-nl.xml b/tex/context/interface/mkii/keys-nl.xml index 5e214c8bb..f2ce3629b 100644 --- a/tex/context/interface/mkii/keys-nl.xml +++ b/tex/context/interface/mkii/keys-nl.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-pe.xml b/tex/context/interface/mkii/keys-pe.xml index 1afb96c9a..e66ad4f09 100644 --- a/tex/context/interface/mkii/keys-pe.xml +++ b/tex/context/interface/mkii/keys-pe.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkii/keys-ro.xml b/tex/context/interface/mkii/keys-ro.xml index 8a7707a2d..2fe560325 100644 --- a/tex/context/interface/mkii/keys-ro.xml +++ b/tex/context/interface/mkii/keys-ro.xml @@ -1166,6 +1166,7 @@ + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 39a841a19..0e4fe395e 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index 1e326ed67..acb862767 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 4d1ef8322..19fb2482c 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 : 05/31/16 09:02:55 +-- merge date : 06/02/16 21:28:16 do -- begin closure to overcome local limits and interference -- cgit v1.2.3