diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-02-14 23:45:34 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-02-14 23:45:34 +0100 |
commit | 5321d35d68ce0acb71b46bddac1d8cab8eca3fcc (patch) | |
tree | 97196e1912f50b4dc11207a946a7328a50727686 /doc | |
parent | 71e0f049996013abcbfd549b516e594e019fb744 (diff) | |
download | context-5321d35d68ce0acb71b46bddac1d8cab8eca3fcc.tar.gz |
2018-02-14 23:04:00
Diffstat (limited to 'doc')
17 files changed, 252 insertions, 9 deletions
diff --git a/doc/context/documents/general/manuals/bidi.pdf b/doc/context/documents/general/manuals/bidi.pdf Binary files differindex 5a787197b..8550e5fd4 100644 --- a/doc/context/documents/general/manuals/bidi.pdf +++ b/doc/context/documents/general/manuals/bidi.pdf diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf Binary files differindex 7f8da5be3..77db079d5 100644 --- a/doc/context/documents/general/manuals/luatex.pdf +++ b/doc/context/documents/general/manuals/luatex.pdf diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex d91a8803c..871517201 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex 0e758e0ec..706ad5cea 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex fac1032e1..7c655f08a 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex 3feedc089..39356d60b 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex c76f97203..06020527c 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf Binary files differindex 9cc2b95af..13e06cbfe 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf Binary files differindex 4dc4e83ff..72afbb69e 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf Binary files differindex e7ad18be9..2e141dcbd 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf Binary files differindex 1bc434fed..baa3fec16 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf Binary files differindex 5bdce456a..a4007450c 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf Binary files differindex dd25d0abe..75dba641e 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf Binary files differindex 26893c58e..339fe2e10 100644 --- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex 1bc64c2a9..39ebff455 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex f402e01e9..6b8570642 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/doc/context/sources/general/manuals/bidi/bidi.tex b/doc/context/sources/general/manuals/bidi/bidi.tex index 5bb24b118..38de2f838 100644 --- a/doc/context/sources/general/manuals/bidi/bidi.tex +++ b/doc/context/sources/general/manuals/bidi/bidi.tex @@ -2,6 +2,8 @@ % \showglyphs +\usemodule[abr-04] + \dontcomplain \startbuffer[preamble-fonts] @@ -73,6 +75,9 @@ \setupwhitespace [big] +\setuphead + [color=darkyellow] + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \startluacode @@ -96,6 +101,9 @@ {\ctxlua{nodes.tasks.enableaction("contributers","nodes.tracers.checkdirections")}} {\ctxlua{nodes.tasks.disableaction("contributers","nodes.tracers.checkdirections")}} +% \enabletrackers[directions.check] +% \disabletrackers[directions.check] + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \starttext @@ -134,23 +142,33 @@ With \CONTEXT\ you can typeset in two directions: from left to right and from right to left. In fact you can also combine these two directions, like this: \startbuffer -There are many {\righttoleft \maincolor \bf scripts in use} and some run into the -other direction. However, there is {\righttoleft \maincolor \bf no fixed relation -{\lefttoright \black \tf between the} direction of the script} and cars being +There are many {\righttoleft \maincolor \it scripts in use} and some run into the +other direction. However, there is {\righttoleft \maincolor \it no fixed relation +{\lefttoright \black \it between the} direction of the script} and cars being driven left or right of the road. \stopbuffer \typebuffer -% \enabletrackers[directions.check] - \getbuffer -% \disabletrackers[directions.check] - This manual is written by a left to right user so don't expect a manual on -semitic typesetting (Hebrew and Arabic). Also don't expect a (yet) complete -manual. I'll add whatever comes to mind. So let's see how Arabic comes out: +semitic typesetting. Also don't expect a (yet) complete manual. I'll add whatever +comes to mind. This is not a manual about Hebrew or Arabic, if only because I +can't read any of those scripts (languages). I leave that to others to cover. + +{\em This is work in progress! So expect errors and typos.} + +\startlines +Hans Hagen +Hasselt, NL +\stoplines + +\stopchapter + +\startchapter[title={Setting up fonts}] + +So let's see how Arabic and Hebrew come out: \startbuffer The sentence \quotation {I have no clue what this means.} is translated (by @@ -236,4 +254,229 @@ we can be very specific in what we want to enable. \stopchapter +\startchapter[title=A mixed layout] + +The typesetting engine normally works from left to right and top to bottom. Going +from right to left actually involved two decisions: + +\startitemize[packed] +\startitem the direction of the display elements, the paragraphs \stopitem +\startitem the direction of the inline text, the lines \stopitem +\stopitemize + +The first one is kept track of in a state variable. Every paragraph starts with +a node that carries, among other information, that state. This node is added +automatically and does not interfere with the typesetting. The inline direction +is more intrusive as it is marked by nodes that indicate the beginning and end +of a reversed strip. This mechanism is rather reliable and normally works out +well. Take this: + +\startbuffer +left {\righttoleft right} left +left{ \righttoleft right} left +left {\righttoleft right }left +left{ \righttoleft right }left +\stopbuffer + +\typebuffer + +You can see that we need to be careful with spaces as they can end up inside or +outside a substream and by swapping next to each other: + +\startlines +\getbuffer +\stoplines + +We can wrap the lines in boxes as in: + +\startbuffer +\hbox{left\space{\bf\righttoleft right}\space left} +\hbox{left{\bf\space \righttoleft right}\space left} +\hbox{left\space{\bf\righttoleft right\space}left} +\hbox{left{\bf\space\righttoleft right\space}left} +\stopbuffer + +\typebuffer + +\definecolor[ShineThrough][s=0,a=1,t=.2] + +When visualize the spaces we get this: + +\startlines\ShineThrough +\showmakeup[space,hbox]\getbuffer +\stoplines + +The space of a normal and bold font in the same family normally is the same but +let's mix with a larger size: + +\startbuffer +\hbox{left {\bfa\righttoleft right} left} +\hbox{left{\bfa\space \righttoleft right} left} +\hbox{left {\bfa\righttoleft right }left} +\hbox{left{\bfa\space\righttoleft right }left} +\stopbuffer + +\typebuffer + +Now we get the following. As you can see, it really matters where we put the +braces. + +\startlines +\ShineThrough\showmakeup[space,hbox]\getbuffer +\stoplines + +Once you are accustomed to tagging and \TEX\ you will probably not fall into +these traps. In \in {figure} [fig:spaces] we show a large version. + +\startplacefigure[location=top,title={Watch your spaces!},reference=fig:spaces] + \scale + [width=\hsize] + {\vbox{\ShineThrough\showmakeup[space,hbox]\getbuffer}} +\stopplacefigure + + +The \type {\righttoleft} command actually has two meanings. This can best be seen +from an example. + +\startbuffer +\righttoleft \bf How will this come out? +\stopbuffer + +\typebuffer + +\start \getbuffer \par \stop + +\startbuffer +And \righttoleft \bf how will this come out? +\stopbuffer + +\typebuffer + +\start \getbuffer \par \stop + +When we start a paragraph (or in \TEX\ speak: when we are still in vertical mode) +the paragraph direction as well as the inline direction is set. Otherwise only +the inline direction is set. There are low level \TEX\ commands (primitives) to +set the direction but you can best {\em not} use these because we need to do a +bit more than that. + +There are quite some low level commands related to changing directions. Some deal +with the layout, some with boxes. We might provide more in the future. + +\starttabulate[|l|p|] +\FL +\NC \type {\lefttoright} \NC l2r dir node or paragraph property \NC \NR +\NC \type {\righttoleft} \NC r2l dir node or paragraph property \NC \NR +\NC \type {\checkedlefttoright} \NC l2r dir node or paragraph property (unless already set) \NC \NR +\NC \type {\checkedrighttoleft} \NC r2l dir node or paragraph property (unless already set) \NC \NR +\ML +\NC \type {\synchronizeinlinedirection} \NC pickup a (possibly) reset state \NC \NR +\NC \type {\synchronizelayoutdirection} \NC pickup a (possibly) reset state \NC \NR +\NC \type {\synchronizedisplaydirection} \NC pickup a (possibly) reset state \NC \NR +\ML +\NC \type {\righttolefthbox} \NC r2l \type {\hbox} \NC \NR +\NC \type {\lefttorighthbox} \NC l2r \type {\hbox} \NC \NR +\NC \type {\righttoleftvbox} \NC r2l \type {\vbox} \NC \NR +\NC \type {\lefttorightvbox} \NC l2r \type {\vbox} \NC \NR +\NC \type {\righttoleftvtop} \NC r2l \type {\vtop} \NC \NR +\NC \type {\lefttorightvtop} \NC l2r \type {\vtop} \NC \NR +\ML +\NC \type {\leftorrighthbox} \NC l2r or r2l \type {\hbox} \NC \NR +\NC \type {\leftorrightvbox} \NC l2r or r2l \type {\vbox} \NC \NR +\NC \type {\leftorrightvtop} \NC l2r or r2l \type {\vtop} \NC \NR +\ML +\NC \type {\autodirhbox} \NC l2r or r2l \type {\hbox} (a bit more clever) \NC \NR +\NC \type {\autodirvbox} \NC l2r or r2l \type {\vbox} (a bit more clever) \NC \NR +\NC \type {\autodirvtop} \NC l2r or r2l \type {\vtop} (a bit more clever) \NC \NR +\ML +\NC \type {\bidilre} \NC character \type {U+202A}, enforce l2r state \NC \NR +\NC \type {\bidirle} \NC character \type {U+202B}, enforce r2l state \NC \NR +\NC \type {\bidipop} \NC character \type {U+202C}, return to last state \NC \NR +\NC \type {\bidilro} \NC character \type {U+202D}, override l2r state \NC \NR +\NC \type {\bidirlo} \NC character \type {U+202E}, override r2l state \NC \NR +\NC \type {\lefttorightmark} \type {\lrm} \NC character \type {U+200E}, l2r indicator \NC \NR +\NC \type {\righttoleftmark} \type {\rlm} \NC character \type {U+200F}, r2l indicator \NC \NR +\ML +\NC \type {\dirlre} \NC switch to l2r mode using \type {\bidilre} or \lefttoright \NC \NR +\NC \type {\dirrle} \NC switch to r2l mode using \type {\bidirle} or \righttoleft \NC \NR +\NC \type {\dirlro} \NC enforce l2r mode using \type {\bidilro} or \lefttoright \NC \NR +\NC \type {\dirrlo} \NC enforce r2l mode using \type {\bidirlo} or \righttoleft \NC \NR +\ML +\NC \type {\naturalhbox} \NC a normal l2r \type {hbox} \NC \NR +\NC \type {\naturalvbox} \NC a normal l2r \type {vbox} \NC \NR +\NC \type {\naturalvtop} \NC a normal l2r \type {vtop} \NC \NR +\NC \type {\naturalhpack} \NC a normal l2r \type {hpack} \NC \NR +\NC \type {\naturalvpack} \NC a normal l2r \type {vpack} \NC \NR +\LL +\stoptabulate + +When we talk about layout, we mean the overall layout, concerning the document as +a whole. We can have a dominantly l2r, dominantly r2l or mixed setup. In a next +chapter we will give more details on the dominant setup. Here we stick to +mentioning that the document flow direction is set with + +\starttyping +\setupalign[r2l] % or r2l +\stoptyping + +When a command to setup an environment has a \type {align} parameter, the same +keywords can be uses as part of the specification. \footnote {We haven't tested +all situations and possible interferences. Just report anomalies to the mailing +list.} + +\stopchapter + +\startchapter[title={Numbering and positioning}] + +todo: columns (direction key), numbers (conversionsets), margins (begin/end), etc + +\stopchapter + +\startchapter[title={The \LUA\ interface}] + +We assume that you run \CONTEXT\ \MKIV\ in combination with \LUATEX. Direction +support in this engine has been improved over time. Originally the \OMEGA\ +(\ALEPH) direction model was used but in the meantime it has been stripped to the +basics, and what used to be so called whatsits (extension nodes) are now first +class nodes. In the \LUA\ interface we still support the: + +\startitemize[packed] +\startitem + \type {LTR} and \type {RTL} keywords for local par nodes +\stopitem +\startitem + \type {+LTR}, \type {-LTR}, \type {+RTL} and \type {-RTL} keywords for + direction nodes +\stopitem +\stopitemize + +However, because we use dedicated nodes, and because nodes actually store numbers +and not strings we also expose the numeric model: + +\starttabulate[|l|l|l|] +\NC 0 \NC \type {TLT} \NC left to right \NC \NR +\NC 1 \NC \type {TRT} \NC right to left \NC \NR +\NC 2 \NC \type {LTL} \NC not used in context \NC \NR +\NC 3 \NC \type {RTT} \NC not used in context \NC \NR +\stoptabulate + +These values are used for local par nodes as well as direction nodes. In addition +a direction node has a subtype: + +\starttabulate[|l|l|l|] +\NC 0 \NC \type {normal} \NC comparable to \type {+} \NC \NR +\NC 1 \NC \type {cancel} \NC comparable to \type {-} \NC \NR +\stoptabulate + +The \type {dir} field uses the strings, the \type {direction} field the number +(both of course share the same internal node variable). + +\stopchapter + \stoptext + +% \defineconversionset [\s!default] [] [numbers] +% \defineconversionset [\v!number] [] [numbers] +% \defineconversionset [\v!pagenumber] [] [numbers] +% \defineconversionset [\v!appendix:\s!default] [Romannumerals,Characters] [numbers] +% \defineconversionset [\v!formula] [numbers,characters] % no \v! ? |