summaryrefslogtreecommitdiff
path: root/doc/context/sources/general/manuals/spacing
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-08-01 13:39:31 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-08-01 13:39:31 +0200
commitc44a9d2f89620e439f335029689e7f0dff9516b7 (patch)
tree1062a464cb13362d82598c41c437ab1c7eb4f236 /doc/context/sources/general/manuals/spacing
parent665f9095475ffcd1c8750546727c75e5486a266f (diff)
downloadcontext-c44a9d2f89620e439f335029689e7f0dff9516b7.tar.gz
2016-08-01 13:07:00
Diffstat (limited to 'doc/context/sources/general/manuals/spacing')
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-contents.tex9
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-introduction.tex19
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex108
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-mkiv.tex16
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-style.tex55
-rw-r--r--doc/context/sources/general/manuals/spacing/spacing-titlepage.tex37
6 files changed, 244 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/spacing/spacing-contents.tex b/doc/context/sources/general/manuals/spacing/spacing-contents.tex
new file mode 100644
index 000000000..d7c709e2e
--- /dev/null
+++ b/doc/context/sources/general/manuals/spacing/spacing-contents.tex
@@ -0,0 +1,9 @@
+\startcomponent spacing-contents
+
+\starttitle[title=Contents]
+
+\placelist[chapter,section]
+
+\stoptitle
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-introduction.tex b/doc/context/sources/general/manuals/spacing/spacing-introduction.tex
new file mode 100644
index 000000000..d4d385c5e
--- /dev/null
+++ b/doc/context/sources/general/manuals/spacing/spacing-introduction.tex
@@ -0,0 +1,19 @@
+\environment spacing-style
+
+\startcomponent spacing-introduction
+
+\startchapter[title=Introduction]
+
+ In this document I will collext some remarks about spacing (related) commands
+ but it will happen stepwise. Feel free to contribute.
+
+ \blank
+
+ \startlines
+ Hans Hagen
+ Hasselt NL
+ \stoplines
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex b/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
new file mode 100644
index 000000000..c16afbf0a
--- /dev/null
+++ b/doc/context/sources/general/manuals/spacing/spacing-linecorrection.tex
@@ -0,0 +1,108 @@
+% language=uk
+
+\environment spacing-style
+
+\startcomponent spacing-linecorrection
+
+\startchapter[title=Line correction]
+
+\startbuffer[linecorrection]
+\typebuffer
+\blank
+\enabletrackers[linecorrection.boxes]
+\getbuffer
+\disabletrackers[linecorrection.boxes]
+\blank
+\stopbuffer
+
+We really do out best to make the spacing look as good as possible
+(or at least consistent) but sometimes \TEX\ needs a bit of help.
+An example of a helper is the following:
+
+\startbuffer
+\startlinecorrection
+ \input ward
+\stoplinecorrection
+\stopbuffer
+
+\getbuffer[linecorrection]
+
+When we use the same command with some left and/or right margins set, we get
+this:
+
+\startbuffer
+\startnarrower
+ \startlinecorrection
+ \input ward
+ \stoplinecorrection
+\stopnarrower
+\stopbuffer
+
+\getbuffer[linecorrection]
+
+Here we do obey the margins inside the correction box but the box itself is still
+as wide as the current width. A typical case where this happens is:
+
+\startbuffer
+\startitemize
+ \startitem an item:
+ \startlinecorrection
+ \input ward
+ \stoplinecorrection
+ \stopitem
+\stopitemize
+\stopbuffer
+
+\getbuffer[linecorrection]
+
+Here is a variant:
+
+\startbuffer
+\startitemize
+ \startitem a local linecorrection:
+ \startlocallinecorrection
+ \input ward
+ \stoplocallinecorrection
+ \stopitem
+\stopitemize
+\stopbuffer
+
+\getbuffer[linecorrection]
+
+Both types of correction wrap their content in a box and make sure that the
+spacing around it is visually as good as possible. The local variant uses a box
+fitting the available width taking margins into account and but resetting them
+inside the box. The normal variant applies the margins inside the box. Which one
+you use depends on the situation and content.
+
+You can pass an optional argument that indicates the amount of spacing to be
+added before and after the correction.
+
+\startbuffer
+\startlinecorrection[3*line]
+ \input ward
+\stoplinecorrection
+\stopbuffer
+
+\getbuffer[linecorrection]
+
+Normally you don't need this correction. It is mainly used for correcting spacing
+around boxed material, like \type {\framed}:
+
+\startbuffer
+before
+\startlinecorrection
+ \framed{something inbetween}
+\stoplinecorrection
+after
+\stopbuffer
+
+\getbuffer[linecorrection]
+
+Because in this document we have set the whitespace this also gets added around
+the box. So, in case your spacing around some special content looks bad, consider
+using these commands.
+
+\stopchapter
+
+\stopcomponent
diff --git a/doc/context/sources/general/manuals/spacing/spacing-mkiv.tex b/doc/context/sources/general/manuals/spacing/spacing-mkiv.tex
new file mode 100644
index 000000000..4261a3884
--- /dev/null
+++ b/doc/context/sources/general/manuals/spacing/spacing-mkiv.tex
@@ -0,0 +1,16 @@
+\environment spacing-style
+
+\startdocument
+
+ \component spacing-titlepage
+
+ \startfrontmatter
+ \component spacing-contents
+ \component spacing-introduction
+ \stopfrontmatter
+
+ \startbodymatter
+ \component spacing-linecorrection
+ \stopbodymatter
+
+\stopdocument
diff --git a/doc/context/sources/general/manuals/spacing/spacing-style.tex b/doc/context/sources/general/manuals/spacing/spacing-style.tex
new file mode 100644
index 000000000..cf0bae7bf
--- /dev/null
+++ b/doc/context/sources/general/manuals/spacing/spacing-style.tex
@@ -0,0 +1,55 @@
+\startenvironment spacing-style
+
+\setupbodyfont
+ [pagella]
+
+\setuplayout
+ [width=middle,
+ height=middle,
+ topspace=15mm,
+ header=15mm,
+ footer=0pt,
+ bottomspace=20mm]
+
+\setuppagenumbering
+ [alternative=doublesided]
+
+\setupwhitespace
+ [big]
+
+\definecolor
+ [blackcolor]
+ [r=0,b=0,g=0]
+
+\definecolor
+ [whitecolor]
+ [r=1,b=1,g=1]
+
+\definecolor
+ [maincolor]
+ [.25(blackcolor,green)]
+
+\definecolor
+ [extracolor]
+ [.25(whitecolor,green)]
+
+% \blackrule[color=maincolor,width=10cm,,height=10cm]
+% \blackrule[color=extracolor,width=10cm,,height=10cm]
+
+\setuptyping
+ [color=maincolor]
+
+\setuptype
+ [color=maincolor]
+
+\setuphead
+ [chapter]
+ [style=\bfd,
+ color=maincolor]
+
+\setuphead
+ [section]
+ [style=\bfc,
+ color=maincolor]
+
+\stopenvironment
diff --git a/doc/context/sources/general/manuals/spacing/spacing-titlepage.tex b/doc/context/sources/general/manuals/spacing/spacing-titlepage.tex
new file mode 100644
index 000000000..1f21d769a
--- /dev/null
+++ b/doc/context/sources/general/manuals/spacing/spacing-titlepage.tex
@@ -0,0 +1,37 @@
+\environment spacing-style
+
+\startcomponent spacing-titlepage
+
+% This titlepage demonstrates once again how well designed the computer modern monospaced
+% font is, especially when we look at the consistent grayness.
+
+\startMPpage
+
+ fill Page enlarged 4mm withcolor \MPcolor{maincolor} ;
+
+ draw image (
+ for i=1 upto 20 :
+ draw bottomboundary Page shifted (0,100*log(i)) ;
+ endfor ;
+ )
+ xysized (PaperWidth-6mm,PaperHeight-6mm)
+ shifted (3mm,3mm)
+ withcolor \MPcolor{extracolor}
+ withpen pencircle scaled 1mm ;
+
+ numeric a ; a := log(1)*PaperHeight/(log(20)) ;
+ numeric b ; b := log(2)*PaperHeight/(log(20)) ;
+
+ picture p ; p := textext.lrt("\ttbf Spacing in Con\TeX t") xsized(.9PaperWidth) ;
+
+ draw p
+ shifted (.05PaperWidth,(b+a)/2 - ypart center p)
+ withcolor \MPcolor{extracolor} ;
+
+ setbounds currentpicture to Page ;
+
+\stopMPpage
+
+\page[right] \setuppagenumber[number=1]
+
+\stopcomponent