From e78478392e9717499b101d0fed642c945c104097 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 22 Oct 2000 00:00:00 +0200 Subject: stable 2000.10.22 --- tex/context/base/colo-ini.tex | 90 +- tex/context/base/colo-rgb.tex | 139 +- tex/context/base/cont-cz.tex | 6 +- tex/context/base/cont-de.tex | 8 +- tex/context/base/cont-en.tex | 8 +- tex/context/base/cont-fil.tex | 30 +- tex/context/base/cont-it.tex | 34 + tex/context/base/cont-log.tex | 27 +- tex/context/base/cont-new.tex | 452 +---- tex/context/base/cont-nl.tex | 8 +- tex/context/base/cont-sys.rme | 16 +- tex/context/base/cont-uk.tex | 2 +- tex/context/base/cont-usr.ori | 28 +- tex/context/base/context.tex | 60 +- tex/context/base/core-buf.tex | 132 +- tex/context/base/core-con.tex | 15 + tex/context/base/core-dat.tex | 26 + tex/context/base/core-des.tex | 2 +- tex/context/base/core-fig.tex | 460 +++-- tex/context/base/core-fil.tex | 14 +- tex/context/base/core-fld.tex | 21 +- tex/context/base/core-fnt.tex | 125 +- tex/context/base/core-grd.tex | 38 +- tex/context/base/core-int.tex | 162 +- tex/context/base/core-itm.tex | 55 +- tex/context/base/core-lst.tex | 67 +- tex/context/base/core-mat.tex | 16 +- tex/context/base/core-mps.tex | 143 -- tex/context/base/core-mul.tex | 344 ++-- tex/context/base/core-nav.tex | 8 +- tex/context/base/core-new.tex | 17 +- tex/context/base/core-not.tex | 64 +- tex/context/base/core-ntb.tex | 921 +++++++++ tex/context/base/core-obj.tex | 10 + tex/context/base/core-pag.tex | 2 +- tex/context/base/core-pos.tex | 1088 +++++++++++ tex/context/base/core-ref.tex | 345 +++- tex/context/base/core-rul.tex | 411 ++-- tex/context/base/core-sec.tex | 146 +- tex/context/base/core-syn.tex | 12 +- tex/context/base/core-tab.tex | 11 +- tex/context/base/core-tbl.tex | 11 +- tex/context/base/core-uti.tex | 6 + tex/context/base/core-var.tex | 1 + tex/context/base/core-ver.tex | 289 ++- tex/context/base/enco-ans.tex | 4 +- tex/context/base/enco-chi.tex | 46 + tex/context/base/enco-ec.tex | 4 +- tex/context/base/enco-fde.tex | 118 ++ tex/context/base/enco-fpl.tex | 90 + tex/context/base/enco-fro.tex | 33 + tex/context/base/enco-ibm.tex | 2 +- tex/context/base/enco-il2.tex | 4 +- tex/context/base/enco-ini.tex | 118 +- tex/context/base/enco-pdf.tex | 4 +- tex/context/base/enco-pol.tex | 2 +- tex/context/base/enco-pro.tex | 72 + tex/context/base/enco-win.tex | 6 +- tex/context/base/enco-x5.tex | 4 +- tex/context/base/font-aer.tex | 69 + tex/context/base/font-ber.tex | 12 +- tex/context/base/font-chi.tex | 733 +++++--- tex/context/base/font-fil.tex | 5 + tex/context/base/font-ini.tex | 549 ++++-- tex/context/base/font-uni.tex | 10 +- tex/context/base/java-fld.tex | 109 +- tex/context/base/java-ini.tex | 24 +- tex/context/base/lang-alt.tex | 10 +- tex/context/base/lang-ana.tex | 6 + tex/context/base/lang-art.tex | 10 +- tex/context/base/lang-bal.tex | 10 +- tex/context/base/lang-cel.tex | 10 +- tex/context/base/lang-ger.tex | 336 ++-- tex/context/base/lang-grk.tex | 10 +- tex/context/base/lang-ind.tex | 10 +- tex/context/base/lang-ini.tex | 30 +- tex/context/base/lang-ita.tex | 203 +- tex/context/base/lang-lab.tex | 3 +- tex/context/base/lang-sla.tex | 159 +- tex/context/base/lang-ura.tex | 10 +- tex/context/base/lang-vn.tex | 12 + tex/context/base/m-chart.tex | 1198 +++++++----- tex/context/base/m-cweb.tex | 1371 ++++++++++++++ tex/context/base/m-pictex.tex | 2 +- tex/context/base/m-units.tex | 22 +- tex/context/base/main-001.tex | 2207 ++++++---------------- tex/context/base/main-002.tex | 221 +-- tex/context/base/main-003.tex | 539 ++++-- tex/context/base/meta-clp.tex | 164 ++ tex/context/base/meta-fig.tex | 85 + tex/context/base/meta-ini.tex | 510 +++++ tex/context/base/meta-pag.tex | 115 ++ tex/context/base/meta-txt.tex | 261 +++ tex/context/base/mult-com.tex | 3188 +++++++++++++++++-------------- tex/context/base/mult-con.tex | 3826 +++++++++++++++++++++++--------------- tex/context/base/mult-ini.tex | 126 +- tex/context/base/mult-sys.tex | 32 +- tex/context/base/s-abr-01.tex | 10 + tex/context/base/s-chi-00.tex | 6 + tex/context/base/s-map-01.tex | 11 +- tex/context/base/s-pre-05.tex | 8 +- tex/context/base/s-pre-15.tex | 179 ++ tex/context/base/s-pre-19.tex | 328 ++++ tex/context/base/spec-fdf.tex | 44 +- tex/context/base/spec-ini.tex | 34 +- tex/context/base/spec-mis.tex | 9 + tex/context/base/spec-pdf.tex | 30 +- tex/context/base/spec-ps.tex | 2 +- tex/context/base/spec-tpd.tex | 11 +- tex/context/base/spec-tr.tex | 2 +- tex/context/base/supp-ali.tex | 140 ++ tex/context/base/supp-box.tex | 486 +++-- tex/context/base/supp-emp.tex | 382 ++++ tex/context/base/supp-eps.tex | 29 +- tex/context/base/supp-fil.tex | 51 +- tex/context/base/supp-fun.tex | 125 +- tex/context/base/supp-lan.tex | 116 +- tex/context/base/supp-mat.tex | 16 +- tex/context/base/supp-mis.tex | 117 +- tex/context/base/supp-mpe.tex | 433 +++-- tex/context/base/supp-mps.tex | 537 ++++-- tex/context/base/supp-pdf.tex | 116 +- tex/context/base/supp-ran.tex | 25 +- tex/context/base/symb-eur.tex | 52 + tex/context/base/symb-ini.tex | 94 +- tex/context/base/syst-etx.tex | 215 +++ tex/context/base/syst-ext.tex | 456 +++-- tex/context/base/syst-gen.tex | 261 ++- tex/context/base/syst-new.tex | 37 + tex/context/base/syst-tex.tex | 53 +- tex/context/base/thrd-ran.tex | 4 + tex/context/base/thrd-tab.tex | 10 +- tex/context/base/typo-ini.tex | 40 + tex/context/base/verb-eif.tex | 211 +++ tex/context/base/verb-ini.tex | 136 +- tex/context/base/verb-pas.tex | 266 +++ tex/context/base/verb-pl.tex | 2 - tex/context/base/verb-sql.tex | 22 +- tex/context/base/verb-xml.tex | 409 ++++ tex/context/config/cont-cz.ini | 2 - tex/context/config/cont-de.ini | 2 - tex/context/config/cont-en.ini | 2 - tex/context/config/cont-nl.ini | 2 - tex/context/config/cont-uk.ini | 2 - tex/context/config/cont-usr.tex | 28 +- tex/context/config/context.ini | 2 - tex/generic/context/m-ch-de.tex | 10 + tex/generic/context/m-ch-en.tex | 10 + tex/generic/context/m-ch-nl.tex | 10 + tex/generic/context/m-metapo.tex | 89 + tex/generic/context/mptopdf.tex | 143 ++ tex/generic/context/ppchtex.noc | 206 ++ tex/latex/context/m-ch-de.sty | 1 + tex/latex/context/m-ch-en.sty | 1 + tex/latex/context/m-ch-nl.sty | 1 + tex/latex/context/m-metapo.sty | 1 + tex/latex/context/m-pictex.sty | 1 + 157 files changed, 20192 insertions(+), 8410 deletions(-) create mode 100644 tex/context/base/cont-it.tex delete mode 100644 tex/context/base/core-mps.tex create mode 100644 tex/context/base/core-ntb.tex create mode 100644 tex/context/base/core-pos.tex create mode 100644 tex/context/base/enco-fde.tex create mode 100644 tex/context/base/enco-fpl.tex create mode 100644 tex/context/base/enco-fro.tex create mode 100644 tex/context/base/enco-pro.tex create mode 100644 tex/context/base/font-aer.tex create mode 100644 tex/context/base/m-cweb.tex create mode 100644 tex/context/base/meta-clp.tex create mode 100644 tex/context/base/meta-fig.tex create mode 100644 tex/context/base/meta-ini.tex create mode 100644 tex/context/base/meta-pag.tex create mode 100644 tex/context/base/meta-txt.tex create mode 100644 tex/context/base/s-pre-15.tex create mode 100644 tex/context/base/s-pre-19.tex create mode 100644 tex/context/base/supp-ali.tex create mode 100644 tex/context/base/supp-emp.tex create mode 100644 tex/context/base/symb-eur.tex create mode 100644 tex/context/base/syst-etx.tex create mode 100644 tex/context/base/typo-ini.tex create mode 100644 tex/context/base/verb-eif.tex create mode 100644 tex/context/base/verb-pas.tex create mode 100644 tex/context/base/verb-xml.tex delete mode 100644 tex/context/config/cont-cz.ini delete mode 100644 tex/context/config/cont-de.ini delete mode 100644 tex/context/config/cont-en.ini delete mode 100644 tex/context/config/cont-nl.ini delete mode 100644 tex/context/config/cont-uk.ini delete mode 100644 tex/context/config/context.ini create mode 100644 tex/generic/context/m-ch-de.tex create mode 100644 tex/generic/context/m-ch-en.tex create mode 100644 tex/generic/context/m-ch-nl.tex create mode 100644 tex/generic/context/m-metapo.tex create mode 100644 tex/generic/context/mptopdf.tex create mode 100644 tex/generic/context/ppchtex.noc create mode 100644 tex/latex/context/m-ch-de.sty create mode 100644 tex/latex/context/m-ch-en.sty create mode 100644 tex/latex/context/m-ch-nl.sty create mode 100644 tex/latex/context/m-metapo.sty create mode 100644 tex/latex/context/m-pictex.sty (limited to 'tex') diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex index d5b9beb6e..02b6ca694 100644 --- a/tex/context/base/colo-ini.tex +++ b/tex/context/base/colo-ini.tex @@ -123,6 +123,36 @@ 11: barva je prevedena na sed \stopmessages +\startmessages italian library: colors + title: colore + 1: sistema -- attivato globalmente + 2: sistema -- attivato localmente + 3: -- non definito + 4: sistema -- caricato + 5: sistema -- sconosciuto + 6: tavolozza -- resa disponibile + 7: tavolozza -- non disponibile + 8: specifica -- del colore -- convertita in nero + 9: spazio dei colori -- non supportato + 10: spazio dei colori -- supportato + 11: il colore è convertito in grigio +\stopmessages + +\startmessages norwegian library: colors + title: farge + 1: system -- er aktivert globalt + 2: system -- er aktivert lokalt + 3: -- er udefinert + 4: system -- er lest inn + 5: ukjent system -- + 6: palett -- er tilgjengelig + 7: palett -- er ikke tilgjengelig + 8: spesifikasjon -- for farge -- gir kun svart + 9: -- fargerom er ikke støttet + 10: -- fargerom er støttet + 11: fargen vil bli vist som grå +\stopmessages + %D \macros %D {definecolor} %D @@ -256,7 +286,7 @@ \newif\ifRGBsupported \newif\ifCMYKsupported -\newif\ifconverttoGRAY +\newif\ifconverttoGRAY % obsolete \newif\ifpreferGRAY \newif\ifGRAYprefered \newif\ifreduceCMYK @@ -272,14 +302,19 @@ %D Color modes are entered using the next set of commands. %D The \type{\stop} alternatives are implemented in a way -%D that permits non||grouped use. +%D that permits non||grouped use. +%D +%D The, for this module redundant, check if we are in color +%D mode is needed when we use these macros in other modules. \def\dostartcolormodeR#1:#2:#3\od% {\bgroup - \def\@@cl@@r{#1}\def\@@cl@@g{#2}\def\@@cl@@b{#3}% + %\def\@@cl@@r{#1}\def \@@cl@@g{#2}\def \@@cl@@b{#3}% + \edef\@@cl@@r{#1}\edef\@@cl@@g{#2}\edef\@@cl@@b{#3}% \ifpreferGRAY\ifx\@@cl@@r\@@cr@@g\ifx\@@cl@@r\@@cl@@b \GRAYpreferedtrue \fi\fi\fi + \ifincolor\else\RGBsupportedfalse\CMYKsupportedfalse\fi \ifGRAYprefered \dostartgraycolormode\@@cl@@r \else\ifRGBsupported @@ -295,10 +330,12 @@ \def\dostartcolormodeC#1:#2:#3:#4\od% {\bgroup - \def\@@cl@@c{#1}\def\@@cl@@m{#2}\def\@@cl@@y{#3}\def\@@cl@@k{#4}% + %\def\@@cl@@c{#1}\def \@@cl@@m{#2}\def \@@cl@@y{#3}\def \@@cl@@k{#4}% + \edef\@@cl@@c{#1}\edef\@@cl@@m{#2}\edef\@@cl@@y{#3}\edef\@@cl@@k{#4}% \ifpreferGRAY\ifx\@@cl@@k\@@cl@@z\ifx\@@cl@@c\@@cr@@m\ifx\@@cl@@c\@@cl@@y \GRAYpreferedtrue \fi\fi\fi\fi + \ifincolor\else\RGBsupportedfalse\CMYKsupportedfalse\fi \ifGRAYprefered \dostartgraycolormode\@@cl@@c \else\ifCMYKsupported @@ -336,13 +373,15 @@ {\getvalue{dostartcolormode#1}} \def\startcolormode#1% - {\doifcolorelse{#1} - {\getcurrentcolorspecs{#1}% - \expandafter\dostartcolormode\currentcolorspecs\od} - {\dostopcolormode}} + {\ifincolor + \doifcolorelse{#1} + {\getcurrentcolorspecs{#1}% + \expandafter\dostartcolormode\currentcolorspecs\od} + {\dostopcolormode}% + \fi} \def\stopcolormode% - {\dostopcolormode} + {\ifincolor\dostopcolormode\fi} %D We use some reserved names for local color components. %D Consistent use of these scratch variables saves us @@ -429,15 +468,25 @@ \doconvertRGBtoCMYK#3\to\@@cl@@y \let\@@cl@@k=\@@cl@@z} +%D The following switch is mainly meant for (hidden) +%D documentation purposes. + +\newif\ifweightGRAY \weightGRAYtrue + +\def\nGRAYfactor{333.333} +\def\rGRAYfactor{\ifweightGRAY300\else\nGRAYfactor\fi} +\def\gGRAYfactor{\ifweightGRAY590\else\nGRAYfactor\fi} +\def\bGRAYfactor{\ifweightGRAY110\else\nGRAYfactor\fi} + \def\convertRGBtoGRAY#1#2#3% {\scratchdimen=#1\s!pt - \scratchdimen=300\scratchdimen + \scratchdimen=\rGRAYfactor\scratchdimen \scratchcounter=\scratchdimen \scratchdimen=#2\s!pt - \scratchdimen=590\scratchdimen + \scratchdimen=\gGRAYfactor\scratchdimen \advance\scratchcounter by \scratchdimen \scratchdimen=#3\s!pt - \scratchdimen=110\scratchdimen + \scratchdimen=\bGRAYfactor\scratchdimen \advance\scratchcounter by \scratchdimen \advance\scratchcounter by \!!medcard \divide\scratchcounter by \!!maxcard @@ -1476,27 +1525,28 @@ \def\MPcolor#1% {\ifMPgraphics - \@EA\@EA\@EA\doMPcolor\csname\??cr#1\endcsname::::\end + \@EA\@EA\@EA\doMPcolor\csname\??cr#1\endcsname:::::\end \else #1% \fi} -\def\doMPcolor#1:#2:#3:#4:#5\end% +\def\doMPcolor#1:#2:#3:#4:#5:#6\end% {\if #1R(#2,#3,#4)% - \else\if#1C(1-#2+#5,1-#3+#5,1-#4+#5)% + \else\if#1C(1-#2-#5,1-#3-#5,1-#4-#5)% +% \else\if#1C(1-#2+#5,1-#3+#5,1-#4+#5)% \else\if#1S(#2,#2,#2)% \else (0,0,0)% \fi\fi\fi} - + %D \macros %D {PDFcolor,FDFcolor} %D %D Similar alternatives are avaliable for \PDF: \def\PDFcolor#1% - {\@EA\@EA\@EA\doPDFcolor\csname\??cr#1\endcsname::::\end} + {\@EA\@EA\@EA\doPDFcolor\csname\??cr#1\endcsname:::::\end} -\def\doPDFcolor#1:#2:#3:#4:#5\end% +\def\doPDFcolor#1:#2:#3:#4:#5:#6\end% {\if #1R#2 #3 #4 rg% \else\if#1C#2 #3 #4 #5 k% \else\if#1S#2 g% @@ -1504,9 +1554,9 @@ \fi\fi\fi} \def\FDFcolor#1% - {\@EA\@EA\@EA\doFDFcolor\csname\??cr#1\endcsname::::\end} + {\@EA\@EA\@EA\doFDFcolor\csname\??cr#1\endcsname:::::\end} -\def\doFDFcolor#1:#2:#3:#4:#5\end% +\def\doFDFcolor#1:#2:#3:#4:#5:#6\end% {[\if #1R#2 #3 #4% \else\if#1C#2 #3 #4 #5% \else\if#1S#2% diff --git a/tex/context/base/colo-rgb.tex b/tex/context/base/colo-rgb.tex index 19934eee7..0b5a7de1c 100644 --- a/tex/context/base/colo-rgb.tex +++ b/tex/context/base/colo-rgb.tex @@ -54,9 +54,9 @@ \definecolor [darkyellow] [r=.8, g=.8, b=.6] \definecolor [middleyellow] [r=1, g=1, b=.2] -\definecolor [darkgray] [r=.5, g=.5, b=.5] -\definecolor [middlegray] [r=.7, g=.7, b=.7] -\definecolor [lightgray] [r=.9, g=.9, b=.9] +\definecolor [darkgray] [s=.5] +\definecolor [middlegray] [s=.7] +\definecolor [lightgray] [s=.9] %D These colors are mapped to interface dependant colornames. @@ -112,6 +112,7 @@ \definecolor [gelb] [yellow] \definecolor [weiss] [white] + \definecolor [grau] [gray] \definecolor [schwarz] [black] \definecolor [dunkelrot] [darkred] @@ -143,44 +144,87 @@ \startinterface czech - \definecolor [cervena] [red] - \definecolor [zelena] [green] - \definecolor [modra] [blue] + \definecolor [cervena] [red] + \definecolor [zelena] [green] + \definecolor [modra] [blue] - \definecolor [azurova] [cyan] - \definecolor [fialova] [magenta] - \definecolor [zluta] [yellow] + \definecolor [azurova] [cyan] + \definecolor [fialova] [magenta] + \definecolor [zluta] [yellow] - \definecolor [bila] [white] - \definecolor [cerna] [black] + \definecolor [bila] [white] + \definecolor [cerna] [black] - \definecolor [tmavecervena] [darkred] - \definecolor [strednecervena][middlered] - \definecolor [svetlecervena] [lightred] + \definecolor [tmavecervena] [darkred] + \definecolor [strednecervena] [middlered] + \definecolor [svetlecervena] [lightred] - \definecolor [tmavezelena] [darkgreen] - \definecolor [strednezelena] [middlegreen] - \definecolor [svetlezelena] [lightgreen] + \definecolor [tmavezelena] [darkgreen] + \definecolor [strednezelena] [middlegreen] + \definecolor [svetlezelena] [lightgreen] - \definecolor [tmavemodra] [darkblue] - \definecolor [strednemodra] [middleblue] - \definecolor [svetlemodra] [lightblue] + \definecolor [tmavemodra] [darkblue] + \definecolor [strednemodra] [middleblue] + \definecolor [svetlemodra] [lightblue] - \definecolor [tmaveazurova] [darkcyan] - \definecolor [stredneazurova][middlecyan] + \definecolor [tmaveazurova] [darkcyan] + \definecolor [stredneazurova] [middlecyan] - \definecolor [tmavefialova] [darkmagenta] - \definecolor [strednefialova][middlemagenta] + \definecolor [tmavefialova] [darkmagenta] + \definecolor [strednefialova] [middlemagenta] - \definecolor [tmavezluta] [darkyellow] - \definecolor [strednezluta] [middleyellow] + \definecolor [tmavezluta] [darkyellow] + \definecolor [strednezluta] [middleyellow] - \definecolor [tmaveseda] [darkgray] - \definecolor [stredneseda] [middlegray] - \definecolor [svetleseda] [lightgray] + \definecolor [tmaveseda] [darkgray] + \definecolor [stredneseda] [middlegray] + \definecolor [svetleseda] [lightgray] \stopinterface +\startinterface italian + + \definecolor [rosso] [red] + \definecolor [verde] [green] + \definecolor [blu] [blue] + + \definecolor [cyan] [cyan] + \definecolor [magenta] [magenta] + \definecolor [giallo] [yellow] + + \definecolor [bianco] [white] + \definecolor [grigio] [gray] + \definecolor [nero] [black] + + \definecolor [rossoscuro] [darkred] + \definecolor [rossomedio] [middlered] + \definecolor [rossochiaro] [lightred] + + \definecolor [verdescuro] [darkgreen] + \definecolor [verdemedio] [middlegreen] + \definecolor [verdechiaro] [lightgreen] + + \definecolor [bluscuro] [darkblue] + \definecolor [blumedio] [middleblue] + \definecolor [bluchiaro] [lightblue] + + \definecolor [cyanscuro] [darkcyan] + \definecolor [cyanchiaro] [middlecyan] + + \definecolor [magentascuro] [darkmagenta] + \definecolor [magentachiaro] [middlemagenta] + + + \definecolor [gialloscuro] [darkyellow] + \definecolor [giallomedio] [middleyellow] + + \definecolor [grigioscuro] [darkgray] + \definecolor [grigiomedio] [middlegray] + \definecolor [grigiochiaro] [lightgray] + +\stopinterface + + %D Like colors, we first define the english colorgroups. These %D colorgroups are tuned for distinctive gray scale printing. @@ -340,19 +384,34 @@ \stopinterface \startinterface czech - \definecolorgroup [seda] [gray] - \definecolorgroup [cervena] [red] - \definecolorgroup [zelena] [green] - \definecolorgroup [modra] [blue] - \definecolorgroup [azurova] [cyan] - \definecolorgroup [fialova] [magenta] - \definecolorgroup [zluta] [yellow] - \definecolorgroup [cervena*][red*] - \definecolorgroup [zelena*] [green*] - \definecolorgroup [modra*] [blue*] - \definecolorgroup [zluta*] [yellow*] + \definecolorgroup [seda] [gray] + \definecolorgroup [cervena] [red] + \definecolorgroup [zelena] [green] + \definecolorgroup [modra] [blue] + \definecolorgroup [azurova] [cyan] + \definecolorgroup [fialova] [magenta] + \definecolorgroup [zluta] [yellow] + \definecolorgroup [cervena*] [red*] + \definecolorgroup [zelena*] [green*] + \definecolorgroup [modra*] [blue*] + \definecolorgroup [zluta*] [yellow*] \stopinterface +\startinterface italian + \definecolorgroup [grigio] [gray] + \definecolorgroup [rosso] [red] + \definecolorgroup [verde] [green] + \definecolorgroup [blu] [blue] + \definecolorgroup [ciano] [cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [giallo] [yellow] + \definecolorgroup [rosso*] [red*] + \definecolorgroup [verde*] [green*] + \definecolorgroup [blu*] [blue*] + \definecolorgroup [giallo*] [yellow*] +\stopinterface + + %D The next set of color palets is quite language independant. %D These palets are meant as examples. diff --git a/tex/context/base/cont-cz.tex b/tex/context/base/cont-cz.tex index e2ba2b56e..05ac01287 100644 --- a/tex/context/base/cont-cz.tex +++ b/tex/context/base/cont-cz.tex @@ -28,8 +28,4 @@ \setupbodyfont [csr,rm,12pt] -\protect - -\dump - -\endinput +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-de.tex b/tex/context/base/cont-de.tex index eb0ab22c4..2e410fd54 100644 --- a/tex/context/base/cont-de.tex +++ b/tex/context/base/cont-de.tex @@ -25,15 +25,11 @@ \installlanguage [\s!uk] [\c!status=\v!start] \installlanguage [\s!de] [\c!status=\v!start] \installlanguage [\s!fr] [\c!status=\v!start] -\installlanguage [\s!sp] [\c!status=\v!start] +\installlanguage [\s!es] [\c!status=\v!start] \installlanguage [\s!nl] [\c!status=\v!start] \installlanguage [deo] [\c!status=\v!start] \setupbodyfont [cmr,rm,12pt] -\protect - -\dump - -\endinput +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-en.tex b/tex/context/base/cont-en.tex index 544876940..a0ff80769 100644 --- a/tex/context/base/cont-en.tex +++ b/tex/context/base/cont-en.tex @@ -25,13 +25,9 @@ \installlanguage [\s!uk] [\c!status=\v!start] \installlanguage [\s!de] [\c!status=\v!start] \installlanguage [\s!fr] [\c!status=\v!start] -\installlanguage [\s!sp] [\c!status=\v!start] +\installlanguage [\s!es] [\c!status=\v!start] \installlanguage [\s!nl] [\c!status=\v!start] \setupbodyfont [cmr,rm,12pt] -\protect - -\dump - -\endinput +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-fil.tex b/tex/context/base/cont-fil.tex index 0f68ef860..2d27b9dad 100644 --- a/tex/context/base/cont-fil.tex +++ b/tex/context/base/cont-fil.tex @@ -13,7 +13,7 @@ \writestatus{loading}{Context File Synonyms} -\definefilesynonym [chemie] [chemic] +\definefilesynonym [chemie] [chemic] \definefilesynonym [unit] [units] \definefilesynonym [eenheid] [units] @@ -23,23 +23,31 @@ \definefilesynonym [pre-general] [pre-00] -\definefilesynonym [pre-original] [pre-01] -\definefilesynonym [pre-green] [pre-02] -\definefilesynonym [pre-funny] [pre-03] -\definefilesynonym [pre-colorful] [pre-04] -\definefilesynonym [pre-fuzzy] [pre-05] -\definefilesynonym [pre-polish] [pre-06] +\definefilesynonym [pre-original] [pre-01] % public +\definefilesynonym [pre-green] [pre-02] % public +\definefilesynonym [pre-funny] [pre-03] % public +\definefilesynonym [pre-colorful] [pre-04] % public +\definefilesynonym [pre-fuzzy] [pre-05] % public +\definefilesynonym [pre-polish] [pre-06] % public \definefilesynonym [pre-spider] [pre-07] -\definefilesynonym [pre-split] [pre-08] +\definefilesynonym [pre-wonder] [pre-08] \definefilesynonym [pre-windows] [pre-09] \definefilesynonym [pre-grow] [pre-10] \definefilesynonym [pre-stack] [pre-11] \definefilesynonym [pre-arrows] [pre-12] \definefilesynonym [pre-writing] [pre-13] -\definefilesynonym [pre-wonder] [pre-14] -\definefilesynonym [pre-balls] [pre-15] +\definefilesynonym [pre-split] [pre-14] +\definefilesynonym [pre-balls] [pre-15] % public \definefilesynonym [pre-knot] [pre-16] - + +% [pre-17] % experimental +% [pre-18] % experimental + +\definefilesynonym [pre-organic] [pre-19] +\definefilesynonym [pre-super] [pre-20] +\definefilesynonym [pre-zoom] [pre-21] +\definefilesynonym [pre-cycle] [pre-22] + \definefilesynonym [abr-pseudocaps] [abr-01] \definefilesynonym [abr-smallcaps] [abr-02] diff --git a/tex/context/base/cont-it.tex b/tex/context/base/cont-it.tex new file mode 100644 index 000000000..b5b020644 --- /dev/null +++ b/tex/context/base/cont-it.tex @@ -0,0 +1,34 @@ +%D \module +%D [ file=cont-en, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ English Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian} + +\input context.tex + +\unprotect + +\setupcurrentlanguage[\s!it] + +\loaduserspecifications + +\installlanguage [\s!en] [\c!status=\v!start] +%\installlanguage [\s!uk] [\c!status=\v!start] +\installlanguage [\s!de] [\c!status=\v!start] +\installlanguage [\s!fr] [\c!status=\v!start] +%\installlanguage [\s!es] [\c!status=\v!start] +\installlanguage [\s!it] [\c!status=\v!start] +%\installlanguage [\s!nl] [\c!status=\v!start] + +\setupbodyfont [cmr,rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.tex index 1aecd0efd..8fd0774f1 100644 --- a/tex/context/base/cont-log.tex +++ b/tex/context/base/cont-log.tex @@ -38,7 +38,7 @@ \kern-.125emX} \def\ConTeXt% - {C% + {C% \CMRkern-.0333emo% \CMRkern-.0333emn% \CMRkern-.0333em\TeX% @@ -98,14 +98,26 @@ 10 at \currentfontscale\bodyfontsize \logofont} +%\unexpanded\def\MetaFont% +% {\hbox{\setMFPfont METAFONT}} +% +%\unexpanded\def\MetaPost% +% {\hbox{\setMFPfont METAPOST}} + +\def\MetaHyphen% there is no hyphenchar in this font + {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}} + \unexpanded\def\MetaFont% - {{\setMFPfont METAFONT}} + {{\setMFPfont META\MetaHyphen FONT}} \unexpanded\def\MetaPost% - {{\setMFPfont METAPOST}} + {{\setMFPfont META\MetaHyphen POST}} + +\unexpanded\def\MetaFun% + {MetaFun} %D \macros -%D {TEX, METAFONT, METAPOST, +%D {TEX, METAFONT, METAPOST, METAFUN, %D PICTEX, TABLE, %D CONTEXT, PPCHTEX, %D AMSTEX, LATEX, LAMSTEX} @@ -119,6 +131,7 @@ \def\METAPOST {\MetaPost} \def\PPCHTEX {\PPCHTeX} \def\CONTEXT {\ConTeXt} +\def\METAFUN {\MetaFun} \def\TEX {\TeX} \def\LATEX {\LaTeX} @@ -142,9 +155,9 @@ %D Some placeholders: -\def\eTeX {\mathematics{\varepsilon}-\TEX} -\def\pdfTeX {pdf\TEX} -\def\pdfeTeX {pdfe-\TEX} +\def\eTeX {\mathematics{\varepsilon}-\TeX} +\def\pdfTeX {pdf\TeX} +\def\pdfeTeX {pdfe-\TeX} \let\ETEX \eTeX \let\PDFTEX \pdfTeX diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index ef0d14211..b33c6cc56 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -18,223 +18,33 @@ \writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!} -%D Hm. Needed for low level calls, like in verbatim. - -\def\startcolormode#1% - {\ifincolor - \doifcolorelse{#1} - {\getcurrentcolorspecs{#1}% - \expandafter\dostartcolormode\currentcolorspecs\od} - {\dostopcolormode}% - \fi} - -\def\stopcolormode% - {\ifincolor\dostopcolormode\fi} - -%D New table stuff. - -\readfile{supp-ali}{}{} % alignment stuff -\readfile{core-ntb}{}{} % new table mechanism - -\ifx\alignmentclass\undefined \else % [|lg{.}|] \NG 12.34 \NC - -\gdef\handletabulatecharalign#1 % space delimited ! - {\edef\alignmentclass{\tabulatecolumn}% - \edef\alignmentcharacter{\getvalue{\@@tabalign@@\tabulatecolumn}}% - \ifcase\tabulatepass\or - \setfirstpasscharacteralign\checkalignment{#1}% - \fi % force hsize - \setsecondpasscharacteralign\checkalignment{#1}} - -\fi - -%D A funny (but rather stupid) one. - -\def\removebottomthings% - {\dorecurse{5}{\unskip\unkern\unpenalty}} - -%D We also support broad here: - -\def\dosetraggedcommand#1% - {\expanded{\dodosetraggedcommand{#1}}} - -\def\dodosetraggedcommand#1% - {\doifinsetelse{\v!ruim} {#1}{\!!doneatrue}{\!!doneafalse}% - \doifinsetelse{\v!breed}{#1}{\!!donebtrue}{\!!donebfalse}% - \let\raggedcommand\relax - \let\raggedtopcommand\empty - \let\raggedbottomcommand\empty - \ExpandFirstAfter\processallactionsinset - [#1] - [ \v!links=>\if!!donea \def\raggedcommand{\veryraggedleft}% - \else \def\raggedcommand{\raggedleft}% - \fi, - \v!rechts=>\if!!donea \def\raggedcommand{\veryraggedright}% - \else \def\raggedcommand{\raggedright}% - \fi, - \v!midden=>\if!!doneb \def\raggedcommand{\raggedwidecenter}% - \else\if!!donea \def\raggedcommand{\veryraggedcenter}% - \else \def\raggedcommand{\raggedcenter}% - \fi\fi, - \v!hoog=>\let\raggedbottomcommand\vfilll, % bonus, pretty strong - \v!laag=>\let\raggedtopcommand \vfilll, % used with \framed - \v!nee=>\def\raggedcommand{\raggedright}, - \v!ja=>\let\raggedcommand\relax, - \v!normaal=>\let\raggedcommand\relax]} - -%D Sometimes a capstrut comes in handy -%D -%D \starttabulatie[|Tl|l|l|] -%D \NC yes \NC normal strut \NC {\toonstruts\setupstrut[ja]\strut} \NC \NR -%D \NC no \NC no strut \NC {\toonstruts\setupstrut[nee]\strut} \NC \NR -%D \NC kap \NC a capital strut (i.e. Q) \NC {\toonstruts\setupstrut[kap]\strut} \NC \NR -%D \NC A B \unknown \NC a character strut (e.g. A) \NC {\toonstruts\setupstrut[A]\strut} \NC \NR -%D \NC \NC a normal strut \NC {\toonstruts\setupstrut\strut} \NC \NR -%D \stoptabulatie - -\def\setstrut% - {\setstrutdimen\strutheight\strutheightfactor\spacingfactor - \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor - \dosetstrut} - -\def\setcharstrut#1% - {\setbox\strutbox=\hbox{#1}% - \edef\strutheight{\the\ht\strutbox}% - \edef\strutdepth {\the\dp\strutbox}% - \dosetstrut} - -\def\setcapstrut% could be M, but Q has descender - {\setcharstrut{Q}} - -\def\setupstrut% - {\dosingleempty\dosetupstrut} - -\def\dosetupstrut[#1]% - {\processaction - [#1] - [ \v!ja=>\setstrut, - \v!nee=>\setnostrut, - \v!kap=>\setcapstrut, - \s!default=>\setstrut, - \s!unknown=>\setcharstrut{\commalistelement}]} - -%D Centered looks nicer: - -\def\dosetstrut% - {\let\strut=\normalstrut - \setbox\strutbox=\normalhbox - {\normalhbox to \!!zeropoint - {% \hss % new, will be option - \vrule - \!!width \strutwidth - \!!height\strutheight - \!!depth \strutdepth - \hss}}} - -%D in case of no color we don't want to see the rules - -\def\dophantombox#1\\{\hphantom{\dofilledbox#1\\}} - -\def\raster[#1]% - {\groupedcommand{\startraster[#1]}{\stopraster}} - -\def\setgraybox\width#1\height#2\depth#3\raster#4\corner#5\radius#6\\% - {\doifelsenothing{#4} - {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\} - {\raster[#4]% - {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}}} - -\def\setcolorbox\width#1\height#2\depth#3\color#4\corner#5\radius#6\\% - {\ifincolor - \doifcolorelse{#4}{\color[#4]% - {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}} - {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\}% +%D Interesting, saves keystrokes, but also dangerous. + +%\def\checkMPbackground% +% {\doifoverlayelse\currentbackground +% {} +% {\doifMPgraphicelse\currentbackground +% {\defineoverlay[\currentbackground][\useMPgraphic{\currentbackground}]} +% {}}} +% +%\appendtoks \checkMPbackground \to \everybackgroundbox + +%D Better (no zero dimension mp figs) and faster: + +\def\dododopagebodybackground#1#2#3#4% + {\ifsomebackgroundfound{#3#4}% + \ifdim#1>\!!zeropoint\relax + \ifdim#2>\!!zeropoint\relax + \localframed + [\??ma#3#4] + [\c!breedte=#1,\c!hoogte=#2,\c!offset=\v!overlay] + {\getvalue{\??ma#3#4\c!commando}}% {\hsize=#1\vsize=#2....} + \fi + \fi \else - \dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\% + \hskip#1% \fi} -%D more and more - -\def\lhbox{\dowithnextbox{\hbox to \hsize{\box\nextbox\hss }}\hbox} -\def\mhbox{\dowithnextbox{\hbox to \hsize{\hss\box\nextbox\hss}}\hbox} -\def\rhbox{\dowithnextbox{\hbox to \hsize{\hss\box\nextbox }}\hbox} - -\let\lefthbox =\lhbox -\let\midhbox =\mhbox -\let\righthbox=\rhbox - -%D to be tested - -\def\docomplexuit[#1::#2]% - {\dontleavehmode % added, but probably not needed - \bgroup - \doifdefinedelse{\v!file:::#1} - {\def\doexternaldocument[##1][##2][##3]% - {\naar{##3}[#1::#2]}% - \getvalue{\v!file:::#1}} - {\tttf[#1]}% - \egroup} - -%D Makes sense: - -\def\removelastskip% \ifvmode the plain tex one \fi - {\ifvmode\ifdim\lastskip=\z@\else\vskip-\lastskip\fi\fi} - -%D More hyphention control, will be combined with hz setup. - -\def\nohyphens% - {\ifx\dohyphens\relax - \edef\dohyphens% - {\hyphenpenalty\the\hyphenpenalty - \exhyphenpenalty\the\exhyphenpenalty\relax}% - \fi - \hyphenpenalty\@M\exhyphenpenalty\@M} - -\let\dohyphens\relax - -%D Better (a mere copy with \dohyphens): - -\bgroup \catcode`\~=\active \catcode`\/=\active - -\unexpanded\gdef\hyphenatedurl#1% {}{} handles accents - {\bgroup - \ifnum\hyphenpenalty<10000 \else - \def\discretionary##1##2##3{##1\allowbreak##2}% - \fi - \obeyhyphens - \def\splitbefore##1% - {\setbox\scratchbox=\hbox{##1{}{}}% - \ifcase\urlsplitmode - \box\scratchbox - \or - \postwordbreak\box\scratchbox\prewordbreak - \or - \prewordbreak\discretionary{\box\scratchbox}{}{\box\scratchbox}\prewordbreak - \else - \postwordbreak\box\scratchbox\prewordbreak - \fi}% - \def\splitafter##1% - {\ifcase\urlsplitmode - ##1{}{}% - \or - \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak - \or - \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak - \else - \prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak - \fi}% - \def\flushurl% - {\savedurl\let\savedurl\empty}% - \def\\% - {\spliturl\#}% - \let\~=\tildeletter \let~=\~% - \let\/=\slashletter \let/=\/% - \let\savedurl\empty - \handletokens#1\with\scanurl - \egroup} - -\egroup - %D A prelude to strategies. Note for myself: overloads %D previous stuff from local pragma test files. @@ -291,9 +101,11 @@ \def\doifstrategyvariable #1#2{\doifstrategyvariableelse{#1}{#2}{}} \def\doifnotstrategyvariable#1#2{\doifstrategyvariableelse{#1}{}{#2}} -%D New: only at start of columns; may change ! +%D New: only at start of columns; may change ! Rather +%D interwoven and therefore to be integrated when the multi +%D column modules are merged. -\definesystemvariable {ks} % KolomSpan +% already taken care of: \definesystemvariable{ks} \def\setupcolumnspan[#1]% {\getparameters[\??ks][#1]} @@ -312,16 +124,14 @@ {\bgroup \setupcolumnspan[#1]% \forgetall -% - \ifbinnenkolommen - \advance\hsize by \intercolumnwidth - \hsize=\@@ksn\hsize - \advance\hsize by -\intercolumnwidth - \fi -% + \ifbinnenkolommen + \advance\hsize by \intercolumnwidth + \hsize=\@@ksn\hsize + \advance\hsize by -\intercolumnwidth + \fi \dowithnextbox {\setbox\columnspanbox=\box\nextbox -\ifbinnenkolommen\wd\columnspanbox=\hsize\fi + \ifbinnenkolommen\wd\columnspanbox=\hsize\fi \postprocesscolumnspanbox\columnspanbox \scratchdimen=\ht\columnspanbox \setbox\columnspanbox=\hbox % depth to be checked, probably option! @@ -353,11 +163,6 @@ \prevdepth\dp\strutbox \egroup} \vbox\bgroup -% \ifbinnenkolommen -% \advance\hsize by \intercolumnwidth -% \hsize=\@@ksn\hsize -% \advance\hsize by -\intercolumnwidth -% \fi %\topskipcorrection % becomes an option ! \EveryPar{\begstrut\EveryPar{}}} % also ! @@ -367,147 +172,14 @@ \def\stopcolumnspan% {\egroup} -%D A test: - -\def\EndTableParBox% - {\removelastskip % added - %\MakeStrut{0pt}{\StrutDepthFactor\StrutUnit} % removed -\par -\ifnum\prevgraf>0 - \strut - \vskip-\lineheight -\fi - \egroup % finishes the \vtop begun by \BeginTableParbox - \getboxheight\scratchdimen\of\box\scratchbox\relax % added - \ifdim\scratchdimen>\TABLEparheight % added - \global\TABLEparheight=\scratchdimen % added - \fi % added - \box\scratchbox} - -%D A few local optimizations and new features: - -\readfile {cont-loc} {} {} - -%D For Ton: +%D For Ton. Do be documented. \def\plaatsexterndocument[#1]% {\def\doexternaldocument[##1][##2][##3]% {\readlocfile{##2}{}{}}% \getvalue{\v!file:::#1}} -%D For me: - -\beginTEX - -\def\p!doifinstringelse#1#2% - {\def\pp!doifinstringelse##1#1##2##3\war% - {\csname if\if##2@fals\else tru\fi e\endcsname}% - \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here - -\endTEX - -\beginETEX \unless - -\def\p!doifinstringelse#1#2% - {\def\pp!doifinstringelse##1#1##2##3\war% - {\unless\if##2@}% - \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here - -\endETEX - -%D For Willy's nested commented buffers: - -\def\processnextbufferline#1#2#3% - {\relax % checken waarom eerdere macro dit nodig heeft / supp-mps run - \convertargument#1 \to\next - \doifinstringelse{\delcharacter\texcommentsymbol}{\delcharacter\next} - {\def\next{#3}} - {\doifinstringelse{\endofblock}{\next} - {\ifnum\nestedbufferlevel=0\relax % \relax ? - \def\next{#2}% - \else - \decrement\nestedbufferlevel\relax - \def\next{#3}% - \fi} - {\doifinstringelse{\beginofblock}{\next} - {\increment\nestedbufferlevel\relax - \def\next{#3}} - {\def\next{#3}}}}% - \next} - -%D Some day: - -% \definieermarkering[\v!margetitel] -% -% \def\complexmargewoord[#1][#2]#3% -% {\doglobal\increment\margincontent -% \stelinmargein[\margincontent][]% see next macro -% \@EA\setgvalue\@EA{\@EA\??im\@EA\margincontent\@EA}\@EA -% {\@EA\stelinmargein\@EA[\margincontent][]% see next macro -% \flushmargincontent[#1][#2]{#3}% -% \markeer[\v!margetitel]{#3}}} - -%D Undocumented and still under development. - -\def\startsimplecolumns% - {\dosingleempty\dostartsimplecolumns} - -\def\dostartsimplecolumns[#1]% - {\bgroup - \getparameters[\??kl][\c!breedte=\hsize,\c!afstand=1em,\c!n=2,#1]% - \setrigidcolumnhsize\@@klbreedte\@@klafstand\@@kln - \setbox\scratchbox=\vbox\bgroup - \forgetall} % \blanko[\v!blokkeer] - -\def\stopsimplecolumns% - {\removebottomthings - \egroup - \rigidcolumnbalance\scratchbox - \egroup} - -%D Improved: - -\newbox\rigidcolumnbox - -\def\rigidcolumnbalance#1% - {\ifnum\rigidcolumns=1 % tzt ook h/d correctie - \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax - \else - \vbox - {\forgetall - \dontcomplain - \setbox\rigidcolumnbox=\vbox - {\line{}\goodbreak\unvbox#1\removebottomthings}% - \splittopskip=\openstrutheight - \setbox\scratchbox=\vsplit\rigidcolumnbox to \!!zeropoint - \scratchdimen=\ht\rigidcolumnbox - \divide\scratchdimen by \rigidcolumns - \getnoflines\scratchdimen - \scratchdimen=\noflines\lineheight - \setbox\scratchbox=\hbox to \savedrigidhsize - {\dorecurse{\rigidcolumns} - {\setbox\scratchbox=\vsplit\rigidcolumnbox to \scratchdimen - \dp\scratchbox=\openstrutdepth - \vtop - \ifalignrigidcolumns to - \ifstretchrigidcolumns\vsize\else\scratchdimen\fi - \fi - {\unvbox\scratchbox}% - \hfill}% - \hfillneg}% - \advance\scratchdimen by -\openstrutdepth - \setbox\scratchbox\hbox{\raise\scratchdimen\box\scratchbox} - \dp\scratchbox=\openstrutdepth - \ht\scratchbox=\scratchdimen - \box\scratchbox} - \fi} - -%D Is this a better default? - -\def\doverbatimgoodbreak% - {} % instead of {\ifoptimizeverbatim\penalty100\fi} - -%D Hm: +%D Far from complete. \def\startgeheel% {\startregelcorrectie @@ -516,56 +188,12 @@ \def\stopgeheel {\stopregelcorrectie} -%D Under construction: - -\def\resetpositions% - {\let\someposition=\gobblesevenarguments % old - \let\pxypos =\gobblefourarguments % new - \let\pxywhdpos =\gobblesevenarguments} % new - -\resetpositions - -%D Some more box stuff, related to positioning (under -%D construction). Nice stuff for a tips and tricks maps -%D article. -%D -%D \starttypen -%D \raisebox{100pt}\hbox{test} -%D \raisebox50pt\hbox{test} -%D \hsmash{\raisebox{100pt}\hbox{test}} -%D \stoptypen - -\def\doraiselowerbox#1#2% a nice trick us used to accept - {\def\next% % both direct and {} dimensions - {\dowithnextbox - {\setbox\nextbox=\hbox{#1\scratchdimen\box\nextbox}% - \ht\nextbox=\ht\strutbox - \dp\nextbox=\dp\strutbox - \box\nextbox}}% - \afterassignment\next\scratchdimen=#2} +%D No more news. -\def\raisebox{\doraiselowerbox\raise} -\def\lowerbox{\doraiselowerbox\raise} - -%D It's more convenient to use \type {\columnwidth} instead -%D of messing around with boxes each time. - -\newdimen\columnwidth -\newdimen\gutterwidth - -\def\determinecolumnwidth% - {\bgroup - \setbox\scratchbox=\hbox - {\setcolumnhsize - \global\columnwidth=\usercolumnwidth - \global\gutterwidth=\intercolumnwidth}% - \egroup} - -%D The next line can be uncommented when Taco's extensions to -%D \quote {\TEX\ The Program} are used. +\protect -% \readfile {syst-eet} {} {} +%D A few local optimizations and new features, if defined: -\protect +\readfile {cont-loc} {} {} \endinput diff --git a/tex/context/base/cont-nl.tex b/tex/context/base/cont-nl.tex index 7b64f597e..2f4d33662 100644 --- a/tex/context/base/cont-nl.tex +++ b/tex/context/base/cont-nl.tex @@ -25,13 +25,9 @@ \installlanguage [\s!uk] [\c!status=\v!start] \installlanguage [\s!de] [\c!status=\v!start] \installlanguage [\s!fr] [\c!status=\v!start] -\installlanguage [\s!sp] [\c!status=\v!start] +\installlanguage [\s!es] [\c!status=\v!start] \installlanguage [\s!nl] [\c!status=\v!start] \setupbodyfont [cmr,rm,12pt] -\protect - -\dump - -\endinput +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-sys.rme b/tex/context/base/cont-sys.rme index 0378f95b7..847f51d6b 100644 --- a/tex/context/base/cont-sys.rme +++ b/tex/context/base/cont-sys.rme @@ -63,12 +63,22 @@ % % Enabling run time \METAPOST\ (also enable \write18 in texmf.cnf): -\runMPgraphicstrue -\recycleMPslotstrue + \runMPgraphicstrue +\runMPTEXgraphicstrue + \recycleMPslotstrue +\useMETAFUNformattrue % Enabling nested pretty printing: -\newprettytrue + \newprettytrue + +% Protect filenames: + + \protectbufferstrue + +% not really needed + +% \runutilityfiletrue % So far. diff --git a/tex/context/base/cont-uk.tex b/tex/context/base/cont-uk.tex index e1bb62d9d..cc087c36d 100644 --- a/tex/context/base/cont-uk.tex +++ b/tex/context/base/cont-uk.tex @@ -25,7 +25,7 @@ \installlanguage [\s!uk] [\c!status=\v!start] \installlanguage [\s!de] [\c!status=\v!start] \installlanguage [\s!fr] [\c!status=\v!start] -\installlanguage [\s!sp] [\c!status=\v!start] +\installlanguage [\s!es] [\c!status=\v!start] \installlanguage [\s!nl] [\c!status=\v!start] \setupbodyfont [cmr,rm,12pt] diff --git a/tex/context/base/cont-usr.ori b/tex/context/base/cont-usr.ori index 161c076c0..a02a01429 100644 --- a/tex/context/base/cont-usr.ori +++ b/tex/context/base/cont-usr.ori @@ -39,6 +39,7 @@ \definefilesynonym [lang-no.pat] [nohyph.tex] \definefilesynonym [lang-pl.pat] [plhyph.tex] \definefilesynonym [lang-pt.pat] [pthyph.tex] +\definefilesynonym [lang-ro.pat] [rohyph.tex] \definefilesynonym [lang-sk.pat] [skhyph.tex] \definefilesynonym [lang-sp.pat] [sphyph.tex] \definefilesynonym [lang-sv.pat] [sehyph.tex] @@ -46,6 +47,20 @@ \definefilesynonym [lang-uk.pat] [ukhyphen.tex] \definefilesynonym [lang-us.pat] [ushyph1.tex] +%D When the dutch spelling changed, new patterns were +%D constructed. For long these were named \type {dutch96.pat}. +%D From 2000 however, the old \type {nehyph} files were +%D replaced by \type {nehyph96.tex}. Typical something that +%D you have to find out by accident. The names of hyphenation +%D files as well as their coding is one of the dark areas of +%D \TEX\ distributions. + +\doiffileelse{nehyph96.tex} + {\definefilesynonym[lang-nl.pat][nehyph96.tex]} + {\doiffileelse{dutch96.pat} + {\definefilesynonym[lang-nl.pat][dutch96.pat]} + {\definefilesynonym[lang-nl.pat][nehyph.tex]}} + %D Pattern files are (can be) encoded! And, alas, not all %D pattern files are self contained, which is why (for the %D moment) we specify encodings here. @@ -79,8 +94,9 @@ % \installlanguage [\s!no] [\c!status=\v!start] % norwegian % \installlanguage [\s!pl] [\c!status=\v!start] % polish % \installlanguage [\s!pt] [\c!status=\v!start] % portuguese +% \installlanguage [\s!ro] [\c!status=\v!start] % romanian % \installlanguage [\s!sk] [\c!status=\v!start] % slovak -% \installlanguage [\s!sp] [\c!status=\v!start] % spanish +% \installlanguage [\s!es] [\c!status=\v!start] % spanish % \installlanguage [\s!sv] [\c!status=\v!start] % swedish % \installlanguage [\s!tr] [\c!status=\v!start] % turkish % \installlanguage [\s!uk] [\c!status=\v!start] % english uk @@ -105,8 +121,9 @@ % \setupcurrentlanguage[\s!no] % \setupcurrentlanguage[\s!pl] % \setupcurrentlanguage[\s!pt] +% \setupcurrentlanguage[\s!ro] % \setupcurrentlanguage[\s!sk] -% \setupcurrentlanguage[\s!sp] +% \setupcurrentlanguage[\s!es] % \setupcurrentlanguage[\s!sv] % \setupcurrentlanguage[\s!tr] @@ -119,6 +136,13 @@ % \definefilesynonym [font-cmr] [font-csr] % czech & slovak % \definefilesynonym [font-cmr] [font-plr] % polish +%D In some languages, compound characters, like \type {"e} +%D are used to get accented and non latin characters. + + \useencoding[fde] % german +% \useencoding[fro] % romanian +% \useencoding[fpl] % polish + %D Don't remove the next few lines. \protect \endinput diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 0c18656cc..098c55493 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -13,7 +13,7 @@ \catcode`\{=1 \catcode`\}=2 -\def\contextversion{2000.5.11} +\def\contextversion{2000.10.22} %D Welcome to the main module. When this module is ran through %D \type{initex} or \type{tex -i} or \type{whatevertex} using @@ -28,6 +28,7 @@ %D minimal as possible. \input syst-tex.tex +\input syst-etx.tex \input syst-gen.tex \input syst-ext.tex \input syst-new.tex @@ -36,6 +37,12 @@ \CONTEXTtrue +%D In order to conveniently load files, we need a few +%D support modules. + +\input supp-ini.tex +\input supp-fil.tex + %D After this we're ready for the multi||lingual interface %D modules. @@ -52,8 +59,6 @@ %D Now we're ready for some general support modules. These %D modules implement some basic typesetting functionality. -\input supp-ini.tex -\input supp-fil.tex \input supp-box.tex \input supp-mrk.tex \input supp-vis.tex @@ -66,8 +71,14 @@ \input supp-tpi.tex \input supp-mat.tex \input supp-ran.tex +\input supp-ali.tex -%D Verbatim typestting is implemented in a separate class of +%D The next module deals with language specific typographic +%D extensions. + +\input typo-ini.tex + +%D Verbatim typesetting is implemented in a separate class of %D modules. The pretty typesetting modules are loaded at run %D time. @@ -164,8 +175,19 @@ \input core-pag.tex \input core-tbl.tex \input core-mis.tex -\input core-mps.tex \input core-int.tex +\input core-ntb.tex + +%D Like languages, fonts, encodings and symbols, \METAPOST\ +%D support is also organized in its own class of modules. + +\input meta-ini.tex +\input meta-pag.tex +\input meta-fig.tex + +%D On which the next one depends: + +\input core-pos.tex %D A few more languages, that have specifics using core %D functionality: @@ -198,7 +220,7 @@ \input main-002.tex % still to be split \input main-003.tex % still to be split -\input core-fig.tex +\input core-fig.tex % after page body \input core-par.tex %D The next two modules implement some additional @@ -276,6 +298,21 @@ \stopinterface +\startinterface italian + +\writestring{Questo pacchetto è basato sul Plain TeX. Usa una versione adattata del} +\writestring{meccanismo di marcatura esteso di J. Fox (1987) ad alcune parti del} +\writestring{meccanismo per i float laterali di D. Comenetz (1993). La maggior parte} +\writestring{Plain TeX di D.E. Knuth (\fmtversion) è disponibile e può essere usata} +\writestring{senza problemi. Questo pacchetto usa TaBlE, un pacchetto progettato e} +\writestring{con diritti di copia di M.J. Wichura (1988). Solo qualche file ausiliario} +\writestring{viene generato, alcuni dei quali devono essere elaborati da TeXUtil} +\writestring{(\utilityversion). La versione attuale del blocco è \blockversion.} +\writestring{} +\writestring{L'INTERFACCIA UTENTE ITALIANA E' ANCORA IN VIA DI SVILUPPO!} + +\stopinterface + \edef\copyrightversion% {Copyright 1990-\the\normalyear\normalspace / PRAGMA ADE / J. Hagen - A.F. Otten} @@ -345,6 +382,15 @@ \stopinterface +\startinterface italian + + \installlanguage [\s!it] [\c!status=\v!start] + + \appendtoks \language [\s!it] \to \everyjob + \appendtoks \mainlanguage [\s!it] \to \everyjob + +\stopinterface + \protect %D Finally we load some fonts. @@ -353,6 +399,6 @@ %D Now dumping the format is all that's left to be done. -\dump +\errorstopmode \dump \endinput diff --git a/tex/context/base/core-buf.tex b/tex/context/base/core-buf.tex index 445abc564..431669918 100644 --- a/tex/context/base/core-buf.tex +++ b/tex/context/base/core-buf.tex @@ -79,6 +79,38 @@ 12: -- preskoceno \stopmessages +\startmessages italian library: textblocks + title: blocchi di testo + 1: nuova versione, seconda passata necessaria + 2: scrittura dei blocchi su -- + 3: lettura dei blocchi da -- + 4: seconda passata necessaria + 5: -- non nascosto + 6: -- nascosto ed elaborato + 7: -- nascosto + 8: -- composto + 9: -- non composto + 10: -- caricato ed elaborato + 11: -- caricato e composto + 12: -- saltato +\stopmessages + +\startmessages norwegian library: textblocks + title: tekstblokker + 1: ny versjon, andre gjennomkjøring nødvendig + 2: skriver blokker til -- + 3: leser blokker fra -- + 4: andre gjennomkjøring nødvendig + 5: -- ikke skjult + 6: -- skjult og behandlet + 7: -- skjult + 8: -- tegnsatt + 9: -- ikke tegnsatt + 10: -- lest inn og behandlet + 11: -- lest inn og tegnsatt + 12: -- utelatt +\stopmessages + \unprotect % PAS OP! @@ -109,6 +141,12 @@ \fi \egroup} +\def\resetbuffer% + {\dosingleempty\doresetbuffer} + +\def\doresetbuffer[#1]% + {\unlinkfile{\TEXbufferfile{\iffirstargument#1\else\jobname\fi}}} + % \EveryPar% % {\doglobal\newcounter\NOfLines} % @@ -117,26 +155,25 @@ % \hskip-3em% % \hbox to 3em{\hss\NOfLines\hskip1em}} +%D For Willy's nested commented buffers, we need the \type +%D {\delcharacter} trick. + \def\processnextbufferline#1#2#3% {\relax % checken waarom eerdere macro dit nodig heeft / supp-mps run \convertargument#1 \to\next - \ifx\next\emptybufferline - \ifsegmentatebuffer \emptybufferlinetrue \fi - \def\next{#3}% - \else - \emptybufferlinefalse - \doifinstringelse{\endofblock}{\next} - {\ifnum\nestedbufferlevel=0\relax % \relax ? - \def\next{#2}% - \else - \decrement\nestedbufferlevel\relax - \def\next{#3}% - \fi} - {\doifinstringelse{\beginofblock}{\next} - {\increment\nestedbufferlevel\relax - \def\next{#3}} - {\def\next{#3}}}% - \fi + \doifinstringelse{\delcharacter\texcommentsymbol}{\delcharacter\next} + {\def\next{#3}} + {\doifinstringelse{\endofblock}{\next} + {\ifnum\nestedbufferlevel=0\relax % \relax ? + \def\next{#2}% + \else + \decrement\nestedbufferlevel\relax + \def\next{#3}% + \fi} + {\doifinstringelse{\beginofblock}{\next} + {\increment\nestedbufferlevel\relax + \def\next{#3}} + {\def\next{#3}}}}% \next} \def\dostartbuffer% @@ -153,7 +190,7 @@ \next} \def\dododostartbuffer[#1][#2][#3][#4]% - {\showmessage{\m!systems}{15}{#2}% + {%\showmessage{\m!systems}{15}{#2}% \doifelsevalue{\??bu#1\c!alinea}{\v!ja} {\segmentatebuffertrue} {\doifnumberelse{\getvalue{\??bu#1\c!alinea}} @@ -175,8 +212,10 @@ \egroup \getvalue{#4}}% \doifelsenothing{#2} - {\immediate\openout\tmpblocks=\TEXbufferfile{\jobname}} - {\immediate\openout\tmpblocks=\TEXbufferfile{#2}}% + {\message{<\TEXbufferfile{\jobname}>}% + \immediate\openout\tmpblocks=\TEXbufferfile{\jobname}} + {\message{<\TEXbufferfile{#2}>}% + \immediate\openout\tmpblocks=\TEXbufferfile{#2}}% \ifsegmentatebuffer \immediate\write\tmpblocks{\string\startbufferparagraph}% \fi @@ -197,7 +236,7 @@ \def\dobuffer#1[#2]#3% {\def\dodobuffer##1% - {\showmessage{\m!systems}{#1}{##1}% + {%\showmessage{\m!systems}{#1}{##1}% \beginrestorecatcodes \doifdefinedelse{\??bu##1\c!nummer} {#3{\TEXbufferfile{def-\getvalue{\??bu##1\c!nummer}}}{}{}} @@ -497,7 +536,7 @@ \endrestorecatcodes} \def\setupcopyblock% - {\dostepwiserecurse{1}{255}{1}{\catcode\recurselevel=\@@other}% + {\makeallother % \dostepwiserecurse{1}{255}{1}{\catcode\recurselevel=\@@other}% \obeylines} \def\writeoutblocks% @@ -514,13 +553,13 @@ \bgroup \obeylines -\gdef\copyblocklineAB#1 +\long\gdef\copyblocklineAB#1 {\processnextblocklineAB{#1}% {\closeblock}% {\writeoutblocks{#1}% \writetmpblock{#1}% \copyblocklineAB}} -\gdef\skipblocklineAB#1 +\long\gdef\skipblocklineAB#1 {\processnextblocklineAB{#1}% {\closeblock}% {\skipblocklineAB}} @@ -541,13 +580,13 @@ \bgroup \obeylines -\gdef\copyblockline#1 +\long\gdef\copyblockline#1 {\processnextblockline{#1}% {\closeblock}% {\writeoutblocks{#1}% \writetmpblock{#1}% \copyblockline}} -\gdef\skipblockline#1 +\long\gdef\skipblockline#1 {\processnextblockline{#1}% {\closeblock}% {\skipblockline}} @@ -856,6 +895,47 @@ \def\beginvanblok[#1]% % er wordt ook gechecked op \eindvanblok[..] {\getvalue{\e!beginvan#1}} + +\def\forceerblokken[#1]% + {\def\docommando##1% + {\setvalue{\e!beginvan##1}% + {\setblocklevel+\bgroup + \dodoubleempty\doforceerblok[##1]}% + \setvalue{\e!eindvan##1}% + {\getvalue{\??tb##1\c!na}% + \egroup\setblocklevel-}}% + \processcommalist[#1]\docommando} + +\def\doforceerblok[#1][#2]% + {\doifassignmentelse{#2} + {\settrue \blockassignmentstatus} + {\setfalse\blockassignmentstatus}% + \ifconditional\blockassignmentstatus + \dosetupblockparameters[#1][#2]% + \fi + \getvalue{\??tb#1\c!voor}% + \doattributes{\??tb#1}\c!letter\c!kleur{}% + \getvalue{\??tb#1\c!binnen}} + +\def\passeerblokken[#1]% + {\def\docommando##1% + {\setvalue{\e!beginvan##1}% + {\setblocklevel+\bgroup + \obeylines % here, since we look ahead + \dodoubleempty\dopasseerblok[##1]}%}% + \setvalue{\e!eindvan##1}% + {}}% + \processcommalist[#1]\docommando} + +\def\dopasseerblok[#1][#2]% + {\def\closeblock% + {\egroup\setblocklevel-}% + \checkcopyingblocks + \obeylines + \@EA\@EA\@EA\convertargument\@EA\string\csname\e!eindvan#1\endcsname\to\endofblockA + \@EA\convertargument\string\eindvanblok[#1]\to\endofblockB % MULTI LINGUAL MAKEN + \setupcopyblock + \skipblocklineAB} % the buffer mechanism handles nesting, add some switch diff --git a/tex/context/base/core-con.tex b/tex/context/base/core-con.tex index b378db9d9..07a3072a8 100644 --- a/tex/context/base/core-con.tex +++ b/tex/context/base/core-con.tex @@ -154,6 +154,18 @@ \unknowncharacter \fi}} +%D \macros +%D {oldstylenumerals,oldstyleromannumerals} +%D +%D These conversions are dedicated to Frans Goddijn. + +\unexpanded\def\oldstylenumerals#1% + {{\os\number#1}} + +\unexpanded\def\oldstyleromannumerals#1% + {{\leftrulefalse\rightrulefalse\ss\txx\boxrulewidth=.15ex + \ruledhbox spread .15em{\hss\uppercased{\romannumerals{#1}}\hss}}} + %D \macros %D {protectconversion} %D @@ -579,6 +591,9 @@ \defineconversion [g] [\greeknumerals] \defineconversion [G] [\Greeknumerals] +\defineconversion [o] [\oldstylenumerals] +\defineconversion [or] [\oldstyleromannumerals] + \defineconversion [\v!letter] [\character] \defineconversion [\v!Letter] [\Character] diff --git a/tex/context/base/core-dat.tex b/tex/context/base/core-dat.tex index b9f9b594c..dad330ebd 100644 --- a/tex/context/base/core-dat.tex +++ b/tex/context/base/core-dat.tex @@ -37,6 +37,32 @@ 4: unbekannte Datei -- \stopmessages +% TOM : + +\startmessages czech library: databases + title: databases + 1: -- + 2: local file -- + 3: global file -- + 4: unknown file -- +\stopmessages + +\startmessages italian library: databases + title: database + 1: -- + 2: file locale -- + 3: file globale -- + 4: file sconosciuto -- +\stopmessages + +\startmessages norwegian library: databases + title: databaser + 1: -- + 2: lokal fil -- + 3: global fil -- + 4: ukjent fil -- +\stopmessages + \unprotect %D This module is a (limited) rewrite of the original \type diff --git a/tex/context/base/core-des.tex b/tex/context/base/core-des.tex index c28867ae2..82799c7b7 100644 --- a/tex/context/base/core-des.tex +++ b/tex/context/base/core-des.tex @@ -513,7 +513,7 @@ \doifvaluesomething{\??dd#1\c!koppeling} {\processaction % genereert > of < [\getvalue{\??dd#1\c!koppelwijze}] - [ \v!lokaal=>\chardef\definitiekoppeling=1, % old: default + [ \v!lokaal=>\chardef\definitiekoppeling=1, % old: default \v!globaal=>\chardef\definitiekoppeling=2]}% new: global crosslinking \fi \stelnummerin % the number is called indirectly diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex index 954f88c12..259acb0b7 100644 --- a/tex/context/base/core-fig.tex +++ b/tex/context/base/core-fig.tex @@ -15,6 +15,10 @@ \unprotect +% tex, tmp, mov and avi will become part of the fuzzy +% graphics and also behandled by special drivers; the +% current support is hackery + % figurefilemode checken % zowieso alles checken % movie scanner @@ -41,6 +45,7 @@ 7: figuurfile -- moet opnieuw worden aangemaakt 8: figuurobject -- wordt opnieuw gebruikt 9: suffix -- bij figuur -- wordt niet afgehandeld + 10: figuur -- heeft geen afmetingen \stopmessages \startmessages english library: figures @@ -54,6 +59,7 @@ 7: you have to regenerate figure file -- 8: figureobject -- is reused 9: suffix -- by figure -- is not handled + 10: figure -- has zero dimensions \stopmessages \startmessages german library: figures @@ -67,8 +73,11 @@ 7: Sie muessen eine neue Abbildungsdatei -- erstellen 8: Abbildungobjekt -- wurde wiederverwandt 9: Dateiendung -- der Abbildung -- wird nicht unterstuetzt + 10: figure -- has zero dimensions \stopmessages +% TOBIAS: 10 + \startmessages czech library: figures title: obrazy 1: obraz -- nelze nalezt @@ -80,6 +89,23 @@ 7: musite znovu vygenerovat soubor obrazu -- 8: obrazovy objekt -- je znovu pouzit 9: pripona -- obrazu -- neni uvazovana + 10: figure -- has zero dimensions +\stopmessages + +% TOM : 10 + +\startmessages italian library: figures + title: figure + 1: la figura -- non è stata trovata + 2: la figura -- non è preimpostata + 3: dimensioni della figura -- prese da -- + 4: dimensioni di -- caricate dal file di immagini stesso + 5: dimensioni di -- caricate dal file di immagini -- + 6: dimensioni di -- calcolate TeXUtil + 7: bisogna rigenerare il file di immagini -- + 8: oggetto-figura -- riutilizzato + 9: suffisso -- per figura -- non gestito + 10: figura -- ha dimensioni nulle \stopmessages %D Due to the mere fact that \DVI|/|\PDF\ drivers differ in their @@ -203,10 +229,12 @@ \def\dododoanalyzefigurefiles#1% {\ifcase\figurestatus \def\@@efcurrentpath{#1}% -\sanitizefilename#1\to\@@efcurrentpath + \sanitizefilename#1\to\@@efcurrentpath \doiffileinsertionsupportedelse{\@@efcurrenttype} - {\edef\@@efcurrentfile% - {\@@efcurrentpath\f!pathseparator\@@effilename.\figureextension{\@@efcurrenttype}}% + {\assignfullfilename % needed + {\@@efcurrentpath}% + {\@@effilename.\figureextension{\@@efcurrenttype}}% + \to\@@efcurrentfile% \dodododoanalyzefigurefiles} {}% \fi} @@ -216,11 +244,14 @@ %D two of course only take place when the first scan fails. \def\doanalyzefigurefilesA% - {\doiffileelse{\@@efcurrentfile} - {\getfiguredimensionsA - \getfiguredimensionsB - \getfiguredimensionsC} - {}} + {\ifcase\figurestatus + \@@eftrace{locating \@@efcurrentfile\space as \@@efcurrenttype}% + \doiffileelse{\@@efcurrentfile} + {\getfiguredimensionsA + \getfiguredimensionsB + \getfiguredimensionsC} + {}% + \fi} %D It is possible to let \TEX\ determine the dimensions itself. %D The next macro shows how such a test is implemented. The @@ -232,11 +263,9 @@ %D Should be a special! \def\dogetfiguresizetex#1#2#3#4#5#6% file pagina ... - {\doifinset{\@@efextension}{\c!tex,\c!tmp} - {\doifnumberelse{\@@efextension} - {\executedfalse} - {\ExpandBothAfter\doifinset{\@@efextension}{\figuretypes} - {\executedfalse}}}% + {\doifinsetelse{\@@efextension}{\c!tex,\c!tmp} + {\ifx\@@efcurrentpath\empty\executedfalse\else\executedtrue\fi} + {\executedfalse}% \ifexecuted \global\setbox\foundexternalfigure=\vbox {\insidefloattrue @@ -253,29 +282,38 @@ #4=\!!zeropoint #5=\wd\foundexternalfigure #6=\ht\foundexternalfigure + \else + \@@eftrace{ignored}% \fi} \let\dogetfiguresizetmp\dogetfiguresizetex %D Here we start scanning the other types: +\def\@@dogetfiguresize{dogetfiguresize} + \def\getfiguredimensionsA% {\ifcase\figurestatus - \@@eftrace{analyzing \@@efcurrentfile\space as \@@efcurrenttype}% - \!!widthb=\!!zeropoint - \executeifdefined{dogetfiguresize\@@efcurrenttype}\gobblesixarguments - {\@@efcurrentfile}{\@@efpagina}% - {\!!widtha}{\!!heighta}{\!!widthb}{\!!heightb}% -% new from here - \ifdim\!!widtha=\!!zeropoint\relax\ifdim\!!heighta=\!!zeropoint\relax - \ifdim\!!widthb=\!!zeropoint\relax\ifdim\!!heightb=\!!zeropoint\relax - \executedfalse % nothing decent found + \@@eftrace{analyzing \@@efcurrentfile\space + on \@@efcurrentpath\space + as \@@efcurrenttype}% + \!!widthb=\!!zeropoint % ? + \doifdefinedelse{\@@dogetfiguresize\@@efcurrenttype} + {\executedtrue + \getvalue{\@@dogetfiguresize\@@efcurrenttype}% + {\@@efcurrentfile}{\@@efpagina}% + {\!!widtha}{\!!heighta}{\!!widthb}{\!!heightb}} + {\executedfalse}% + \ifexecuted + \ifdim\!!widtha=\!!zeropoint\relax\ifdim\!!heighta=\!!zeropoint\relax + \ifdim\!!widthb=\!!zeropoint\relax\ifdim\!!heightb=\!!zeropoint\relax + \showmessage{\m!figures}{10}{\@@efcurrentfile}% + \@@eftrace{zero}% + \fi\fi \fi\fi - \fi\fi - \ifexecuted % searching for mps, eps found, but no valid mps - \doif{\@@efcurrenttype}{\c!mps}{\ifcase\EPScreator\executedfalse\fi}% + \doif{\@@efcurrenttype}{\c!mps} + {\ifcase\EPScreator\executedfalse\fi}% \fi -% until here \ifexecuted \chardef\figurestatus=3 \doifelse{\@@efcurrenttype}{\c!eps} @@ -308,9 +346,12 @@ \def\getfiguredimensionsB% {\ifcase\figurestatus\ifcase\figurefilemode\else - \def\@@efloadname{\@@efcurrentpath\f!pathseparator\@@exfile}% + %\def\@@efloadname{\@@efcurrentpath\f!pathseparator\@@exfile}% + \assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname \edef\@@effilenametype{\@@effilename.\@@efcurrenttype}% - \@@eftrace{analyzing \@@efloadname\space on \@@effilenametype}% + \@@eftrace{analyzing \@@efloadname\space + on \@@efcurrentpath\space + for \@@effilenametype}% \pushendofline \let\presetfigure=\presetfigureA \readsetfile{\@@efcurrentpath}{\@@exfile}\relax\relax @@ -332,7 +373,8 @@ \def\getfiguredimensionsC% {\ifcase\figurestatus\ifrunutilityfile\ifcase\figurefilemode\else - \doif{\@@efcurrenttype}{\c!tex} + %\doif{\@@efcurrenttype}{\c!tex} % oeps, was wrong + \doifnotinset{\@@efextension}{\c!tex,\c!tmp} {\doiffileelse{\@@efcurrentfile} {\edef\@@effilenametype{\@@effilename.\@@efcurrenttype}% \@@eftrace{running texutil on \@@effilenametype}% @@ -342,8 +384,8 @@ \@@eftrace{analyzing \@@efloadname\space on \@@effilenametype}% \pushendofline \let\presetfigure=\presetfigureB - \readsetfile{.}{\@@efloadname}\relax\relax - \popendofline + \readsetfile{.}{\@@efloadname}\relax\relax + \popendofline \@@eftrace{\ifcase\figurestatus not \fi found}} {}}% \fi\fi\fi} @@ -359,9 +401,12 @@ \def\doanalyzefigurefilesB% {\ifcase\figurestatus\ifcase\figurefilemode\else - \def\@@efloadname{\@@efcurrentpath\f!pathseparator\@@exfile}% + %\def\@@efloadname{\@@efcurrentpath\f!pathseparator\@@exfile}% + \assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname \edef\@@effilenametype{\@@effilename.\figureextension{\@@efcurrenttype}}% - \@@eftrace{analyzing \@@efloadname\space on \@@effilenametype}% + \@@eftrace{analyzing \@@efloadname\space + on \@@efcurrentpath\space + for \@@effilenametype}% \pushendofline \let\presetfigure=\presetfigureC \readsetfile{\@@efcurrentpath}{\@@exfile}\relax\relax @@ -386,8 +431,11 @@ \def\doanalyzefigurefilesC% {\ifcase\figurestatus\ifcase\figurefilemode\else - \def\@@efloadname{\@@efcurrentpath\f!pathseparator\@@exfile}% - \@@eftrace{analyzing \@@efloadname\space on \@@effilename.* surrogate}% + %\def\@@efloadname{\@@efcurrentpath\f!pathseparator\@@exfile}% + \assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname + \@@eftrace{analyzing \@@efloadname\space + on \@@efcurrentpath\space + for \@@effilename.* surrogate}% \pushendofline \let\presetfigure=\presetfigureD \readsetfile{\@@efcurrentpath}{\@@exfile}\relax\relax @@ -435,8 +483,11 @@ \def\dodolocatepresetfigurefiles#1% {\ifcase\figurestatus \doiffileinsertionsupportedelse{\@@efcurrenttype} - {\edef\@@efcurrentfile% - {#1\f!pathseparator\@@effilename.\figureextension{\@@efcurrenttype}}% + {%\edef\@@efcurrentfile% + % {#1\f!pathseparator\@@effilename.\figureextension{\@@efcurrenttype}}% + \assignfullfilename + {#1}{\@@effilename.\figureextension{\@@efcurrenttype}}% + \to\@@efcurrentfile \@@eftrace{only searching for \@@efcurrentfile}% \doiffileelse{\@@efcurrentfile} {\chardef\figurestatus=1 @@ -454,9 +505,9 @@ \def\setnaturalfiguresize% {\doifsomething{\@@efbreedte} - {\figwid=\@@efbreedte}% + {\global\figwid=\@@efbreedte}% \doifsomething{\@@efhoogte} - {\fighei=\@@efhoogte}% + {\global\fighei=\@@efhoogte}% \doifsomething{\@@efschaal} {\figxsca=\@@efschaal \figysca=\@@efschaal}} @@ -465,25 +516,25 @@ {\doifinsetelse{\@@effactor}{\v!max,\v!passend,\v!ruim} {\doapplyfiguresize \ifdim\@@epw>\@@eph\relax - \docalculatefigurenorm\figwid\@@effactor\@@efbreedte\hsize\@@efhsize + \docalculatefigurenorm\figwid\@@effactor\@@efmaxbreedte\hsize\@@efhsize \docalculatefigurescales\figwid\@@epw\fighei\@@eph \else - \docalculatefigurenorm\fighei\@@effactor\@@efhoogte\teksthoogte\@@efvsize + \docalculatefigurenorm\fighei\@@effactor\@@efmaxhoogte\figurevsize\@@efvsize \docalculatefigurescales\fighei\@@eph\figwid\@@epw \fi \!!doneatrue} {\doifinsetelse{\@@efhfactor}{\v!max,\v!passend,\v!ruim} {\doapplyfiguresize - \docalculatefigurenorm\fighei\@@efhfactor\@@efhoogte\teksthoogte\@@efvsize + \docalculatefigurenorm\fighei\@@efhfactor\@@efmaxhoogte\figurevsize\@@efvsize \docalculatefigurescales\fighei\@@eph\figwid\@@epw \!!doneatrue} {\doifinsetelse{\@@efbfactor}{\v!max,\v!passend,\v!ruim} {\doapplyfiguresize - \docalculatefigurenorm\figwid\@@efbfactor\@@efbreedte\hsize\@@efhsize + \docalculatefigurenorm\figwid\@@efbfactor\@@efmaxbreedte\hsize\@@efhsize \docalculatefigurescales\figwid\@@epw\fighei\@@eph - \!!doneatrue} - {\docalculatefigurenorm\fighei\@@effactor\@@efhoogte\teksthoogte\@@efvsize - \docalculatefigurenorm\fighei\@@efhfactor\@@efhoogte\teksthoogte\@@efvsize + \!!doneatrue} % max ??? + {\docalculatefigurenorm\fighei\@@effactor \@@efhoogte \teksthoogte\@@efvsize + \docalculatefigurenorm\fighei\@@efhfactor\@@efhoogte \teksthoogte\@@efvsize \docalculatefigurenorm\figwid\@@efbfactor\@@efbreedte\hsize\hsize \!!doneafalse}}}% \if!!donea @@ -502,59 +553,107 @@ \doapplyfigurescale\fighei\@@eph\figysca \global\figwid=\!!zeropoint \global\fighei=\!!zeropoint - \doifelsenothing{\@@efbreedte} - {\doifsomething{\@@efhoogte} - {\ifdim\@@eph>\@@efhoogte - \global\fighei=\@@efhoogte + \doifelsenothing{\@@efmaxbreedte} + {\doifsomething{\@@efmaxhoogte} + {\ifdim\@@eph>\@@efmaxhoogte + \global\fighei=\@@efmaxhoogte \fi}} - {\ifdim\@@epw>\@@efbreedte - \global\figwid=\@@efbreedte + {\ifdim\@@epw>\@@efmaxbreedte + \global\figwid=\@@efmaxbreedte \fi}}} +\def\dosetdimensionfiguresize#1#2#3% + {#1\relax + \doifsomething{\@@efmaxbreedte} + {\ifdim\figwid>\@@efmaxbreedte\global\figwid=\@@efmaxbreedte#2\relax\fi}% + \doifsomething{\@@efmaxhoogte} + {\ifdim\fighei>\@@efmaxhoogte \global\fighei=\@@efmaxhoogte #3\relax\fi}} + \def\setdimensionfiguresize% {\ifdim\figwid>\!!zeropoint\relax \ifdim\fighei>\!!zeropoint\relax - \docalculatefigurescale\fighei\@@eph\figysca - \docalculatefigurescale\figwid\@@epw\figxsca + \dosetdimensionfiguresize% + {\docalculatefigurescale\fighei\@@eph\figysca + \docalculatefigurescale\figwid\@@epw\figxsca}% + {\docalculatefigurescale\fighei\@@eph\figysca + \docalculatefigurescale\figwid\@@epw\figxsca}% + {\docalculatefigurescale\fighei\@@eph\figysca + \docalculatefigurescale\figwid\@@epw\figxsca}% \else - \docalculatefigurescales\figwid\@@epw\fighei\@@eph + \dosetdimensionfiguresize% + {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}% + {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}% + {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}% \fi \else \ifdim\fighei>\!!zeropoint\relax - \docalculatefigurescales\fighei\@@eph\figwid\@@epw + \dosetdimensionfiguresize% + {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}% + {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}% + {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}% \else - \doapplyfigurescale\figwid\@@epw\figxsca - \doapplyfigurescale\fighei\@@eph\figysca + \dosetdimensionfiguresize% + {\doapplyfigurescale\figwid\@@epw\figxsca + \doapplyfigurescale\fighei\@@eph\figysca}% + {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}% + {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}% \fi \fi} \def\setupexternalfigures% {\dosingleempty\dosetupexternalfigures} -\def\dosetupexternalfigures[#1]% +\def\dosetupexternalfigures[#1]% needs a good clean up {\getparameters[\??ex][#1]% - \doifelsenothing{\@@explaats} + \getparameters[\??ef][#1]% dangerous for figs with backgrounds + \doifelsenothing{\@@explaats} % fig file paths {\scratchcounter=3 } - {\doifelsenothing{\@@exfile} + {\doifelsenothing{\@@exfile} % tuf file paths {\scratchcounter=3 } {\scratchcounter=0 \ExpandBothAfter\doifinset{\v!lokaal}{\@@explaats} {\advance\scratchcounter by 1 }% \ExpandBothAfter\doifinset{\v!globaal}{\@@explaats} {\advance\scratchcounter by 2 }}}% - \chardef\figurefilemode=\scratchcounter} + \chardef\figurefilemode=\scratchcounter + \ifcase\figurefilemode + \let\@@ex@@gebied\f!currentpath + \or % lokaal + \let\@@ex@@gebied\f!currentpath + \or % globaal + \let\@@ex@@gebied\@@exgebied + \or % lokaal,globaal / non empty gebied + \edef\@@ex@@gebied{\f!currentpath\ifx\@@exgebied\empty\else,\fi\@@exgebied}% + \fi + \ExpandBothAfter\doifinset{\v!default}{\@@explaats} + {\edef\@@ex@@gebied{\@@ex@@gebied,}}% default tex path search + \ifx\@@exfile\empty + \chardef\figurefilemode=0 + \fi} + +\def\resetexternalfigures% + {\setupexternalfigures + [\c!optie=,\c!maxbreedte=,\c!maxhoogte=, + \c!kader=\v!uit,\c!achtergrond=]} + +% will move: + +\appendtoks \resetexternalfigures \to \everyoverlay +\appendtoks \resetexternalfigures \to \everypagebody + +%appendtoks \resetexternalfigures \to \everysymbol \def\docalculatefigurenorm#1#2#3#4#5% {\processaction [#2] - [ \v!max=>#1=#4\relax, - \v!passend=>#1=#5\relax, - \v!ruim=>#1=#5\relax - \advance #1 by -4\@@exkorps\relax, - \s!default=>\doifsomething{#3}{#1=#3\relax}, - \s!unknown=>#1=\@@exkorps\relax - \divide#1 by \!!ten\relax - \multiply#1 by #2\relax]} + [ \v!max=>\global#1=#4\relax, + \v!passend=>\global#1=#5\relax, + \v!ruim=>\global#1=#5\relax + \global\advance #1 by -4\@@exkorps\relax, + \s!default=>\doifsomething{#3}{\global#1=#3\relax}, + \s!unknown=>\global#1=\@@exkorps\relax + \global\divide#1 by \!!ten\relax + \global\multiply#1 by #2\relax]} \def\docalculatefigurescales#1#2#3#4% {\dimen0=#1\relax % #1 = new 1-value @@ -576,37 +675,43 @@ #3=\dimen0 } % #3 = schaal \def\doapplyfigurescale#1#2#3% - {#1=#2\relax + {\global#1=#2\relax \ifcase0\@@efschaal\relax #3=\!!thousand \else #3=\@@efschaal \fi - \relax % important ! + \relax % important ! \ifnum#3=\!!thousand\else - \divide#1 by \!!thousand - \multiply#1 by #3\relax + \global\divide#1 by \!!thousand + \global\multiply#1 by #3\relax \fi} +\newdimen\figurevsize % we cannot manipulate any global vsize ! + \def\doapplyfiguresize% - {\ifinner - \teksthoogte=\vsize - \scratchdimen=\teksthoogte + {\figurevsize=\teksthoogte + \ifinner + \figurevsize =\vsize % \teksthoogte =\vsize + \scratchdimen=\vsize % \scratchdimen=\teksthoogte + \else\ifinsidefloat + \figurevsize =\vsize % \teksthoogte =\vsize + \scratchdimen=\vsize % \scratchdimen=\teksthoogte \else\ifinpagebody - \teksthoogte=\vsize - \scratchdimen=\teksthoogte + \figurevsize =\vsize % \teksthoogte =\vsize + \scratchdimen=\vsize % \scratchdimen=\teksthoogte \else \ifdim\pagegoal<\maxdimen \ifdim\pagetotal<\pagegoal \scratchdimen=\pagegoal \advance\scratchdimen by -\pagetotal \else - \scratchdimen=\teksthoogte + \scratchdimen=\figurevsize % \teksthoogte \fi \else - \scratchdimen=\teksthoogte + \scratchdimen=\figurevsize % \teksthoogte \fi - \fi\fi + \fi\fi\fi \doifelsenothing{\@@efhoogte} {\edef\@@efvsize{\the\scratchdimen}} {\let\@@efvsize=\@@efhoogte}% @@ -616,7 +721,7 @@ \def\convertfigureinsertscale#1#2#3#4% {\scratchdimen=#1\relax - \ifnum#3=\!!thousand\else % better 1000 100 10 ranges, evt round 2sp + \ifnum#3=\!!thousand\else % better 1000 100 10 ranges, evt round 2sp \divide\scratchdimen by \!!thousand \multiply\scratchdimen by #3\relax \fi @@ -628,14 +733,17 @@ \newbox\foundexternalfigure -\def\presetfiguremov% - {\let\@@eftype \c!mov - \let\@@efextension \c!mov +\def\presetundefinedfigure#1% + {\let\@@eftype #1% + \let\@@efextension #1% \let\@@efobject \v!nee \let\@@efpreset \v!nee \ifx\@@efbreedte\empty\def\@@breedte{4cm}\fi \ifx\@@efhoogte \empty\def\@@hoogte {3cm}\fi} +\def\presetfiguremov{\presetundefinedfigure\c!mov} +\def\presetfigureavi{\presetundefinedfigure\c!avi} + % The page number (frame) is passed as first option. \newcounter\forcedMPSobject % better something \every @@ -645,17 +753,27 @@ %D scales is according to the specifications. This macro is %D quite unreadable, for which I appologize. The main %D complication is that we have to catch all kind of border -%D cases, like \METAPOST\ graphics and buffers. +%D cases, like \METAPOST\ graphics and buffers. + +% note * : this is needed because reusable graphics +% combined with funny page aspect aspect ratio's can lead to +% strange side effects of preceding factor=max specs. This +% surfaced in the metafun manual, where the two side by +% side clipped cow heads [the second one was a reused object] +% where the second one inherited some characteristics from +% the factor=max one some 30 pages back. Sigh. \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]% {\mindermeldingen + \global\figwid=\!!zeropoint \figxsca=1 % see note * + \global\fighei=\!!zeropoint \figysca=1 % see note * \global\setbox\foundexternalfigure=\box\voidb@x - \beforesplitstring#3\at.\to\@@effilename - \aftersplitstring #3\at.\to\@@efextension -\doifelse{\@@effilename}{mprun} - {\edef\@@effilepref{\bufferprefix}} - {\let \@@effilepref\empty}% -\edef\@@effilename{\@@effilepref\@@effilename}% + \expandafter\beforesplitstring#3\at.\to\@@effilename + \expandafter\aftersplitstring #3\at.\to\@@efextension + \doifelse{\@@effilename}{mprun} + {\edef\@@effilepref{\bufferprefix}} + {\let \@@effilepref\empty}% + \edef\@@effilename{\@@effilepref\@@effilename}% \restorecatcodes % recently added; we presume local use \def\@@eflabel{#2}% \global\let\externalfigurelog\empty @@ -669,14 +787,18 @@ [\??ef] [\c!type=\s!unknown,\c!methode=\@@eftype,\c!symbool=\v!nee, \c!object=\@@exobject,\c!preset=\v!ja, +% old \c!achtergrond=,\c!achtergrondkleur=,\c!achtergrondraster=\@@rsraster, +% old \c!hoek=,\c!straal=.5\korpsgrootte,\c!kader=\v!uit, \c!pagina=0,\c!preview=\v!nee,\c!herhaal=\v!nee, +\c!maxbreedte=\@@exmaxbreedte,\c!maxhoogte=\@@exmaxhoogte, \c!schaal=,\c!breedte=,\c!hoogte=,\c!scherm=, - \c!factor=,\c!hfactor=,\c!bfactor=, - \c!achtergrond=,\c!achtergrondkleur=,\c!achtergrondraster=\@@rsraster, - \c!hoek=,\c!straal=.5\korpsgrootte,\c!kader=\v!uit]% + \c!factor=,\c!hfactor=,\c!bfactor=]% \doif{\@@efextension}{\c!mov}{\presetfiguremov}% + \doif{\@@efextension}{\c!avi}{\presetfigureavi}% #1[#4][#5][#6]% + \doif{\@@efreset}{\v!ja}{\resetexternalfigures}% \doif{\@@eftype}{\c!mov}{\presetfiguremov}% + \doif{\@@eftype}{\c!avi}{\presetfigureavi}% \doif{\@@eftype}{\v!buffer} {\ifx\@@efextension\empty \let\@@efextension\c!tmp @@ -688,6 +810,7 @@ \c!tmp=>\let\@@eftype\c!tex \edef\@@effilepref{\bufferprefix}% \edef\@@effilename{\@@effilepref\@@effilename}, + \c!avi=>\presetfigureavi, \c!mov=>\presetfiguremov]% \edef\figuretypes{\figuretypes,\c!tex}% \doifelse{\@@efobject}{\v!nee} @@ -698,11 +821,12 @@ \doifobjectfoundelse{FIG}{\@@efobjectname}{\donetrue}{\donefalse}} {\donefalse}} {\donefalse}}% - \doif{\@@effilename}{\jobname} + \doifparentfileelse{\@@effilename} {\@EA\removefromcommalist\@EA{\jobsuffix}\figuretypes \let\@@efextension=\empty \showmessage{\m!figures}{9}{\@@effilename,\jobsuffix}% - \donefalse}% + \donefalse} + {}% \ifdone \getobjectdimensions{FIG}{\@@efobjectname}% \geteparameters % e ! @@ -725,15 +849,15 @@ \edef\@@effullname{\@@effilename.\@@efextension}% \def\figureextension##1{\@@efextension}% \fi}% - \ifcase\figurefilemode - \let\@@ex@@gebied\f!currentpath - \or - \let\@@ex@@gebied\f!currentpath - \or - \let\@@ex@@gebied\@@exgebied - \or - \edef\@@ex@@gebied{\f!currentpath\ifx\@@exgebied\empty\else,\fi\@@exgebied}% - \fi +% \ifcase\figurefilemode +% \let\@@ex@@gebied\f!currentpath +% \or % lokaal +% \let\@@ex@@gebied\f!currentpath +% \or % globaal +% \let\@@ex@@gebied\@@exgebied +% \or % lokaal,globaal / non empty gebied +% \edef\@@ex@@gebied{\f!currentpath\ifx\@@exgebied\empty\else,\fi\@@exgebied}% +% \fi \doifelse{\@@efpreset}{\v!nee} {\doifelse{\@@eftype}{\s!unknown} {\chardef\figurestatus=0 @@ -752,13 +876,15 @@ \fi \doifelse{#2}{\s!figurepreset} {\chardef\figurestatus=4 - \def\@@efloadname{\f!currentpath\f!pathseparator\@@exfile}% + %\def\@@efloadname{\f!currentpath\f!pathseparator\@@exfile}% + \assignfullfilename\f!currentpath\@@exfile\to\@@efloadname \let\@@eftype=\@@epe} {\chardef\figurestatus=0 \analyzefigurefiles}}% \let\@@epe=\@@eftype \edef\@@efextension{\figureextension{\@@eftype}}% dirty trick - \figwid=\!!zeropoint \fighei=\!!zeropoint \figxsca=1 \figysca=1 + \global\figwid=\!!zeropoint \figxsca=1 + \global\fighei=\!!zeropoint \figysca=1 \doif{\@@exoptie}{\v!kader} {\let\@@efkader=\v!aan}% \fi @@ -773,7 +899,7 @@ \showmessage{\m!figures}{4}{\@@effullname}% \or \showmessage{\m!figures}{5}{\@@effullname,\@@efloadname}% - \or + \or % no message \doifnot{\@@efsymbool}{\v!ja} {\showmessage{\m!figures}{8}{\@@effullname}}% \fi @@ -804,29 +930,30 @@ \doif{\@@exoptie}{\v!leeg} {\skipexternalfigurestrue \let\@@efkader=\v!uit}% -\doifelsenothing{\@@efpagina} % NIEUW - {\let\@@efoptions\empty} - {\let\@@efoptions\@@efpagina}% + \doifelsenothing{\@@efpagina} % NIEUW + {\let\@@efoptions\empty} + {\let\@@efoptions\@@efpagina}% \doif{\@@efpreview}{\v!ja} {\addtocommalist\v!preview\@@efoptions}% \doif{\@@efherhaal}{\v!ja} {\addtocommalist\v!herhaal\@@efoptions}% -\doif{\@@eftype}{\c!mps} - {\ifcase\EPSspecial\else\ifinobject\else - \@@eftrace{special mps, object forced}% - \doglobal\increment\forcedMPSobject - \edef\@@efobjectname{\c!mps::\forcedMPSobject}% - \let\@@efobject\v!ja - \fi\fi}% -\global\let\lastfigureobjectname\@@efobjectname - \doifelse{\@@efobject}{\v!nee} + \doif{\@@eftype}{\c!mps} + {\ifcase\EPSspecial\else\ifinobject\else + \@@eftrace{special mps, object forced}% + \doglobal\increment\forcedMPSobject + \edef\@@efobjectname{\c!mps::\forcedMPSobject}% + \let\@@efobject\v!ja + \fi\fi}% + \global\let\lastfigureobjectname\@@efobjectname + \doifelse{\@@efobject}{\v!nee} {\donefalse} {\doifobjectssupportedelse{\donetrue}{\donefalse}}% \ifdone \doifobjectfoundelse{FIG}{\@@efobjectname} {} {\bgroup - \figwid=\@@epw\fighei=\@@eph + \figwid=\@@epw % local ? + \fighei=\@@eph % local ? \scratchdimen=\@@epx\scratchdimen=-\scratchdimen \edef\@@epx{\number\scratchdimen}% \scratchdimen=\@@epy\scratchdimen=-\scratchdimen @@ -918,7 +1045,7 @@ \gdef\noffigurepages{\nofinsertpages} \def\dogetfiguredimensions[#1][#2]% - {{\let\immediate\relax % very dirty but prevents flushing, will change + {{\let\immediate\relax % very dirty but prevents flushing, will change \setbox0=\hbox{\externalfigure[#1][#2,\c!scherm=,\c!object=\v!nee]}}} \presetlocalframed[\??ef] @@ -926,36 +1053,58 @@ \def\doplaceexternalfigure% used direct and indirect {\dosixtupleempty\dodoplaceexternalfigure} +\newconditional\externalfigurelevel + \def\dodoplaceexternalfigure[#1][#2][#3][#4][#5][#6]% {\bgroup \setupexternalfigures \calculateexternalfigure[#1][#2][#3][#4][#5][#6]% \setupexternalfigures \calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]% +\pushmacro\figurewidth +\pushmacro\figureheight \xdef\figurewidth {\the\figwid}% \xdef\figureheight{\the\fighei}% - \ifskipexternalfigures - \localframed - [\??ef] - [\c!breedte=\figwid, - \c!hoogte=\fighei, - \c!kader=\v!aan] - {\ttx name: #2 \\ file: #3 \\ skipped}% - \else\ifcase\figurestatus - \localframed - [\??ef] - [\c!breedte=\figwid, - \c!hoogte=\fighei, - \c!kader=\v!aan] - {\ttx name: #2 \\ file: #3 \\ unknown}% + \ifconditional\externalfigurelevel % probably background + \ifskipexternalfigures + % nothing + \else\ifcase\figurestatus + % nothing + \else + \box\foundexternalfigure + \fi\fi \else - \localframed - [\??ef] - [\c!breedte=\figwid, - \c!hoogte=\fighei, - \c!offset=\v!overlay] - {\vfilll\box\foundexternalfigure}% - \fi\fi + \settrue\externalfigurelevel + \ifskipexternalfigures + \localframed + [\??ef] + [\c!breedte=\figurewidth, + \c!hoogte=\figureheight, + \c!kader=\v!aan] + {\ttx name: #2 \\ file: #3 \\ skipped}% + \else\ifcase\figurestatus + \localframed + [\??ef] + [\c!breedte=\figurewidth, + \c!hoogte=\figureheight, + \c!kader=\v!aan] + {\ttx name: #2 \\ file: #3 \\ unknown}% + \else +\doifelse{\@@efreset}{\v!ja} + {\ht\foundexternalfigure=\figureheight + \dp\foundexternalfigure=\!!zeropoint + \wd\foundexternalfigure=\figurewidth + \box\foundexternalfigure} + {\localframed + [\??ef] + [\c!breedte=\figurewidth, + \c!hoogte=\figureheight, + \c!offset=\v!overlay] + {\vfilll\box\foundexternalfigure}}% + \fi\fi + \fi +\popmacro\figureheight +\popmacro\figurewidth \egroup} \def\getexternalfigure#1% @@ -996,7 +1145,9 @@ \def\dosetuseexternalfigure[#1][#2][#3][#4]% {\doifinstringelse{=}{#3} {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\dopresetfigure][#1][#2][#3][#4]}} - {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\doprecopfigure][#1][#2][#3][#4]}}% + {\doifelsenothing{#3} % catch [1][2][leeg][leeg] + {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\dopresetfigure][#1][#2][#3][#4]}} + {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\doprecopfigure][#1][#2][#3][#4]}}}% \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}} % upward compatible \def\useexternalfigure% @@ -1137,6 +1288,9 @@ \def\showexternalfigures% {\dosingleempty\doshowexternalfigures} +\def\overlayfigure#1% + {\externalfigure[#1][\c!breedte=\overlaywidth,\c!hoogte=\overlayheight]} + %D Still undocumented! \newcount\efreference @@ -1451,21 +1605,21 @@ \def\setupclipping% {\dodoubleargument\getparameters[\??cp]} -%D defining sound tracks: +%D defining sound tracks: %D -%D \starttypen +%D \starttypen %D \useexternalsoundtrack[label][file] -%D \stoptypen +%D \stoptypen %D %D associated actions: StartSound StopSound PauseSound ResumeSound %D -%D Todo: like external figures, also search on path, +%D Todo: like external figures, also search on path, %D although, they need to be present ar viewing time, so ... \def\useexternalsoundtrack% {\dodoubleargument\douseexternalsoundtrack} -\def\douseexternalsoundtrack[#1][#2]% +\def\douseexternalsoundtrack[#1][#2]% {\setgvalue{\??sd#1}{#2}} \def\checksoundtrack#1% @@ -1486,12 +1640,16 @@ \setupexternalfigures [\c!optie=, \c!object=\v!ja, + \c!reset=\v!nee, + \c!maxbreedte=\@@efbreedte, + \c!maxhoogte=\@@efhoogte, \c!korps=\korpsgrootte, \c!gebied=, \c!file=\f!utilityfilename.\f!figureextension, \c!straal=.5\korpsgrootte, \c!hoek=\v!recht, \c!kader=\v!uit, + \c!achtergrond=, % new \c!plaats={\v!lokaal,\v!globaal}] \setupexternalfigures diff --git a/tex/context/base/core-fil.tex b/tex/context/base/core-fil.tex index c67aa1702..50a05693a 100644 --- a/tex/context/base/core-fil.tex +++ b/tex/context/base/core-fil.tex @@ -39,6 +39,16 @@ 1: synonymum souboru -- je jiz pouzito pro -- \stopmessages +\startmessages italian library: files + title: file + 1: sinonimo file -- già in uso per -- +\stopmessages + +\startmessages norwegian library: files + title: filer + 1: filesynonym -- er allerede brukt for -- +\stopmessages + %D \macros %D {definefilesynonym} %D @@ -184,10 +194,10 @@ %D We also redefine: \def\MPgraphicfile% - {\bufferprefix mp\ifMPrun run\else graph\fi} + {\bufferprefix mp\ifMPrun run\else graph\fi} \def\convertMPcolorfile% - {\bufferprefix metacmyk.tmp} + {\bufferprefix metacmyk.tmp} %D Temporarily here: diff --git a/tex/context/base/core-fld.tex b/tex/context/base/core-fld.tex index 33b77f9ad..d7957fc85 100644 --- a/tex/context/base/core-fld.tex +++ b/tex/context/base/core-fld.tex @@ -843,15 +843,16 @@ {\doifundefined{fieldstack:#1} {\setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}}} -\def\dodofieldstack[#1][#2][#3]% +\def\dodofieldstack[#1][#2][#3]% start=n, 0 == leeg {\bgroup + \getparameters[\??fd][\c!start=1,#3]% \setupfields[\v!reset]% \definesymbol[\v!leeg][]% - \useJSscripts[fld]% + \useJSscripts[fld][FieldStack]% \newcounter\stackedfieldnumber \def\dododofieldstack##1% {\increment\stackedfieldnumber - \ifnum\stackedfieldnumber=1 + \ifnum\stackedfieldnumber=\@@fdstart\relax \definefield[#1:\stackedfieldnumber][check][#1][##1,\v!leeg][##1]% \else \definefield[#1:\stackedfieldnumber][check][#1][##1,\v!leeg][\v!leeg]% @@ -880,6 +881,20 @@ \def\fieldstack% {\dotripleempty\dofieldstack} +%D When submitting a form, we need to tell the driver module +%D that we want \FDF\ or \HTML. + +\def\setupforms% + {\dodoubleargument\getparameters[\??fr]} + +\def\checksubmitform#1% + {\setsubmitoutputformat{\@@frmethode}} + +\setexecutecommandcheck {submitform} \checksubmitform + +\setupforms + [\c!methode=HTML] + \protect \endinput diff --git a/tex/context/base/core-fnt.tex b/tex/context/base/core-fnt.tex index a7ce7f68f..9928d64ee 100644 --- a/tex/context/base/core-fnt.tex +++ b/tex/context/base/core-fnt.tex @@ -72,8 +72,8 @@ %D \type {\groupedcommand}. \def\usepseudocaps% - {\def\cap@@uppercase{\the\everyuppercase\uppercase}% - \def\cap@@lowercase{\the\everylowercase\lowercase}% + {\def\cap@@uppercase{\the\everyuppercase\uppercased}% + \def\cap@@lowercase{\the\everylowercase\lowercased}% \def\cap@@visualize{\tx}} \def\userealcaps% @@ -145,13 +145,16 @@ {\definealternativestyle[\v!kapitaal][\normalkap][\normalkap]% \definealternativestyle[\v!smallcaps][\sc][\sc]% \let\kap\normalkap} - {\definealternativestyle[\v!kapitaal][\normalkap][\uppercase]% - \definealternativestyle[\v!smallcaps][\sc][\uppercase]% + {\definealternativestyle[\v!kapitaal][\normalkap][\uppercased]% + \definealternativestyle[\v!smallcaps][\sc][\uppercased]% \def\kap{\doconvertfont{\v!kapitaal}}}% \doifelse{\@@kksc}{\v!ja} {\userealcaps} {\usepseudocaps}} +\ifx\uppercased\undefined \let\uppercased\uppercase \fi +\ifx\lowercased\undefined \let\lowercased\lowercase \fi + \setupcapitals [\c!titel=\v!ja, \c!sc=\v!nee] @@ -201,8 +204,10 @@ \def\processwords#1% {\doprocesswords#1 \od\unskip} +\let\processword\relax + \unexpanded\def\Words% - {\let\processwords=\Word + {\let\processword=\Word \processwords} \unexpanded\def\WORD#1% @@ -277,22 +282,71 @@ %D %D The default skip can be set with: +% \def\stretchedspacefactor{4} +% \def\stretchedspaceamount{.25em} +% +% \unexpanded\def\stretcheduppercase#1% +% {\bgroup +% \the\everyuppercase +% \uppercase{\def\textstring{#1}}% +% \ifdim\stretchedspaceamount>\!!zeropoint +% \def\textkern% +% {\kern\stretchedspaceamount}% +% \def\textskip% +% {\scratchdimen=\stretchedspaceamount +% \hskip\stretchedspacefactor\scratchdimen}% +% \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA +% \textskip\@EA{\textstring}% +% \else +% \textstring +% \fi +% \egroup} + +\def\stretchedspacefactor{4} \def\stretchedspaceamount{.25em} +\def\stretchedbreaktokens{.@/} -\unexpanded\def\stretcheduppercase#1% +\unexpanded\def\stretcheduppercase#1% {\bgroup \the\everyuppercase \uppercase{\def\textstring{#1}}% \ifdim\stretchedspaceamount>\!!zeropoint - \def\textkern{\kern \stretchedspaceamount}% - \def\textskip{\hskip\stretchedspaceamount}% - \@EA\processtokens\@EA\relax\@EA\textskip\@EA\relax\@EA - {\@EA\textkern\@EA\textkern\@EA}\@EA{\textstring}% + \def\textkern##1% + {\determinemidwordbreak{##1}{\stretchedbreaktokens}% + \kern\stretchedspaceamount##1\domidwordbreak}% + \def\textskip% + {\scratchdimen=\stretchedspaceamount + \hskip\stretchedspacefactor\scratchdimen}% + \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA + \textskip\@EA{\textstring}% \else \textstring \fi \egroup} +%D An auxiliary macro, see for usage \type {\stretcheduppercase}. + +\let\domidwordbreak\relax + +\def\setmidwordbreaktoken#1% + {\sfcode`#1=5000\relax} + +\def\determinemidwordbreak#1#2% + {\edef\midwordbreaktokens{#2}% + \ifx\midwordbreaktokens\empty + \global\let\domidwordbreak\relax + \else + \setbox\scratchbox=\hbox + {\expandafter\handletokens\midwordbreaktokens\with\setmidwordbreaktoken + a\space \!!dimena=\the\lastskip + #1\space\!!dimenb=\the\lastskip \relax % needed + \ifdim\!!dimena=\!!dimenb + \global\let\domidwordbreak\relax + \else + \global\let\domidwordbreak\allowbreak + \fi}% + \fi} + %D \macros %D {underbar,underbars, %D overbar,overbars, @@ -377,10 +431,10 @@ \unexpanded\def\dodounderbar#1% {\bgroup - \dimen0=1.5\normallineskip + \dimen0=\@@ononderoffset \dimen0=\underbarlevel\dimen0 \ifdone \else - \advance\dimen0 by -\normallineskip + %\advance\dimen0 by -1pt \advance\dimen0 by -\ht\strutbox \fi \dimen2=\dimen0 @@ -431,7 +485,7 @@ \def\dooverstrike#1% {\bgroup - \dimen0=2.5\normallineskip + \dimen0=\@@onbovenoffset \dimen2=\dimen0 \advance\dimen2 by \@@onlijndikte \dododounderbar{\dimen2}{-\dimen0}{#1}% @@ -492,7 +546,8 @@ \fi} \def\dohighlow#1#2#3#4#5% - {\bgroup + {\dontleavehmode + \bgroup \scratchdimen= \ifdim\fontdimen5\textfont2=1ex\fontdimen#2\textfont2\else#3ex\fi \advance\scratchdimen by #4ex @@ -507,7 +562,8 @@ \unexpanded\def\low {\dohighlow\lower{16}{.48}{0}} \unexpanded\def\lohi#1#2% - {\hbox + {\dontleavehmode + \hbox {\setbox4=\hbox{\dohighlow\lower{16}{.48}{.1}{#1}}% \setbox6=\hbox{\dohighlow\raise{14}{.86}{.1}{#2}}% \ifdim\wd4<\wd6 @@ -516,11 +572,48 @@ \wd6=\!!zeropoint\box6\box4 \fi}} +%D \macros +%D {setupinitial,placeinitial,checkinitial} +%D +%D {\em To be documented.} +%D +%D \starttypen +%D \setupinitial[state=start] \placeinitial \input tufte +%D \stoptypen +%D +%D and +%D +%D \starttypen +%D \def\bpar{\ifvmode\checkinitial\fi} +%D \def\epar{\ifhmode\par\fi\checkinitial} +%D \stoptypen + +% to do: more fine tuning + +\def\setupinitial% + {\dodoubleempty\getparameters[\??dc]} + +\definefontsynonym[Initial][Regular] % prefered initial identifier +\definefontsynonym[initial][Initial] % internal but accepted too + +\setupinitial + [\c!status=\v!stop, + \c!n=3, + \s!font=initial] + +\def\placeinitial% + {\doif{\@@dcstatus}{\v!start} + {\ifnum\@@dcn>0 \AutoDroppedCaps \fi}} + +\let\checkinitial\CheckDroppedCaps + %D This module has only a few setups: \setupunderbar [\c!variant=a, - \c!lijndikte=\linewidth] + \c!lijndikte=\linewidth, + \c!onderoffset=1.5pt, + \c!bovenoffset=2.5pt] \protect diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex index f5518afec..2fe0b971a 100644 --- a/tex/context/base/core-grd.tex +++ b/tex/context/base/core-grd.tex @@ -209,7 +209,6 @@ %D %D \macros %D {getnoflines} -%D {} %D %D Het commando \type{\getnoflines} converteert een hoogte %D (dimensie) in een aantal regels en kent dit toe aan @@ -310,7 +309,7 @@ \forcepresnaptrue \fi \ifforcepresnap - \vbox{\strut}\nobreak\vskip-\openlineheight + \vbox{\hsize\!!zeropoint\strut}\nobreak\vskip-\openlineheight \fi % \ifdim\ht\nextbox>\ht\strutbox @@ -444,26 +443,27 @@ \fi} \def\setgridbox#1#2#3% - {\setbox#1=\ruledvbox to #3 + {\setbox#1=\ruledvbox to #3 % given size {\forgetall \offinterlineskip \hsize=#2 - \getnoflines{#3}% - \vskip\topskip - \vskip-\ht\strutbox - \scratchdimen=#2\advance\scratchdimen by \lineheight - \dorecurse - {\noflines} - {\strut - \hskip-.5\lineheight - \rlap - {\hskip\scratchdimen\hskip2pt\infofont - \hbox to 1em{\hss\recurselevel}}% - \vrule - \!!height .5\testrulewidth - \!!depth .5\testrulewidth - \!!width \scratchdimen - \par} + \ruledvbox % calculated size + {\getnoflines{#3}% + \vskip\topskip + \vskip-\ht\strutbox + \scratchdimen=#2\advance\scratchdimen by \lineheight + \dorecurse + {\noflines} + {\strut + \hskip-.5\lineheight + \rlap + {\hskip\scratchdimen\hskip2pt\infofont + \hbox to 1em{\hss\recurselevel}}% + \vrule + \!!height .5\testrulewidth + \!!depth .5\testrulewidth + \!!width \scratchdimen + \par}} \vfill}} %D Some intervention macros: diff --git a/tex/context/base/core-int.tex b/tex/context/base/core-int.tex index e99c6af56..7ae8ab6d5 100644 --- a/tex/context/base/core-int.tex +++ b/tex/context/base/core-int.tex @@ -47,6 +47,22 @@ 4: zadna strankova synchronizace (--) v hmode \stopmessages +\startmessages italian library: interactions + title: interazione + 1: rapporto -- x -- (b x a) + 2: attiva + 3: inattiva + 4: sincronizzazione di pagina (--) non disponibile in hmode +\stopmessages + +\startmessages norwegian library: interactions + title: interaksjon + 1: forholdstall -- x -- (b x h) + 2: aktiv + 3: inaktiv + 4: ingen sidesynkronisering (--) i hmode +\stopmessages + \startmessages dutch library: versions title: versie 1: er mankeert een @+ @@ -75,6 +91,20 @@ 3: oznacene strany: -- \stopmessages +\startmessages italian library: versions + title: version + 1: @+ mancante + 2: marcatura pagine + 3: pagine selezionate: -- +\stopmessages + +\startmessages norwegian library: versions + title: versjon + 1: manglende @+ + 2: markerer sider + 3: valgte sider: -- +\stopmessages + \unprotect \definesystemconstant {link} @@ -271,20 +301,44 @@ \def\initializeidentity% The macro is not to be changed; {\iflocation % only the \@@ia-variables may be set! - \dosetupidentity % Although ConTeXt is the producer - {\@@iatitel} % we no longer set this field, since + \dosetupidentity % ConTeXt is the producer but we + {\@@iatitel} % no longer mention the pragma site, since {\@@iasubtitel} % we don't want to be bothered with {\@@iaauteur} % remarks about third party documents - {\jobname.tex} % and/or associated with documents + {ConTeXt/user/\jobname.tex} % and/or associated with documents {\@@iadatum}% % produced outside our control. \global\let\initializeidentity\relax \fi} \appendtoks \initializeidentity \to \everyshipout +% \def\initializepaper% +% {\bgroup +% \doif\@@pcstatus\v!start\locationfalse +% \iflocation % without screen settings +% \egroup +% \dosetuppaper +% {\papierformaat} +% {\the\papierbreedte} +% {\the\papierhoogte}% +% \else +% \egroup +% \dosetuppaper +% {\printpapierformaat} +% {\the\printpapierbreedte} +% {\the\printpapierhoogte}% +% \fi} + \def\initializepaper% {\bgroup - \doif\@@pcstatus\v!start\locationfalse + %\doif\@@pcstatus\v!start\locationfalse + %\doifsomething + % {\@@pplinks\@@pprechts\@@ppboven\@@pponder}\locationfalse + \ifx\@@pplinks \empty \else\locationfalse\fi + \ifx\@@pprechts\empty \else\locationfalse\fi + \ifx\@@ppboven \empty \else\locationfalse\fi + \ifx\@@pponder \empty \else\locationfalse\fi + \ifx\@@pcstatus\v!start \locationfalse\fi \iflocation % without screen settings \egroup \dosetuppaper @@ -299,6 +353,8 @@ {\the\printpapierhoogte}% \fi} +\appendtoks \initializepaper \to \everyshipout + \def\doinitializepaper% {\bgroup \berekeninteractiescherm @@ -314,6 +370,8 @@ {\the\papierhoogte}% \egroup} +\let\@@pcscreendata\empty + \def\dosetupinteractionscreens% met a, b en \number {\doifnot{\@@pcstatus}{\v!start} {\bgroup @@ -324,8 +382,16 @@ \v!bookmark=>\!!counte=2, \s!unknown=>\!!counte=0, \s!default=>\!!counte=0]% - \showmessage{\m!interactions}{1} % niet waterdicht - {\@EA\withoutpt\the\!!widtha,\@EA\withoutpt\the\!!heighta}% + \edef\temp% + {{\number\rugoffset}{\number\kopoffset}% + {\number\!!widtha}{\number\!!heighta}% + {\the\!!counte}}% + \doifnot{\the\!!widtha\the\!!heighta}{\@@pcscreendata} + {\xdef\@@pcscreendata{\the\!!widtha\the\!!heighta}% + \showmessage{\m!interactions}{1} % niet waterdicht + {\@EA\withoutpt\the\!!widtha,\@EA\withoutpt\the\!!heighta}}% + % need to be split: dimensions for each page + % and mode per document and only once ! \dosetupscreen {\number\rugoffset}{\number\kopoffset} {\number\!!widtha}{\number\!!heighta} @@ -339,6 +405,8 @@ \let\setupinteractionscreens\dosetupinteractionscreens \fi} +\appendtoks \setupinteractionscreens \to \everyshipout + \def\stelinteractieschermin% {\dosingleempty\dostelinteractieschermin} @@ -610,7 +678,7 @@ \c!achtergrond=\locationboxbackground, #2] {\dolocationattributes{#1}\c!letter\c!kleur{#3}}}% - \hbox{#4{\box\locationbox}}}%{\copy\locationbox}}} + \hbox{#4{\box\locationbox}}} \def\setlocationboxyes#1[#2]#3[#4]% {\ifx\currentouterreference\empty @@ -657,21 +725,11 @@ \global\skippedmenuitemtrue \fi} -%\def\setlocationbox#1[#2]#3[#4]% -% {\doifinstringelse{#4}{\getvalue{#1\c!blokkade}} -% {\setlocationboxnop{#1}[#2]{#3}[#4]} -% {\doifreferencefoundelse{#4} -% {\setlocationboxyes{#1}[#2]{#3}[#4]} -% {\setlocationboxnop{#1}[#2]{#3}[#4]% -% \unknownreference{#4}}}} - \def\setlocationbox#1[#2]#3[#4]% {\doifreferencepermittedelse{#4}{\getvalue{#1\c!blokkade}} {\setlocationboxyes{#1}[#2]{#3}[#4]} {\setlocationboxnop{#1}[#2]{#3}[#4]}} -%\dolocationattributes{#1}\c!letter\c!kleur{#3}}}% - \def\dodosetlocationcommanditem#1#2#3[#4]#5\\% {\bgroup \leavevmode @@ -712,6 +770,8 @@ \unskip \getvalue{\??am#1#5}} +\newcounter\currentamposition + \def\setamboxcommands#1#2% {\def\@@amboxcommand##1\\% {\bgroup @@ -721,26 +781,31 @@ \fi \egroup \ignorespaces}% + \doglobal\newcounter\currentamposition %%% experiment \def\raw[##1]##2\\% {\@@amboxcommand\naarbox{\ignorespaces##2\unskip}[##1]\\}% \def\but[##1]##2\\% - {\@@amboxcommand\setlocationbox{\??am#1}[]{\ignorespaces##2\unskip}[##1]\\}% + {\@@amboxcommand\do@@amposition{#1}{##1}{\setlocationbox{\??am#1}[]{\ignorespaces##2\unskip}[##1]}\\}% \def\got[##1]##2\\% pas op! offset {\@@amboxcommand\setlocationbox{\??am#1}[\c!kader=\v!uit,\c!achtergrond=]{\ignorespaces##2\unskip}[##1]\\}% \def\nop##1\\% {\@@amboxcommand\phantom{\localframed[\??am#1][]{}}\\}% \def\txt##1\\% {\@@amboxcommand\localframed[\??am#1][\c!kader=\v!uit,\c!achtergrond=]{\ignorespaces##1\unskip}\\}% - \def\rul##1\\% + \def\rul##1\\% ook \do@@amposition ! {\@@amboxcommand\localframed[\??am#1][]{\ignorespaces##1\unskip}\\}% \def\com##1\\% {\ignorespaces##1\unskip\ignorespaces}} +\ifx\do@@amposition\undefined + \let\do@@amposition\gobbletwoarguments % hook for positional thingies +\fi + \def\@@amhbox#1#2#3#4% {\testinteractiemenu{#3}% \iflocationmenupermitted \bgroup -\showcomposition + \showcomposition \def\dolocationcommand##1% {\dosetlocationcommanditem{#3}{##1}}% \dimen0=\zetbreedte @@ -751,6 +816,7 @@ \setbox0=\hbox to \dimen0 {\forgetall \executeamboxcommands{#3}{#4}\c!links\c!midden\c!rechts}% + \setbox0=\hbox{\do@@ammenuposition{#3}{\box0}}% \wd0=\zetbreedte % geen \ht=#2 setting (yet) \hskip-\pagebackgroundhoffset @@ -765,7 +831,7 @@ {\testinteractiemenu{#3}% \iflocationmenupermitted \bgroup -\showcomposition + \showcomposition \dimen0=\teksthoogte \advance\dimen0 by \pagebackgroundvoffset \advance\dimen0 by \pagebackgroundvoffset @@ -777,6 +843,7 @@ \stelblankoin[\v!standaard]% % (tijdelijk) is aangepast. \hsize#2\relax \executeamboxcommands{#3}{#4}\c!voor\c!tussen\c!na}% + \setbox0=\vbox{\hbox{\do@@ammenuposition{#3}{\box0}}}% \setbox0=\vbox {\vskip-\pagebackgroundvoffset \vskip\getvalue{\??am#3\c!bovenoffset}% @@ -791,6 +858,10 @@ #1\relax \fi} +\ifx\do@@ammenuposition\undefined + \let\do@@ammenuposition\gobbleoneargument % hook for positional thingies +\fi + \setvalue{\??am\s!do\v!rechts}% {\@@amvbox{\dodummypageskip\v!rechts}\rechterrandbreedte} @@ -876,9 +947,13 @@ \def\dodefinieerinteractiemenu[#1][#2][#3]% {\ConvertToConstant\doifelse{#3}{} {\setvalue{\??am\c!menu#1}% - {\extendedmenufalse\dointeractiemenu{#1}{#2}}} + {\extendedmenufalse\dointeractiemenu{#1}{#2}}% + \setvalue{\@@dodolijstelement#1}% + {\def\dosomelijstelement{\dodomenulijstelement{#1}}}} % of #2 ? {\setvalue{\??am\c!menu#1}% {\extendedmenufalse\dointeractiemenu{#1}{}}% + \setvalue{\@@dodolijstelement#1}% + {\def\dosomelijstelement{\dodomenulijstelement{#1}}}% \presetlocalframed[\??am#1]% \letvalue{\??am#1\c!blokkade}\empty \edef\!!stringe{\getvalue{\??am#2}}% @@ -905,6 +980,23 @@ \def\definieerinteractiemenu% {\dotripleempty\dodefinieerinteractiemenu} +\def\dodomenulijstelement#1#2#3#4#5#6#7% + {\setbox0=\hbox + {\let\gotolocation\gobbleoneargument % hack to catch last [] + \docheckrealreferencepage{#7}% + \setlocationboxyes + {\??am#1}% % needed ! + []% no settings + {\doifelsenothing{\??li#2\c!maxbreedte} + {#5} + {\limitatetext + {#5} + {\getvalue{\??li#2\c!maxbreedte}} + {\unknown}}}% % needed ! + []}% normally the destination, catch by gobble + \@@amboxcommand\do@@amposition{#1}{#7}% beware, we pass the pagenumber + {\ignorespaces\linklisttoelement{#2}{#3}{#6}{#7}{\box0}\unskip}\\} + \processbetween{\e!interactiemenu}\dostartinteractiemenu \def\dostartinteractiemenu#1% @@ -1546,8 +1638,11 @@ \def\stopprofiel% {\processprofile1[#1]% \egroup}% - \DoAfterFi\processprofile0[#1]% - \fi} + \def\next{\processprofile0[#1]}% % \DoAfterFi \processprofile0[#1]% + \else % ^^^^^^^^^^ will be obsolete + \let\next\relax % since ugly and never used + \fi + \next} \let\stopprofiel=\relax @@ -1962,22 +2057,26 @@ % text, the symbols scale down. % \stopcommentaar +% jammer, tussen/midden had erin gemoeten; \c!commando toevoegen + +\def\registermenucommand#1% + {\noindent#1\space} + \def\doregistermenubuttons[#1][#2]% [menu id] [register] {\bgroup \ifsecondargument \stelinteractiemenuin [#1][\c!onbekendeverwijzing=\v!ja,\c!zelfdepagina=\v!ja]% \def\docommando##1% - {\noindent - \menubutton[#1]{##1}[#2:##1]% - \space}% + {\registermenucommand{\menubutton[#1]{##1}[#2:##1]}}% \else \def\docommando##1% - {\noindent - \button[\c!onbekendeverwijzing=\v!ja,\c!zelfdepagina=\v!ja]{##1}[#1:##1]% - \space}% + {\registermenucommand + {\button + [\c!onbekendeverwijzing=\v!ja,\c!zelfdepagina=\v!ja] + {##1}[#1:##1]}}% \fi - \handletokens abcdefghijklmnopqrstuvwxyz\with\docommando + \handletokens abcdefghijklmnopqrstuvwxyz\with\docommando % moet anders \egroup} \def\registermenubuttons% @@ -2040,6 +2139,7 @@ \stelinteractiemenuin [\v!links,\v!rechts,\v!boven,\v!onder] [\c!offset=.25em, + \c!positie=\v!nee, \c!kader=\v!aan, \c!achtergrond=, \c!achtergrondkleur=, diff --git a/tex/context/base/core-itm.tex b/tex/context/base/core-itm.tex index 702c5fe5d..d62127e42 100644 --- a/tex/context/base/core-itm.tex +++ b/tex/context/base/core-itm.tex @@ -29,6 +29,14 @@ 9: aktualne ne vice nez -- urovne/urovni vyctu \stopmessages +\startmessages italian library: layouts + 9: attualmente non più di -- livelli di elencazione +\stopmessages + +\startmessages norwegian library: layouts + 9: for øyeblikket maksimalt -- nivåer i opplisting +\stopmessages + \unprotect % - meerdere niveaus (moet niet moeilijk zijn) @@ -111,6 +119,8 @@ {\getparameters[\??op\itemlevel][#2]}% {\getparameters[\??op#1][#2]}} +\newconditional\inlinelistitem \setfalse\inlinelistitem + \def\dododostelopsomminginconstant[#1][#2#3#4]% * permits [2] {\processaction [#2#3#4] @@ -125,6 +135,7 @@ \v!inmarge*=>{\doassign[\??op#1][\c!breedte=-2em]}, % signal \v!opmarge*=>\doifnot{#1}{1}{\doassign[\??op#1][\c!breedte=0em]}, % signal \v!kolommen*=>\packitems, +\v!intekst*=>\settrue\inlinelistitem, % new \v!los*=>\optimizeitemsfalse, \v!alinea*=>{\paragraphitemstrue \packitems}, @@ -213,7 +224,9 @@ \setgvalue{\??op\c!symbool\s!local\itemlevel}% {\convertnumber{#1}{\countervalue{\s!itemcount\itemlevel}}}% \def\listitem% - {\getvalue{\??op\c!symbool\s!local\itemlevel}\tempsymbool}% + {\getvalue{\??op\itemlevel\c!links}% new + \getvalue{\??op\c!symbool\s!local\itemlevel}\tempsymbool + \getvalue{\??op\itemlevel\c!rechts}}% new \let\docommando\gobbleoneargument} {\let\listitem\empty}}} @@ -230,9 +243,25 @@ \multiply#2 by \getvalue{\??op#1\c!factor}\relax \advance#2 by \getvalue{\??op#1\c!breedte}\relax} +% The next conditionals deal with \item \startitemize. It +% looks like a hack to skip back, but that way we preserve +% the indentation and bullet placement. It's a rather +% untested feature. + +\newconditional\concatnextitem \setfalse\concatnextitem +\newconditional\autoconcatnextitem \settrue \autoconcatnextitem +\newsignal \itemsignal + \def\dodostartopsomming[#1][#2]% - {\ifhmode - \par + {\setfalse\inlinelistitem % new, no indent (leftskip) + \setfalse\concatnextitem % new, concat + \ifhmode + \ifconditional\autoconcatnextitem % new, concat + \ifdim\lastskip=\itemsignal % new, concat + \settrue\concatnextitem % new, concat + \fi % new, concat + \fi % new, concat + \par \fi \ifnum\itemlevel=\maxitemlevel\relax \showmessage{\m!layouts}{9}{\maxitemlevel}% @@ -351,7 +380,9 @@ \fi\fi \calculatelistwidth{\itemlevel}{\dimen0}% \ifdim\dimen0>\!!zeropoint\relax +\ifconditional\inlinelistitem\else \advance\leftskip by \dimen0\relax +\fi \fi} \def\dostartopsomming[#1][#2]% @@ -445,11 +476,15 @@ \else \calculatelistwidth{\itemlevel}{\dimen0}% \fi +\ifconditional\inlinelistitem + \hbox to \dimen0{\ifsubsom\llap{+}\fi\box8\hfill}% +\else \llap{\hbox to \dimen0{\ifsubsom\llap{+}\fi\box8\hfill}}% +\fi \fi \setevalue{\??op\c!symbool\itemlevel}% - %{\getvalue{\??op\c!symbool\s!local\itemlevel}}% problems with \uchar - {\noexpand\getvalue{\??op\c!symbool\s!local\itemlevel}}% + {\getvalue{\??op\c!symbool\s!local\itemlevel}}% still problems with \uchar ? + %{\noexpand\getvalue{\??op\c!symbool\s!local\itemlevel}}% no, spoils subrefs \kopsomfalse \subsomfalse \symsomfalse @@ -459,6 +494,9 @@ \def\complexdosom[#1]% {\par \ignorespaces + \ifconditional\concatnextitem % new, concat + \dosomebreak\nobreak % new, concat + \fi % new, concat \doadvanceitem \ifnum\itemcolumndepth=0\relax\ifnum\noflistelements>0\relax \dosomebreak\nobreak @@ -483,6 +521,11 @@ \else \itemuse\c!tussen \fi + \ifconditional\concatnextitem % new, concat + \vskip-\lastskip % new, concat + \vskip-\lineheight % new, concat + \nobreak % new, concat + \fi % new, concat \ignorespaces \dolistitem \ifpackeditems @@ -498,6 +541,8 @@ \rawreference{\s!lst}{#1}{\itemreference}% \egroup}}% \strut % added 11-08-99 + \setfalse\concatnextitem % new, concat + \hskip\itemsignal % new, concat \ignorespaces} \def\complexsom[#1]#2\par% todo: no two pass data diff --git a/tex/context/base/core-lst.tex b/tex/context/base/core-lst.tex index a9e4d4142..75d8e8649 100644 --- a/tex/context/base/core-lst.tex +++ b/tex/context/base/core-lst.tex @@ -56,6 +56,12 @@ % \schrijfwegnaarlijst % \endgroup}} +% Auto cross document links work by either using logical or +% page references, depending on the general settings. The +% locations are stored in global references where the auto tag +% number uses the text container. We use reference mapping +% (define reference) to keep track of the current ref. + \def\doschrijfnaarlijst#1#2#3#4% {\doifvalue{\??li#1\c!status}{\v!start} {\begingroup @@ -66,24 +72,26 @@ {\def\dopaginanummer{0}}% % niet waterdicht, wat te doen met figuren en zo % first hack: scheelt rommel, second hack: alleen koppen - \ExpandBothAfter\rawdoifinsetelse{#1}{\crossdocumentelements} + \doifelsevalue{\??rf#1\c!status}{\v!start} {\doif{\@@sectionlevel\@@sectie}{0}{\autocrossdocumentfalse}} {\autocrossdocumentfalse}% - % blijft nog wat zwakjes + % blijft nog wat zwakjes en inefficient \ifautocrossdocument \bgroup - \thisisdestination{#1::\sectionformat}% + \thisisnextinternal{#1}% + %\thisisdestination{#1::\sectionformat}% \@EA\setsectieenkoppeling\@EA{#1}% \edef\currentlevel{\@@sectionlevel\@@sectie}% - \def\docommando##1% - {\def\dodocommando####1% - {\setsectieenkoppeling{####1}% - \def\level{\@@sectionlevel\@@sectie}% - \ifnum\level>\currentlevel - \expanded{\definereference[##1::####1][\v!geen]}% - \else\ifnum\level=\currentlevel - \expanded{\definereference[##1::####1][##1::{####1::\sectionformat}]}% - \fi\fi}% + \def\docommando##1% + {\def\dodocommando####1% + {\doifvalue{\??rf####1\c!status}{\v!start} + {\setsectieenkoppeling{####1}% + \def\level{\@@sectionlevel\@@sectie}% + \ifnum\level>\currentlevel + \expanded{\definereference[##1::####1][\v!geen]}% + \else\ifnum\level=\currentlevel + \expanded{\definereference[##1::####1][##1::{####1::\sectionformat}]}% + \fi\fi}}% \processcommacommand[\crossdocumentelements]\dodocommando}% \processcommacommand[\crossdocumentreferences]\docommando \egroup @@ -301,26 +309,28 @@ \strut\splitlistsymbol\getvalue{\??li#1\c!scheider}% \doifvalue{\??li#1\c!label}{\v!ja}{\rightlabeltext{#1}}}]} +\def\@@dodolijstelement{dodolijstelement} + \def\dosomelijstelement#1#2#3{#1 #2 \translatednumber[#3]} -\def\dodolijstelementa{\let\dosomelijstelement\dodofixdlijstelementABC} -\def\dodolijstelementb{\let\dosomelijstelement\dodofixdlijstelementABC} -\def\dodolijstelementc{\let\dosomelijstelement\dodofixdlijstelementABC} -\def\dodolijstelementd{\let\dosomelijstelement\dodofixdlijstelementD} -\def\dodolijstelemente{\let\dosomelijstelement\dodofixdlijstelementE} -\def\dodolijstelementf{\let\dosomelijstelement\dodofixdlijstelementF} -\def\dodolijstelementg{\let\dosomelijstelement\dodofixdlijstelementG} +\setvalue{\@@dodolijstelement a}{\let\dosomelijstelement\dodofixdlijstelementABC} +\setvalue{\@@dodolijstelement b}{\let\dosomelijstelement\dodofixdlijstelementABC} +\setvalue{\@@dodolijstelement c}{\let\dosomelijstelement\dodofixdlijstelementABC} +\setvalue{\@@dodolijstelement d}{\let\dosomelijstelement\dodofixdlijstelementD} +\setvalue{\@@dodolijstelement e}{\let\dosomelijstelement\dodofixdlijstelementE} +\setvalue{\@@dodolijstelement f}{\let\dosomelijstelement\dodofixdlijstelementF} +\setvalue{\@@dodolijstelement g}{\let\dosomelijstelement\dodofixdlijstelementG} -\setvalue{dodolijstelement\v!geen}% +\setvalue{\@@dodolijstelement\v!geen}% {\def\dosomelijstelement{\dodofreevlijstelement}} -\setvalue{dodolijstelement\v!vertikaal}% +\setvalue{\@@dodolijstelement\v!vertikaal}% {\def\dosomelijstelement{\dodofreevlijstelement}} -\setvalue{dodolijstelement\v!horizontaal}% +\setvalue{\@@dodolijstelement\v!horizontaal}% {\def\dosomelijstelement{\dodofreehlijstelement}} -\setvalue{dodolijstelement\v!commando}% +\setvalue{\@@dodolijstelement\v!commando}% {\let\dosomelijstelement\dodocommandlijstelement} % Here I learned something new: \leftskip can be changed @@ -336,7 +346,7 @@ \def\dolijstelement#1#2#3#4#5#6% pas op: wordt ook elders gedefinieerd {\doiftoclevelelse[#5] - {\getvalue{dodolijstelement\getvalue{\??li#1\c!variant}}% + {\getvalue{\@@dodolijstelement\getvalue{\??li#1\c!variant}}% %\showcomposition \let\@@iabreedte=\!!zeropoint % moet boolean worden \bgroup @@ -589,11 +599,12 @@ \def\strippedlistentry[#1::#2::#3]{#1::#2}% \def\linklisttoelement#1#2#3#4#5% % list location format page data - {\ifautocrossdocument - \gotodestination{}{}{#1::\strippedlistentry[#3]}{#4}{#5}% - \else + {%\ifautocrossdocument + % \gotodestination{}{}{#1::\strippedlistentry[#3]}{#4}{#5}% + %\else \gotonextinternal{#1}{#2}{#4}{#5}% - \fi} + %\fi} + } \def\schrijfnaarlijst[#1]#2#3% {\doifsomething{#1} diff --git a/tex/context/base/core-mat.tex b/tex/context/base/core-mat.tex index 1cc32fcb6..76f60ff41 100644 --- a/tex/context/base/core-mat.tex +++ b/tex/context/base/core-mat.tex @@ -44,7 +44,7 @@ %D and \type{sub}. \global\let\normalsuper=^ -\global\let\normalsub =_ +\global\let\normalsuber=_ \newcount\supersubmode @@ -53,16 +53,16 @@ \appendtoks \advance\supersubmode by 1 \to \everysupersub % \def\dodosuper#1{\normalsuper{\the\everysupersub#1}} -% \def\dodosub #1{\normalsub {\the\everysupersub#1}} +% \def\dodosuber#1{\normalsuber{\the\everysupersub#1}} % % \def\dosuper{\ifx\next\bgroup\expandafter\dodosuper\else\normalsuper\fi} -% \def\dosub {\ifx\next\bgroup\expandafter\dodosub \else\normalsub \fi} +% \def\dosuber{\ifx\next\bgroup\expandafter\dodosuber\else\normalsuber\fi} % -% \def\super {\futurelet\next\dosuper} -% \def\sub {\futurelet\next\dosub } +% \def\super{\futurelet\next\dosuper} +% \def\suber{\futurelet\next\dosuber} \def\super#1{\normalsuper{\the\everysupersub#1}} -\def\sub #1{\normalsub {\the\everysupersub#1}} +\def\suber#1{\normalsuber{\the\everysupersub#1}} %D \macros %D {enablesupersub} @@ -75,9 +75,9 @@ \catcode`\_=\@@active \gdef\enablesupersub% {\catcode`\^=\@@active - \def^{\ifmmode\expandafter\super\else\expandafter\donormalsuper\fi}% + \def^{\ifmmode\expandafter\super\else\expandafter\normalsuper\fi}% \catcode`\_=\@@active - \def_{\ifmmode\expandafter\sub \else\expandafter\donormalsub \fi}} + \def_{\ifmmode\expandafter\suber\else\expandafter\normalsuber\fi}} \egroup %D \macro diff --git a/tex/context/base/core-mps.tex b/tex/context/base/core-mps.tex deleted file mode 100644 index 724402983..000000000 --- a/tex/context/base/core-mps.tex +++ /dev/null @@ -1,143 +0,0 @@ -%D \module -%D [ file=core-mps, -%D version=1999.07.10, -%D title=\CONTEXT\ Core Macros, -%D subtitle=\METAPOST\ Connectivity, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{Context Core Macros / MetaPost Connectivity} - -\unprotect - -%D Let's first preload a few auxiliary \METAPOST\ files. - -\appendtoks - input mp-tool ; - input mp-spec ; - _inline_shading_ := true ; -\to \MPinitializations - -%D We save the number of graphics for the sake of \TEXEXEC. - -\newcounter\totalnumberofMPgraphics -\def\thecurrentMPgraphic{\the\currentMPgraphic} - -\appendtoks - \savecurrentvalue\totalnumberofMPgraphics\thecurrentMPgraphic -\to \everybye - -%D The next few macros tell \METAPOST\ how the \CONTEXT\ -%D pagebody looks. - -\def\writeMPpagedata% - {\bgroup - \def\writeMPpagedata ##1 ##2% - {\scratchdimen=##2% - \immediate\write\scratchwrite{##1 := \the\scratchdimen;}}% - \immediate\openout\scratchwrite=\TEXbufferfile{mp-state}\relax - \writeMPpagedata PaperHeight \papierhoogte - \writeMPpagedata PaperWidth \papierbreedte - \writeMPpagedata PrintPaperHeight \printpapierhoogte - \writeMPpagedata PrintPaperWidth \printpapierbreedte - \writeMPpagedata TopSpace \kopwit - \writeMPpagedata BackSpace \rugwit - \writeMPpagedata MakeupHeight \zethoogte - \writeMPpagedata MakeupWidth \zetbreedte - \writeMPpagedata TopHeight \bovenhoogte - \writeMPpagedata TopDistance \bovenafstand - \writeMPpagedata HeaderHeight \hoofdhoogte - \writeMPpagedata HeaderDistance \hoofdafstand - \writeMPpagedata TextHeight \teksthoogte - \writeMPpagedata FooterDistance \voetafstand - \writeMPpagedata FooterHeight \voethoogte - \writeMPpagedata BottomDistance \onderafstand - \writeMPpagedata BottomHeight \onderhoogte - \writeMPpagedata LeftEdgeWidth \linkerrandbreedte - \writeMPpagedata LeftEdgeDistance \linkerrandafstand - \writeMPpagedata LeftMarginWidth \linkermargebreedte - \writeMPpagedata LeftMarginDistance \linkermargeafstand - \writeMPpagedata TextWidth \tekstbreedte - \writeMPpagedata RightMarginDistance \rechtermargeafstand - \writeMPpagedata RightMarginWidth \rechtermargebreedte - \writeMPpagedata RightEdgeDistance \rechterrandafstand - \writeMPpagedata RightEdgeWidth \rechterrandbreedte - \doifelsevalue{\??ma\v!pagina\c!offset}{\v!overlay} - {\writeMPpagedata PageOffset {0pt}} - {\writeMPpagedata PageOffset {\getvalue{\??ma\v!pagina\c!offset}}}% - \writeMPpagedata PageDepth {\getvalue{\??ma\v!pagina\c!diepte}}% - \immediate\closeout\scratchwrite - \egroup} - -\prependtoks \flushMPpagedata \to \everyMPgraphic - -\let\flushMPpagedata\relax - -\def\setMPpagedata% - {\gdef\flushMPpagedata{\writeMPpagedata\global\let\flushMPpagedata\relax}} - -%D We have to make sure that the right page data is loaded, -%D especially when we run multiple jobs on one path. - -\prependtoks \prepareMPpagedata \to \everyMPgraphic - -\def\prepareMPpagedata% - {\appendtoks - input mp-page ; - def LoadPageState = - scantokens "input \TEXbufferfile{mp-state}" ; - enddef ; - \to \MPinitializations - \let\prepareMPpagedata\relax} - -%D \macros -%D {startuniqueMPgraphic, uniqueMPgraphic} -%D -%D This macros is probably of most use to myself, since I like -%D to use graphics that adapt themselves. The next \METAPOST\ -%D kind of graphic is both unique and reused when possible. -%D -%D \starttypen -%D \defineoverlay[example][\uniqueMPgraphic{test}] -%D -%D \startuniqueMPgraphic {test} -%D draw unitsquare xscaled \overlaywidth yscaled \overlayheight ; -%D \stopuniqueMPgraphic -%D \stoptypen - -\long\def\startuniqueMPgraphic#1#2\stopuniqueMPgraphic% - {\setvalue{MP:#1}% - {\startreusableMPgraphic{\overlaystamp:#1}#2\stopreusableMPgraphic - \reuseMPgraphic{\overlaystamp:#1}}} - -\def\uniqueMPgraphic#1% - {\getvalue{MP:#1}} - -\def\overlaystamp% - {\overlaywidth:\overlayheight:\overlaydepth:\overlaycolor} - -%D We redefine a macro from \type {supp-mps.tex}: - -\def\MPdatafile% - {\bufferprefix mpd-\the\currentMPgraphic.tmp} - -%D We also have to make sure that \METAPOST\ knows this: - -\appendtoks - if not known _data_prefix_ : - string _data_prefix_ , _data_suffix_ ; - fi ; - _data_prefix_ := "\bufferprefix mpd-" ; - _data_suffix_ := ".tmp" ; -\to \MPinitializations - -%D Happy drawing. - -\protect - -\endinput diff --git a/tex/context/base/core-mul.tex b/tex/context/base/core-mul.tex index f358604e0..ec5578012 100644 --- a/tex/context/base/core-mul.tex +++ b/tex/context/base/core-mul.tex @@ -101,6 +101,40 @@ 13: siroky plovouci objekt je presunut nad sloupce \stopmessages +\startmessages italian library: columns + title: colonne + 1: solo -- colonne possibili + 2: in alternativa, usare \string\filbreak + 3: problemi, disabilitare il bilanciamento + 4: float in cima non ancora supportato + 5: float in fondo non ancora supportato + 6: -- float(s) posticipate + 7: bilanciamento annullato dopo 100 passi + 8: bilanciamento in -- passo/i + 9: controllare seghettamento + 10: (meno di) una riga rimasta + 11: oggetto mobile troppo ampio per la colonna + 12: oggetto mobile spostata alla colonna successiva / -- + 13: oggetto mobile ampio spostato sopra le colonne +\stopmessages + +\startmessages norwegian library: columns + title: kolonner + 1: maksimalt -- kolonner + 2: bruk \string\filbreak\space som et alternativ + 3: problemer, slår av balansering + 4: flytblokker øverst er ikke støttet enda + 5: flytblokker nedert er ikke støttet enda + 6: -- flytblokk forskjøvet + 7: balansering avbrutt etter 100 iterasjoner + 8: balansert etter -- iterasjoner + 9: kontroller tekstlayout! + 10: (mindre enn) 1 linje igjen + 11: flytblokk for bredt for kolonna + 12: flytblokk forskjøvet til neste kolonne / -- + 13: bred flytblokk forksjøvet til toppen av kolonnene +\stopmessages + %D This completely new implementation can handle enough %D situations for everyday documents, but is still far from %D perfect. While at the moment the routine doesn't support @@ -139,8 +173,8 @@ %D %D \interface \type{\nofcolumns} \\ %D the number of columns \\ -%D \interface \type{\minbalancetoplines} -%D the minimum number op balanced top lines +%D \interface \type{\minbalancetoplines} \\ +%D the minimum number op balanced top lines \\ %D \interface \type{\betweencolumns} \\ %D the stuff between columns \\ %D \interface \type{\finaloutput{action}{box}} \\ @@ -205,6 +239,8 @@ %D %D \interface \type{\finishcolumnbox} \\ %D do something special (a hook) \\ +%D \interface \type{\postprocesscolumnpagebox} \\ +%D do something with each columnbox (also a hook) \\ %D \interface \type{\postprocesscolumnbox} \\ %D do something with each columnbox (also a hook) \\ %D \interface \type{\postprocesscolumnline} \\ @@ -276,6 +312,20 @@ \newdimen\finalcolumnheights \newcount\finalcolumnlines +%D It's more convenient to use \type {\columnwidth} instead +%D of messing around with boxes each time. + +\newdimen\columnwidth +\newdimen\gutterwidth + +\def\determinecolumnwidth% + {\bgroup + \setbox\scratchbox=\hbox + {\setcolumnhsize + \global\columnwidth=\usercolumnwidth + \global\gutterwidth=\intercolumnwidth}% + \egroup} + %D During initialization the temporary boxes are allocated. %D This enables us to use as much columns as we want, without %D exhausting the pool of boxes too fast. We could have packed @@ -451,7 +501,7 @@ \ifdim\partialpageheight>\!!zeropoint \global\advance\vsize by -\partialpageheight \fi - \getinsertionheights\to\dimen0\\% + \getinsertionheights\to\dimen0\\% \global\advance\vsize by -\dimen0 \ifgridsnapping % evt altijd, nog testen \getnoflines\vsize @@ -546,7 +596,7 @@ %D reasoning to find out what happens and maybe I'm making %D some mistake, but it works. %D -%D Unvoiding box \type{\partialpage} is sometimes necessary, +%D Voiding box \type{\partialpage} is sometimes necessary, %D e.g. when there is no text given between \type{\begin..} %D and \type{\end..}. The \type{\par} is needed! @@ -554,9 +604,9 @@ {%\par \vskip\lineheight\vskip-\lineheight % take footnotes into account \dontshowcomposition -\doflushcolumnfloat % added recently - \doflushcolumnfloats % added recently - \flushfootnotes + \doflushcolumnfloat % added recently + %\doflushcolumnfloats % no, since it results in wrong top floats + \flushfootnotes % before start of columns \par \ifbalancecolumns \global\output={\continuousmulticolumnsout}% @@ -645,6 +695,8 @@ \let\maxcolumnheight=\!!zeropoint \let\maxcolumndepth =\!!zeropoint +\newbox\columnpagebox + \def\setmaxcolumndimensions% {\let\maxcolumnheight=\!!zeropoint \let\maxcolumndepth =\!!zeropoint @@ -656,6 +708,76 @@ \edef\maxcolumndepth{\the\dp\currentcolumnbox}% \fi}} +% \def\flushcolumnedpage% +% {\bgroup +% \forgetall +% \setmulticolumnsout +% \showcomposition +% \setmaxcolumndimensions +% \postprocesscolumns +% \dohandleallcolumns % \hbox i.v.m. \showcomposition +% {\global\setbox\currentcolumnbox=\hbox to \localcolumnwidth +% {\box\currentcolumnbox +% \global\wd\currentcolumnbox=\localcolumnwidth +% \ifheightencolumns +% \global\ht\currentcolumnbox=\fixedcolumnheight +% \fi}}% +% \setmaxcolumndimensions +% \overlaycolumnfootnotes +% \setbox0=\vbox +% {\hbox to \finalcolumntextwidth +% {\ifreversecolumns +% \@EA\dohandlerevcolumns +% \else +% \@EA\dohandleallcolumns +% \fi +% {\finishcolumnbox{\hbox +% {\ifx\finishcolumnbox\relax\else\strut\fi +% \box\currentcolumnbox}}% +% \hfil}% +% \unskip}}% +% \scratchdimen=\!!zeropoint +% \dohandleallcolumns +% {\ifdim-\ht\currenttopcolumnbox<\scratchdimen +% \scratchdimen=-\ht\currenttopcolumnbox +% \fi +% \global\setbox\currenttopcolumnbox=\box\voidb@x}% +% \advance\scratchdimen by \ht0 +% \setbox2=\hbox to \columntextwidth +% {\vrule\!!width\!!zeropoint\!!height\scratchdimen\!!depth\dp0 +% \dostepwiserecurse{2}{\nofcolumns}{1}{\hfil\betweencolumns}\hfil}% +% \setbox0=\hbox +% {\box0\hskip-\columntextwidth\color[black]{\box2}}% +% \ifvoid\partialpage \else +% \ifgridsnapping % do you believe this junk? +% \scratchdimen=\savedpagetotal +% \advance\scratchdimen by -\ht\partialpage +% \advance\scratchdimen by -\dp\partialpage +% \advance\scratchdimen by -\topskip +% \box\partialpage +% \kern\scratchdimen +% \else +% \unvbox\partialpage +% \fi +% \fi +% \global\partialpageheight=\!!zeropoint +% \setvsize +% \dosomebreak\nobreak +% \ifgridsnapping \else +% \dimen0=\topskip +% \advance\dimen0 by -\openstrutheight +% \nointerlineskip +% \vskip-\dimen0 +% \fi +% \prevdepth\openstrutdepth +% \nointerlineskip +% \dp0=\!!zeropoint +% \global\finalcolumnheights=\ht0 +% \getnoflines\finalcolumnheights +% \global\finalcolumnlines=\noflines +% \box0 +% \egroup} + \def\flushcolumnedpage% {\bgroup \forgetall @@ -672,7 +794,7 @@ \fi}}% \setmaxcolumndimensions \overlaycolumnfootnotes - \setbox0=\vbox + \setbox\columnpagebox=\vbox {\hbox to \finalcolumntextwidth {\ifreversecolumns \@EA\dohandlerevcolumns @@ -690,12 +812,18 @@ \scratchdimen=-\ht\currenttopcolumnbox \fi \global\setbox\currenttopcolumnbox=\box\voidb@x}% - \advance\scratchdimen by \ht0 - \setbox2=\hbox to \columntextwidth - {\vrule\!!width\!!zeropoint\!!height\scratchdimen\!!depth\dp0 + \advance\scratchdimen by \ht\columnpagebox + \setbox\scratchbox=\hbox to \columntextwidth + {\vrule + \!!width\!!zeropoint + \!!height\scratchdimen + \!!depth\dp\columnpagebox \dostepwiserecurse{2}{\nofcolumns}{1}{\hfil\betweencolumns}\hfil}% - \setbox0=\hbox - {\box0\hskip-\columntextwidth\color[black]{\box2}}% + \setbox\columnpagebox=\hbox + {\box\columnpagebox + \hskip-\columntextwidth + \color[black]{\box\scratchbox}}% + \postprocesscolumnpagebox % new, acts upon \box\columnpagebox \ifvoid\partialpage \else \ifgridsnapping % do you believe this junk? \scratchdimen=\savedpagetotal @@ -712,18 +840,18 @@ \setvsize \dosomebreak\nobreak \ifgridsnapping \else - \dimen0=\topskip - \advance\dimen0 by -\openstrutheight + \scratchdimen=\topskip + \advance\scratchdimen by -\openstrutheight \nointerlineskip - \vskip-\dimen0 + \vskip-\scratchdimen \fi \prevdepth\openstrutdepth \nointerlineskip - \dp0=\!!zeropoint - \global\finalcolumnheights=\ht0 + \dp\columnpagebox=\!!zeropoint + \global\finalcolumnheights=\ht\columnpagebox \getnoflines\finalcolumnheights \global\finalcolumnlines=\noflines - \box0 + \box\columnpagebox \egroup} %D In case one didn't notice, finaly \type{\finishcolumnbox} is @@ -803,8 +931,9 @@ %D We default to doing nothing! -\let\postprocesscolumnline=\undefined -\let\postprocesscolumnbox =\undefined +\let\postprocesscolumnline =\undefined +\let\postprocesscolumnbox =\undefined +\let\postprocesscolumnpagebox=\relax %D \macros %D {reversecolumnstrue} @@ -1344,17 +1473,19 @@ \fi} \def\docolumnroomfloat% - {\ifnofloatpermitted + {\ifpostponecolumnfloats + \global\roomforfloatfalse + \else\ifnofloatpermitted \global\roomforfloatfalse \else \bgroup \getcolumnstatus\column\count255\total\dimen0\goal\dimen2\\% \advance\dimen0 by 2\openlineheight % nog nodig ? -%\ifnum\count255=\nofcolumns -% \getinsertionheight -% %\message{\insertionheight}\wait -% \advance\dimen0 by \insertionheight -%\fi + %\ifnum\count255=\nofcolumns + % \getinsertionheight + % %\message{\insertionheight}\wait + % \advance\dimen0 by \insertionheight + %\fi \setbox\scratchbox=\vbox % tricky met objecten ? {\blanko[\@@bkvoorwit] \snaptogrid\vbox{\copy\floatbox}}% @@ -1371,7 +1502,7 @@ \global\roomforfloatfalse \fi \egroup - \fi} + \fi\fi} %D Flushing one float is done as soon as possible, i.e. %D \type{\everypar}. This means that (at the moment) @@ -1380,7 +1511,7 @@ \newif\ifflushingcolumnfloats \flushingcolumnfloatstrue \def\doflushcolumnfloat% - {\ifflushingcolumnfloats\ifprocessingverbatim\else\ifsomefloatwaiting + {\ifpostponecolumnfloats\else\ifflushingcolumnfloats\ifprocessingverbatim\else\ifsomefloatwaiting \bgroup \forgetall \let\doflushcolumnfloat=\relax @@ -1390,10 +1521,10 @@ \ifdim\wd\floatbox>\hsize \doresavefloat \else -% \setbox2=\vbox -% {\blanko[\@@bkvoorwit] -% \snaptogrid\vbox{\copy\floatbox}% -% \blanko[\@@bknawit] + %\setbox2=\vbox + % {\blanko[\@@bkvoorwit] + % \snaptogrid\vbox{\copy\floatbox}% + % \blanko[\@@bknawit] \setbox2=\vbox {\blanko[\@@bkvoorwit] \snaptogrid\vbox{\copy\floatbox}}% @@ -1426,9 +1557,9 @@ \par \ifdim\prevdepth<\!!zeropoint\relax % anders bovenaan kolom witruimte \else -\nobreak + \nobreak \blanko[\@@bkvoorwit] -\nobreak + \nobreak \fi \flushfloatbox \blanko[\@@bknawit] @@ -1436,7 +1567,7 @@ \fi \fi \egroup - \fi\fi\fi} + \fi\fi\fi\fi} %D This one looks complicated. Upto \type{\nofcolumns} floats %D are placed, taking the width of a float into account. This @@ -1453,76 +1584,81 @@ %D because of lining out the columns. \def\doflushcolumnfloats% - {\bgroup - \forgetall - \ifsomefloatwaiting - \dimen8=\!!zeropoint - \dimen4=\!!zeropoint - \count0=0 % count0 can be used local - \count2=\nofcolumns % count2 can be used local - \dohandleallcolumns - {\ifnum\count0>0\relax % the wide one's reserved space - \global\setbox\currenttopcolumnbox=\vbox - {\snaptogrid\vbox - {\copy\currenttopcolumnbox - \hbox{\vphantom{\copy\floatbox}}} - \witruimte % nodig ? - \blanko[\@@bknawit]}% - \else - \dogetfloat - \ifdim\wd\floatbox>\hsize - \dimen0=\wd\floatbox - \advance\dimen0 by \intercolumnwidth - \dimen2=\hsize - \advance\dimen2 by \intercolumnwidth -\advance\dimen0 by .5pt -\advance\dimen2 by .5pt - \divide\dimen0 by \dimen2 - \count0=\dimen0 - \advance\count0 by 1 - \ifnum\count0>\count2 - \doresavefloat - \count0=0 - \else - \dimen0=\count0\hsize - \advance\dimen0 by \count0\intercolumnwidth - \advance\dimen0 by -\intercolumnwidth - \global\setbox\floatbox=\hbox to \dimen0 - %{\hss\hbox{\copy\floatbox}\hss}% - {\processaction[\@@bkplaats] % how easy to forget - [ \v!links=>\copy\floatbox\hss, - \v!rechts=>\hss\copy\floatbox, - \s!default=>\hss\copy\floatbox\hss, - \s!unknown=>\hss\copy\floatbox\hss]}% - \fi - \showmessage{\m!columns}{13}{}% - \else - % \showmessage{\m!columns}{13}{}% - \fi - \ifdim\ht\floatbox>\!!zeropoint\relax + {\ifpostponecolumnfloats\else + \bgroup + \forgetall + \ifsomefloatwaiting + \dimen8=\!!zeropoint + \dimen4=\!!zeropoint + \count0=0 % count0 can be used local + \count2=\nofcolumns % count2 can be used local + \dohandleallcolumns + {\ifnum\count0>0\relax % the wide one's reserved space \global\setbox\currenttopcolumnbox=\vbox {\snaptogrid\vbox {\copy\currenttopcolumnbox - \copy\floatbox} - \witruimte % nodig ? - \blanko[\@@bknawit]}% + \hbox{\vphantom{\copy\floatbox}}} + \witruimte % nodig ? + \blanko[\@@bknawit]}% + \else + \dogetfloat +\ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too + \global\setbox\floatbox=\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}% +\fi % otherwise the graphic may disappear + \ifdim\wd\floatbox>\hsize + \dimen0=\wd\floatbox + \advance\dimen0 by \intercolumnwidth + \dimen2=\hsize + \advance\dimen2 by \intercolumnwidth + \advance\dimen0 by .5pt % hm, why 1 + \advance\dimen2 by .5pt % hm, why 2 + \divide\dimen0 by \dimen2 + \count0=\dimen0 + \advance\count0 by 1 + \ifnum\count0>\count2 + \doresavefloat + \count0=0 + \else + \dimen0=\count0\hsize + \advance\dimen0 by \count0\intercolumnwidth + \advance\dimen0 by -\intercolumnwidth + \global\setbox\floatbox=\hbox to \dimen0 + %{\hss\hbox{\copy\floatbox}\hss}% + {\processaction[\@@bkplaats] % how easy to forget + [ \v!links=>\copy\floatbox\hss, + \v!rechts=>\hss\copy\floatbox, + \s!default=>\hss\copy\floatbox\hss, + \s!unknown=>\hss\copy\floatbox\hss]}% + \fi + \showmessage{\m!columns}{13}{}% + \else + % \showmessage{\m!columns}{13}{}% + \fi + \ifdim\ht\floatbox>\!!zeropoint\relax + \global\setbox\currenttopcolumnbox=\vbox + {\snaptogrid\vbox + {\copy\currenttopcolumnbox + \copy\floatbox} + \witruimte % nodig ? + \blanko[\@@bknawit]}% + \fi + \dimen6=\ht\currenttopcolumnbox + \advance\dimen6 by \dp\currenttopcolumnbox \fi - \dimen6=\ht\currenttopcolumnbox - \advance\dimen6 by \dp\currenttopcolumnbox - \fi - \ifdim\dimen4<\ht\currenttopcolumnbox - \dimen4=\ht\currenttopcolumnbox - \fi - \advance\dimen8 by \dimen6 - \advance\count2 by -1 - \advance\count0 by -1 }% - \setvsize - \global\advance\vsize by -\dimen8 - \global\pagegoal=\vsize - \else - %\doflushfloats % does not snap! - \fi - \egroup} + \ifdim\dimen4<\ht\currenttopcolumnbox + \dimen4=\ht\currenttopcolumnbox + \fi + \advance\dimen8 by \dimen6 + \advance\count2 by -1 + \advance\count0 by -1 }% + \setvsize + \global\advance\vsize by -\dimen8 + \global\pagegoal=\vsize + \else + %\doflushfloats % does not snap! + \fi + \egroup + \fi} %D This were the multi||column routines. They can and need to %D be improved but at the moment their behaviour is acceptable. @@ -1534,9 +1670,7 @@ %D \normalizevbox{...} %D \stoptypen -\protect - -\endinput +\protect \endinput % border case, should fit on one page % diff --git a/tex/context/base/core-nav.tex b/tex/context/base/core-nav.tex index acbbeec47..5bb611bf6 100644 --- a/tex/context/base/core-nav.tex +++ b/tex/context/base/core-nav.tex @@ -74,6 +74,9 @@ \doifelse{\@@iaklik}{\v!ja} {\highlighthyperlinkstrue} {\highlighthyperlinksfalse}% + \doifelse{\@@iasplitsen}{\v!ja} + {\locationsplittrue} + {\locationsplitfalse}% \doifelse{\@@iascherm}{\v!nieuw} {\gotonewwindowtrue} {\gotonewwindowfalse}% @@ -125,6 +128,7 @@ %D This macro stores the current strut values. \newif\iflocationstrut +\newif\iflocationsplit \def\resetgoto% {\global\let\@@ia@@hoogte=\!!zeropoint @@ -319,7 +323,8 @@ \c!klik=\v!ja, \c!scherm=, %\c!openactie={\v!eerstepagina,AtOpenInitializeForm}, - \c!openactie={\v!eerstepagina,\v!ResetForm}, + %\c!openactie={\v!eerstepagina,\v!ResetForm}, + \c!openactie=\v!ResetForm, \c!sluitactie=, \c!openpaginaactie=, \c!sluitpaginaactie=, @@ -328,6 +333,7 @@ \c!letter=\v!vet, \c!bereken=, \c!strut=\v!ja, + \c!splitsen=\v!ja, \c!kleur=interactioncolor, \c!contrastkleur=interactioncontrastcolor, \c!symboolset=, diff --git a/tex/context/base/core-new.tex b/tex/context/base/core-new.tex index 610d89aae..3119af447 100644 --- a/tex/context/base/core-new.tex +++ b/tex/context/base/core-new.tex @@ -48,8 +48,23 @@ % % this one fails in removing system modes +% \def\enablemode[#1]% +% {\expanded{\addtocommalist{#1}\noexpand\currentmode}} + +%D Sometimes, we want to prevent a mode for being set. Think +%D of situations where a style enables a mode, but an outer +%D level style does not want that. Preventing can be +%D considered a permanent disabling on forehand. + +\let\preventedmodes\empty + +\def\preventmode[#1]% + {\expanded{\addtocommalist{#1}\noexpand\preventedmodes}} + \def\enablemode[#1]% - {\expanded{\addtocommalist{#1}\noexpand\currentmode}} + {\expanded + {\doifnotinset{#1}{\preventedmodes} + {\noexpand\addtocommalist{#1}\noexpand\currentmode}}} \def\disablemode[#1]% {\expanded{\removefromcommalist{#1}\noexpand\currentmode}} diff --git a/tex/context/base/core-not.tex b/tex/context/base/core-not.tex index 7b88a254b..89b411f7f 100644 --- a/tex/context/base/core-not.tex +++ b/tex/context/base/core-not.tex @@ -98,10 +98,12 @@ {\dosingleempty\dosetupfootnotes} \def\dodofootnoterule% - {\color - [\@@vnlijnkleur] - {\hrule\!!width.2\hsize\!!height\@@vnlijndikte\!!depth\!!zeropoint} - \kern\strutdepth} + {\ifvmode + \color + [\@@vnlijnkleur] + {\hrule\!!width.2\hsize\!!height\@@vnlijndikte\!!depth\!!zeropoint} + \kern\strutdepth + \fi} \def\dosetupfootnotes[#1]% {\getparameters[\??vn][#1]% @@ -150,6 +152,12 @@ \dimen\footins=\@@vnhoogte \multiply\dimen\footins by \scratchcounter} +\ifx\setfootnotehsize\undefined + + \def\setfootnotehsize{\hsize=\@@vnbreedte} % can be overloaded + +\fi + \def\setcleverfootnotes% {\def\startpushfootnote {\bgroup % wellicht ooit kopuitlijnen \stelinmargein[\c!uitlijnen=\v!links]% @@ -160,7 +168,8 @@ \def\stoppopfootnotes {}} \def\setcolumnfootnotes% - {\def\startpushfootnote {\setrigidcolumnhsize\@@vnbreedte\@@vnkolomafstand\@@vnn + {\def\startpushfootnote {\setfootnotehsize % possibly overloaded + \setrigidcolumnhsize\hsize\@@vnkolomafstand\@@vnn \bgroup \stelinmargein[\c!uitlijnen=\v!links]% \getvalue{\e!start\??vn\??vn}}% @@ -177,7 +186,7 @@ \stopvboxtohbox}% \def\startpopfootnotes {\vbox\bgroup % \doifdimenelse \doifnotinset{\@@vnbreedte}{\v!passend,\v!ruim} - {\hsize=\@@vnbreedte}}% + {\setfootnotehsize}}% \def\stoppopfootnotes {\convertvboxtohbox\egroup}} %D The numbers that accompany a footnote are generated using @@ -348,6 +357,8 @@ \def\dostartfootnote% nog gobble als in pagebody {\bgroup + %\restorecatcodes % to be tested first + \ignorelines % makes footnotes work in \startlines ... \stoplines \unskip\unskip \ifdim\lastkern=\footnotesignal \high{\kern\@@vnafstand}% gets the font right, hack ! @@ -374,7 +385,8 @@ \def\linkermargeafstand{\@@vnmargeafstand}% \def\rechtermargeafstand{\@@vnmargeafstand}% \ifcase\@@vnn\relax % new 31-07-99 ; always ? - \doifnotinset{\@@vnbreedte}{\v!passend,\v!ruim}{\hsize\@@vnbreedte}% + \doifnotinset{\@@vnbreedte}{\v!passend,\v!ruim} + {\setfootnotehsize}% \fi \startpushfootnote {\ifx\footnotenumber\empty \else @@ -430,32 +442,6 @@ \let\startpopfootnotes = \relax \let\stoppopfootnotes = \relax -% \def\placefootnoteinserts% -% {%\ifvoid\footins \else % unsafe, strange -% \ifdim\ht\footins>\!!zeropoint\relax -% \ifendnotes \else -% \@@vnvoor -% \dofootnoterule % alleen in ..mode -% \bgroup -% \setfootnotebodyfont -% \localframed -% [\??vn] -% [\c!breedte=\v!passend, -% \c!hoogte=\v!passend, -% \c!strut=\v!nee, -% \c!offset=\v!overlay] -% {\startpopfootnotes % == \vbox -% \ifdim\dp\footins=\!!zeropoint % this hack is needed because \vadjust -% \hbox{\lower\dp\strutbox\box\footins}% % in margin number placement -% \else % hides the (always) present depth -% \box\footins -% \fi -% \stoppopfootnotes}% -% \egroup -% \@@vnna -% \fi -% \fi} - \def\placefootnoteinserts% {%\ifvoid\footins \else % unsafe, strange \ifdim\ht\footins>\!!zeropoint\relax @@ -516,7 +502,8 @@ \newbox\postponedfootnotes \def\autopostponefootnotes% - {\gdef\localfootinsert% +% {\gdef\localfootinsert% + {\def\localfootinsert% {\ifinner %\message{[postponed footnote]}% \global\setbox\postponedfootnotes=\vbox\bgroup @@ -531,7 +518,8 @@ \def\postponefootnotes% {\let\autopostponefootnotes=\postponefootnotes \let\postponefootnotes\relax % prevent loops - \gdef\localfootinsert% +% \gdef\localfootinsert% + \def\localfootinsert% {%\message{[postponed footnote]}% \global\setbox\postponedfootnotes=\vbox\bgroup \unvbox\postponedfootnotes @@ -540,7 +528,8 @@ \def\doflushfootnotes% also called directly, \ifvoid is needed ! {\ifendnotes \else \ifvoid\postponedfootnotes - \global\let\localfootinsert=\insert +% \global\let\localfootinsert=\insert + \let\localfootinsert=\insert \else \bgroup \ifdim\ht\postponedfootnotes>\!!zeropoint @@ -551,7 +540,8 @@ \fi \fi \egroup - \global\let\localfootinsert=\insert +% \global\let\localfootinsert=\insert + \let\localfootinsert=\insert \insert\footins\bgroup\unvbox\postponedfootnotes\egroup \fi \fi} diff --git a/tex/context/base/core-ntb.tex b/tex/context/base/core-ntb.tex new file mode 100644 index 000000000..7a3119c17 --- /dev/null +++ b/tex/context/base/core-ntb.tex @@ -0,0 +1,921 @@ +%D \module +%D [ file=core-tbl, +%D version=2000.04.18, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Natural Tables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is an unfinished, preliminary module. At least two +%D runs are needed to get the table fixed. + +\writestatus{loading}{Context Core Macros / Natural Tables} + +%D As always, this is the nth version. Much time went in +%D trying to speed up the many cell calculations, some +%D optimizations were rejected in order not to complicate this +%D module too much (and in order to prevail extensibility). + +%D To Do: +%D +%D \starttypen +%D break over pagina +%D kop herhalen +%D reset settings +%D +%D \setupTABLE [c|column|x] [nx|odd|even|first|last][a=b] +%D \setupTABLE [r|row |y] [nx|odd|even|first|last][a=b] +%D \setupTABLE [nx|odd|even|first|last][ny|odd|even|first|last][a=b] +%D \setupTABLE [nx|odd|even|first|last] [a=b] +%D \setupTABLE [a=b] +%D +%D \bTH \eTH +%D \stoptypen + +\unprotect + +%D A simple way to force equal line spacing is to say: +%D +%D \starttypen +%D \def\bTBLCELL{\begstrut} +%D \def\eTBLCELL{\endstrut} +%D \stoptypen + +%D However, the next alternative also takes care of preceding +%D and following white space. + +\def\bTBLCELL% + {\inhibitblank\doconvertfont\tbltblletter\empty\everypar{\begstrut}} + +\def\eTBLCELL% + {\ifhmode + \endstrut + \else + \par + \ifdim\prevdepth<\!!zeropoint % =-1000pt ? + \vskip-\dp\strutbox + \else + \removebottomthings + \fi + \fi} + +\newcounter\currenttbl + +%\def\@@tbl{tbl} \def\tblcell{m} \def\tblnone{n} +\def\@@tbl{tbl} \def\tblcell{1} \def\tblnone{2} + +\def\@@tblprefix{tbl:} + +%D This should be done more efficient: + +\def\settbltag#1#2#3{\setevalue{\@@tblprefix#1:#2:s}{#3}} % \number#3 +\def\settblcol#1#2#3{\setevalue{\@@tblprefix#1:#2:c}{#3}} +\def\settblrow#1#2#3{\setevalue{\@@tblprefix#1:#2:r}{#3}} + +\def\settblwd #1#2#3{\setxvalue{\@@tblprefix#1:#2:wd}{#3}} % global ! +\def\settblht #1#2#3{\setxvalue{\@@tblprefix#1:#2:ht}{#3}} % global ! + +\def\gettbltag#1#2{\getvalue{\@@tblprefix#1:#2:s}} +\def\gettblcol#1#2{\getvalue{\@@tblprefix#1:#2:c}} +\def\gettblrow#1#2{\getvalue{\@@tblprefix#1:#2:r}} + +\def\gettblwd #1#2{\getvalue{\@@tblprefix#1:#2:wd}} +\def\gettblht #1#2{\getvalue{\@@tblprefix#1:#2:ht}} + +\def\settblwid#1#2{\setxvalue{\@@tblprefix#1:w}{#2}} % global ! +\def\settblhei#1#2{\setxvalue{\@@tblprefix#1:h}{#2}} % global ! +\def\settblaut#1#2{\setxvalue{\@@tblprefix#1:a}{#2}} % global ! + +\def\gettblwid#1{\ifundefined{\@@tblprefix#1:w}\!!zeropoint\else\getvalue{\@@tblprefix#1:w}\fi} +\def\gettblhei#1{\ifundefined{\@@tblprefix#1:h}\!!zeropoint\else\getvalue{\@@tblprefix#1:h}\fi} +\def\gettblaut#1{\getvalue{\@@tblprefix#1:a}} + +\def\doiftbltag #1#2{\doifdefined {\@@tblprefix#1:#2:s}} +\def\doifnottbltag #1#2{\doifundefined {\@@tblprefix#1:#2:s}} +\def\doifelsetbltag#1#2{\doifdefinedelse{\@@tblprefix#1:#2:s}} +\def\doiftblrow #1#2{\doifdefined {\@@tblprefix#1:#2:r}} +\def\doiftblcol #1#2{\doifdefined {\@@tblprefix#1:#2:c}} +\def\doifnottblcol #1#2{\doifundefined {\@@tblprefix#1:#2:c}} + +\def\settbltxt#1#2{\long\setvalue{\@@tblprefix:#1:#2:t}} +\def\gettbltxt#1#2{\getvalue {\@@tblprefix:#1:#2:t}} + +%\def\doiftbl #1#2#3{\ifcase0\getvalue{\@@tblprefix#1:#2:s}\relax \else#3\fi} +%\def\doifnottbl #1#2#3{\ifcase0\getvalue{\@@tblprefix#1:#2:s}\relax #3\fi} +%\def\doifelsetbl#1#2#3#4{\ifcase0\getvalue{\@@tblprefix#1:#2:s}\relax#4\else#3\fi} +% +%\let\doiftbltag \doiftbl +%\let\doifnottbltag \doifnottbl +%\let\doifelsetbltag\doifelsetbl + +\newtoks\tbltoks + +\let\pushTBLparameters\relax +\let\popTBLparameters \relax + +\newif\ifautoTBLspread \autoTBLspreadfalse +\newif\ifautoTBLhsize \autoTBLhsizetrue +\newif\ifautoTBLrowspan \autoTBLrowspantrue +\newif\ifautoTBLemptycell \autoTBLemptycelltrue +\newif\ifappendTBLsetups \appendTBLsetupstrue + +\newif\iftraceTABLE \traceTABLEfalse + +\presetlocalframed[\@@tbl\@@tbl] + +\long\def\handleTBLcell#1#2[#3]{} + +\long\def\bTC#1\eTC{\bTD#1\eTD} +\long\def\bTX#1\eTX{\bTD#1\eTD} +\long\def\bTY#1\eTY{\bTR#1\eTR} + +\let\getTABLEparameters\getparameters + +\unexpanded\def\setupTABLE% + {\dotripleempty\dosetupTABLE} + +\def\dosetupTABLE[#1][#2][#3]% + {\ifthirdargument + \processaction + [#1] + [ \v!rij=>{\dosetupTABLExy[\c!y][#2][#3]}, + \v!kolom=>{\dosetupTABLExy[\c!x][#2][#3]}, + r=>{\dosetupTABLExy[\c!y][#2][#3]}, + c=>{\dosetupTABLExy[\c!x][#2][#3]}, + y=>{\dosetupTABLExy[\c!y][#2][#3]}, + x=>{\dosetupTABLExy[\c!x][#2][#3]}, + \s!unknown=>{\dosetupTABLEzz[#1][#2][#3]}]% + \else\ifsecondargument + \processaction + [#1] + [ \v!rij=>{\dosetupTABLExy[\c!y][\v!elk][#2]}, + \v!kolom=>{\dosetupTABLExy[\c!x][\v!elk][#2]}, + r=>{\dosetupTABLExy[\c!y][\v!elk][#2]}, + c=>{\dosetupTABLExy[\c!x][\v!elk][#2]}, + y=>{\dosetupTABLExy[\c!y][\v!elk][#2]}, + x=>{\dosetupTABLExy[\c!x][\v!elk][#2]}, + \s!unknown=>{\dosetupTABLEzz[\c!x][#1][#2]}]% + \else + \getparameters[\@@tbl\@@tbl][#1]% + \fi\fi} + +\def\dosetupTABLExy[#1][#2][#3]% + {\def\dodosetupTABLE##1% + {\setTABLEparameters[#1##1][#3]}% + \processcommalist[#2]\dodosetupTABLE} + +\def\dosetupTABLEzz[#1][#2][#3]% + {\def\dodosetupTABLE##1% + {\def\dododosetupTABLE####1% + {\setTABLEparameters[\c!x##1\c!y####1][#3]}% + \processcommalist[#2]\dododosetupTABLE}% + \processcommalist[#1]\dodosetupTABLE} + +\def\nopTABLEparameters[#1][#2]% + {\setvalue{\@@tblprefix#1}{}} + +\def\setTABLEparameters[#1][#2]% + {\pushTBLparameters + \ifappendTBLsetups + \doifdefinedelse{\@@tblprefix#1} + {\def\getTABLEparameters[##1][##2]% + {\setvalue{\@@tblprefix#1}{\getTABLEparameters[\@@tbl\@@tbl][##2,#2]}}% + \getvalue{\@@tblprefix#1}% + \let\getTABLEparameters\getparameters} + {\setvalue{\@@tblprefix#1}{\getTABLEparameters[\@@tbl\@@tbl][#2]}}% + \else + \setvalue{\@@tblprefix#1}{\getTABLEparameters[\@@tbl\@@tbl][#2]}% + \fi + \popTBLparameters} + +\def\v!oddeven#1{\ifodd#1\v!oneven\else\v!even\fi} + +\let\setupTBLsection\relax + +\def\setupTBLcell#1#2% cell over col over row + {\setupTBLsection % here ? + \getvalue{\@@tblprefix\c!y\v!elk}% + \getvalue{\@@tblprefix\c!x\v!elk}% + \getvalue{\@@tblprefix\c!y\v!oddeven{#1}}% + \getvalue{\@@tblprefix\c!x\v!oddeven{#2}}% + \getvalue{\@@tblprefix\c!x\v!oddeven{#2}\c!y\v!oddeven{#1}}% + \ifnum#1=1 \getvalue{\@@tblprefix\c!y\v!eerste }\fi + \ifnum#2=1 \getvalue{\@@tblprefix\c!x\v!eerste }\fi + \ifnum#1=\maximumrow\relax\getvalue{\@@tblprefix\c!y\v!laatste}\fi + \ifnum#2=\maximumcol\relax\getvalue{\@@tblprefix\c!x\v!laatste}\fi + \getvalue{\@@tblprefix\c!y#1}% + \getvalue{\@@tblprefix\c!x#2}% + \getvalue{\@@tblprefix\c!x#2\c!y#1}\relax} + +\long\def\parseTR[#1][#2]#3\eTR% [#2] is dummy that kills spaces + {\def\currentcol{0}\increment\maximumrow#3} + +% \long\def\parseTD[#1][#2]#3\eTD% [#2] is dummy that kills spaces +% {\getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1]% +% \let\row\maximumrow +% \let\col\currentcol +% % goto first cell +% \doloop{\increment\col \doifnottbltag\row\col\exitloop}% +% % fill r*c cells and set span +% \let\currentcol\col +% \let\currentrow\row +% \dorecurse{\tblny} +% {\let\col\currentcol +% \settblcol\row\col\tblnx +% \ifnum\tblnx>\maximumrowspan\relax +% \let\maximumrowspan\tblnx +% \fi +% \dorecurse{\tblnx} +% {\settbltag\row\col\tblnone +% \increment\col}% +% \increment\row}% +% \decrement\row +% % set values +% \settbltag\maximumrow\currentcol\tblcell +% \settblcol\maximumrow\currentcol\tblnx +% \settblrow\maximumrow\currentcol\tblny +% % save text +% \edef\celltag{{\maximumrow}{\currentcol}}% +% \@EA\settbltxt\@EA\maximumrow\@EA\currentcol\@EA +% {\@EA\handleTBLcell\celltag[#1]{#3}}% +% % check max column +% \let\currentcol\col +% \decrement\currentcol +% \ifnum\currentcol>\maximumcol\let\maximumcol\currentcol\fi} + +\long\def\parseTD[#1][#2]#3\eTD% [#2] is dummy that kills spaces + {\getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1]% + % goto first cell + \doloop + {\increment\currentcol + \doifnottbltag\maximumrow\currentcol\exitloop}% + % fill r*c cells and set span + \let\row\maximumrow + \let\col\currentcol + \dorecurse{\tblny} + {\let\col\currentcol + \settblcol\row\col\tblnx + \ifnum\tblnx>\maximumrowspan\relax + \let\maximumrowspan\tblnx + \fi + \dorecurse{\tblnx} + {\settbltag\row\col\tblnone + \increment\col}% + \increment\row}% + % check max column + \decrement\col + \ifnum\col>\maximumcol + \let\maximumcol\col + \fi + % set values + \settbltag\maximumrow\currentcol\tblcell + \settblcol\maximumrow\currentcol\tblnx + \settblrow\maximumrow\currentcol\tblny + % save text + \edef\celltag{{\maximumrow}{\currentcol}}% + \@EA\settbltxt\@EA\maximumrow\@EA\currentcol\@EA + {\@EA\handleTBLcell\celltag[#1]{#3}}} + +\long\def\parseTH[#1]#2\eTH% +% {\parseTD[#1,\c!letter=\v!vet,\c!karakteruitlijnen=\v!nee]#2\eTD} + {\parseTD[#1,\c!kleur=\tbltblkopkleur,\c!letter=\tbltblkopletter,\c!karakteruitlijnen=\v!nee]#2\eTD} + +\newtoks\TBLhead +\newtoks\TBLbody +\newtoks\TBLfoot + +% to be done: head foot, dus state var + +\long\def\bTABLEhead{\dosingleempty\doTABLEhead} +\long\def\bTABLEbody{\dosingleempty\doTABLEbody} +\long\def\bTABLEfoot{\dosingleempty\doTABLEfoot} + +\long\def\doTABLEhead[#1]#2\eTABLEhead% + {\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead} + +\long\def\doTABLEbody[#1]#2\eTABLEbody% + {\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody} + +\long\def\doTABLEfoot[#1]#2\eTABLEfoot% + {\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot} + +\long\def\doTABLEsection[#1]#2% + {\def\setupTBLsection{\getparameters[\@@tbl\@@tbl][#1]}% + #2% + \let\setupTBLsection\relax} + +\let\pushTBL\relax +\let\popTBL \relax + +\chardef\TBLpass=0 + +\def\bTABLE% + {\dosingleempty\dobTABLE} + +\def\dobTABLE[#1]% + {\pushTBL + \vbox\bgroup + \localcolortrue + \getparameters + [\@@tbl\@@tbl] + [\c!uitlijnen={\v!rechts,\v!ruim,\v!hoog},#1]% + \dontcomplain + \def\currentcol{0}% + \def\maximumrowspan{1}% + \let\maximumcol\currentcol + \let\maximumrow\currentcol + \def\bTR{\dodoubleempty\parseTR}% + \def\bTD{\dodoubleempty\parseTD}% + \def\bTH{\dodoubleempty\parseTH}% + \endgraf} + +\def\eTABLE% + {\the\TBLhead\the\TBLbody\the\TBLfoot\endgraf % tricky and dirty order -) + % finish cells + \dorecurse{\maximumrow} + {\let\row\recurselevel + \dorecurse{\maximumcol} + {\let\col\recurselevel \let\xxcol\col \let\xxrow\row + \doifnottbltag\row\col + {\let\xrow\row + \doloop + {\let\xcol\col + \doloop + {\doifelsetbltag\xrow\xcol + {\exitloop} + {\increment\xcol \relax + \ifnum\xcol>\maximumcol \exitloop \fi}}% + \doifelsetbltag\xrow\xcol + {\exitloop} + {\let\xxrow\xrow \let\xxcol\xcol \increment\xrow \relax + \ifnum\xrow>\maximumrow \exitloop \fi}}}% + \ifnum\xxrow>\maximumrow\let\xxrow\maximumrow\fi + \ifnum\xxcol>\maximumcol\let\xxcol\maximumcol\fi + \decrement(\xxrow,\row)\increment\xxrow + \decrement(\xxcol,\col)\increment\xxcol + \doifnottbltag\row\col + {\let\xrow\row + \dorecurse{\xxrow} + {\let\xcol\col \settblcol\xrow\xcol\xxcol + \dorecurse{\xxcol} + {\settbltag\xrow\xcol\tblnone \increment\xcol}% + \increment\xrow}% + \settbltag\row\col\tblcell + \settblcol\row\col\xxcol + \settblrow\row\col\xxrow + \ifautoTBLemptycell + \edef\celltag{{\row}{\col}}% + \@EA\settbltxt\@EA\row\@EA\col\@EA + {\@EA\handleTBLcell\celltag[]{\strut}}% + \fi}}}% + % to be sure + \dorecurse{\maximumrow} + {\let\row\recurselevel + \dorecurse{\maximumcol} + {\let\col\recurselevel + \doiftblrow\row\col + {\scratchcounter=\maximumrow + \advance\scratchcounter by -\row + \advance\scratchcounter by 1 + \ifnum\gettblrow\row\col>\scratchcounter + \settblrow\row\col{\the\scratchcounter}% + \fi}% + \settblht\row\col\!!zeropoint + \settblwd\row\col\!!zeropoint + \doifnottblcol\row\col{\settblcol\row\col0}% + \doifnottbltag\row\col{\settbltag\row\col\tblnone}}}% + % check and do + \begTBL + \dorecurse{\maximumrow} + {\bTBL + \let\row\recurselevel + \dorecurse{\maximumcol} + {\let\col\recurselevel + \expanded{\doTBL{\row}{\col}}}% + \eTBL}% + \endTBL + \egroup + \popTBL} + +\def\spanTBL#1#2% + {\scratchcounter=\gettblcol{#1}{#2}\relax + \ifnum\scratchcounter>0 + \advance\scratchcounter by -1 + \dorecurse{\scratchcounter}{\appendtoks\spantblcol\to\tbltoks}% + \dorecurse{\scratchcounter} + {\appendtoks + \skiptblcol + \to\tbltoks}% + \appendtoks + \nexttblcol + \to\tbltoks + \fi} + +\def\bTBL% + {\appendtoks + \begintblrow + \to\tbltoks} + +\def\eTBL% + {\appendtoks + \endtblrow + \to\tbltoks} + +% We use aligments to handle the empty (skipped) columns, so +% that we don't have to (re|)|calculate these. + +\def\skiptblcol% + {\doglobal\increment\colTBL} + +\def\nexttblcol% + {\doglobal\increment\colTBL&} + +\def\spantblcol% + {\span} + +\def\begintblrow% + {\noalign + {\doglobal\increment\rowTBL + \doglobal\newcounter\colTBL}% + \nexttblcol} + +\def\endtblrow% + {\crcr\noalign{\nointerlineskip}} + +\def\begintbl% + {\doglobal\newcounter\colTBL + \doglobal\newcounter\rowTBL + \doglobal\decrement\rowTBL + \tabskip\!!zeropoint + \halign\bgroup\ignorespaces##\unskip&&\ignorespaces##\unskip\cr} + +\def\endtbl% + {\egroup} + +\setvalue{\tblnone TBL}#1#2% + {\spanTBL{#1}{#2}} + +\setvalue{\tblcell TBL}#1#2% + {\appendtoks + \makeTBL{#1}{#2}% % append nog isoleren + \to\tbltoks + \spanTBL{#1}{#2}} + +\def\doTBL#1#2% + {\getvalue{\gettbltag{#1}{#2}TBL}{#1}{#2}} + +\def\begTBL% + {\doglobal\newcounter\rowTBL + \doglobal\newcounter\colTBL + \chardef\TBLpass=0 + \tbltoks\emptytoks + \appendtoks + \begintbl + \to\tbltoks} + +\def\endTBL% + {\appendtoks + \endtbl + \to\tbltoks + \setbox\scratchbox=\hbox + {\localframed + [\@@tbl\@@tbl] + [\c!kader=\v!uit,\c!achtergrond=,\c!uitlijnen=\v!nee] + {\strut}}% + \edef\minimalcellheight{\the\ht\scratchbox}% + \dorecurse{\maximumcol} + {\settblaut\recurselevel\!!zeropoint +% new +\let\xcol\recurselevel +\dorecurse{\maximumrow} + {\settblwd \recurselevel\xcol\!!zeropoint + \settblht \recurselevel\xcol\!!zeropoint}% +% till here + \settblwid\recurselevel\!!zeropoint}% + \dorecurse{\maximumrow} + {\settblhei\recurselevel\maxdimen}% + \chardef\TBLpass=1 + \let\handleTBLcell\dohandleTBLcellA + \def\makeTBL##1##2% + {\gettbltxt{##1}{##2}}% + \def\inTBLcell##1##2% + {\ExpandBothAfter\doifinsetelse{\localwidth}{\v!passend,\v!ruim} % user set + {} + {\scratchdimen=\gettblaut\colTBL\relax + \ifdim\localwidth>\scratchdimen + \settblaut\colTBL\localwidth + \fi}}% + \setbox0=\vbox{\the\tbltoks}% +%\ifautoTBLspread +%\else + \ifdim\wd0>\hsize + \ifautoTBLhsize + \checktblwidthsone % trial run + \checktblwidthstwo % real run + \let\handleTBLcell\dohandleTBLcellB + \setbox\scratchbox=\vbox{\the\tbltoks}% + \fi + \else\ifautoTBLrowspan\ifnum\maximumrowspan>1 % max ? + \let\handleTBLcell\dohandleTBLcellC + \setbox\scratchbox=\vbox{\the\tbltoks}% + \fi\fi\fi +%\fi + \let\handleTBLcell\dohandleTBLcellD + \chardef\TBLpass=2 + \def\makeTBL##1##2% meer in cellD + {\dimen2=\!!zeropoint + \pushmacro\colTBL + \dorecurse{\gettblcol{##1}{##2}} + {\advance\dimen2 by \gettblwid\colTBL + \increment\colTBL}% + \edef\widthTBL{\the\dimen2}% + \popmacro\colTBL + \setbox\scratchbox=\hbox{\gettbltxt{##1}{##2}}% + \settblht{##1}{##2}{\the\ht\scratchbox}% + \settblwd{##1}{##2}{\the\wd\scratchbox}% + \ifdim\ht\scratchbox>\gettblhei{##1}\relax + \settblhei{##1}{\the\ht\scratchbox}% + \fi}% + \setbox\scratchbox=\vbox{\the\tbltoks}% + \checktblheightsone + \checktblheightstwo + \let\handleTBLcell\dohandleTBLcellE + \chardef\TBLpass=3 + \def\makeTBL##1##2% + {% height + \pushmacro\rowTBL + \scratchdimen=\!!zeropoint + \def\rowTBL{##1}% + \ifnum\gettblcol{##1}{##2}=\maximumcol\relax + % case: nc=maxcolumns + \else + \dorecurse{\gettblrow{##1}{##2}} + {\advance\scratchdimen by \gettblhei\rowTBL + \increment\rowTBL}% + \ifdim\scratchdimen<\gettblht{##1}{##2}\relax + \scratchdimen=\gettblht{##1}{##2}\relax + \fi + \fi + \edef\heightTBL{\the\scratchdimen}% + \popmacro\rowTBL + % width + \pushmacro\colTBL + \scratchdimen=\!!zeropoint + \dorecurse{\gettblcol{##1}{##2}} + {\advance\scratchdimen by \gettblwid\colTBL + \increment\colTBL}% + \edef\widthTBL{\the\scratchdimen}% + \popmacro\colTBL + % cell + \setbox\scratchbox=\hbox{\gettbltxt{##1}{##2}}% + \ifnum\gettblcol{##1}{##2}=\maximumcol\relax + % case: nc=maxcolumns + \else + \scratchdimen=\gettblhei{##1}% + \setbox\scratchbox=\hbox + {\lower\ht\scratchbox\hbox{\raise\scratchdimen\box\scratchbox}}% + \ht\scratchbox=\scratchdimen + \fi + \dp\scratchbox=\!!zeropoint + \box\scratchbox}% + \iftraceTABLE\showtbltoks\fi + \vbox{\the\tbltoks}} + +\def\checktblwidthsone{\dochecktblwidths0} % 0 = trial run +\def\checktblwidthstwo{\dochecktblwidths1} % 1 = real run + +\def\dochecktblwidths#1% + {\iftraceTABLE\showtblwids{B#1}\fi + \!!dimena=\hsize + \!!counta=0 + \dorecurse{\maximumcol} + {\scratchdimen=\gettblaut\recurselevel\relax + \ifdim\scratchdimen>\!!zeropoint\relax + \advance\!!dimena by -\scratchdimen + \else + \scratchdimen=\gettblwid\recurselevel\relax + \ifdim\scratchdimen>\tbltblmaxbreedte\relax + \ifcase#1\else\settblwid\recurselevel\!!zeropoint\fi + \advance\!!counta by 1 + \else + \ifdim\scratchdimen>\!!zeropoint\relax + \advance\!!dimena by -\scratchdimen + \else + % eigenlijk moet dit alleen als de kolom wordt overspannen door een + % vorige, maw extra dubbele loop en status var + \advance\!!counta by 1 + \fi + \fi + \fi}% + \ifcase\!!counta \else \divide\!!dimena by \!!counta \fi + \dorecurse{\maximumcol} + {\scratchdimen=\gettblwid\recurselevel\relax + \ifcase#1 + \ifdim\scratchdimen<\!!dimena % take natural width + \settblaut\recurselevel{\the\scratchdimen}% + \fi + \else + \ifdim\scratchdimen=\!!zeropoint\relax % auto set width + \settblwid\recurselevel{\the\!!dimena}% + \fi + \fi}% + \iftraceTABLE\showtblwids{E#1}\fi} + +% \def\checktblwidthsXXX% +% {\!!dimena=\hsize +% \!!counta=0 +% \dorecurse{\maximumcol} +% {\scratchdimen=\gettblaut\recurselevel\relax +% \ifdim\scratchdimen>\!!zeropoint\relax +% \advance\!!dimena by -\scratchdimen +% \else +% \advance\!!counta by 1 +% \fi}% +% \ifcase\!!counta \else \divide\!!dimena by \!!counta \fi +% \dorecurse{\maximumcol} +% {\scratchdimen=\gettblaut\recurselevel\relax +% \ifdim\scratchdimen=\!!zeropoint\relax +% \settblaut\recurselevel{\the\!!dimena}% +% \fi +% \settblwid\recurselevel{\the\!!dimena}% +% }} + +\def\checktblheightsone% + {\dorecurse{\maximumrow} + {\let\xrowTBL\recurselevel + \dorecurse{\maximumcol} + {\let\xcolTBL\recurselevel + \count0=0\gettblrow\xrowTBL\xcolTBL\relax + % check row span + \ifnum\count0>1 + % current height in row + \dimen0=\gettblht\xrowTBL\xcolTBL + % find nearest height in row + \dimen2=\!!zeropoint + \dorecurse{\maximumcol} + {\ifnum\recurselevel=\xcolTBL\else + \count2=0\gettblrow\xrowTBL\recurselevel\relax + \ifnum\count2=1 + \dimen4=\gettblht\xrowTBL\recurselevel\relax + \ifdim\dimen2<\dimen4 + \dimen2=\dimen4 + \fi + \fi + \fi}% + \let\xxrowTBL\xrowTBL + % calculate cummulative height + \dimen4=\dimen2 + \dorecurse{\count0} + {\ifnum\xxrowTBL=\xrowTBL\else + \advance\dimen4 by \gettblhei\xxrowTBL + \fi + \increment\xxrowTBL}% + % distribute overshoot equally + \ifdim\dimen4<\dimen0 + \advance\dimen0 by -\dimen4 + \divide\dimen0 by \count0 + \let\xxrowTBL\xrowTBL + \settblhei\xrowTBL{\the\dimen2}% + \dorecurse{\count0} + {\dorecurse{\maximumcol} + {\ifnum\recurselevel=\xcolTBL\else + \scratchdimen=\gettblht\xxrowTBL\recurselevel + \advance\scratchdimen by \dimen0 + \settblht\xxrowTBL\recurselevel{\the\scratchdimen}% + \ifdim\gettblhei\xxrowTBL<\scratchdimen + \settblhei\xxrowTBL{\the\scratchdimen}% + \fi + \fi}% + \increment\xxrowTBL}% + \else\ifdim\dimen4>\dimen0 + \settblhei\xrowTBL{\the\dimen2}% + \fi\fi + \fi}}} + +\def\checktblheightstwo% + {} + +\def\showtblwids#1% + {\vbox + {\forgetall\tttf + [#1]\dorecurse{\maximumcol}{[\recurselevel:\gettblwid\recurselevel]}}} + +\def\showtbltoks% + {\vbox + {\forgetall\tttf + \let\begintbl \relax \let\endtbl \relax + \let\begintblrow\par \let\endtblrow \par + \def\nexttblcol {[next]}\def\spantblcol{[span]} + \def\makeTBL##1##2{[##1,##2]} + \the\tbltoks}} + +\def\TBLcharalign% + {\doifelse{\tbltblkarakteruitlijnen}{\v!ja} + {\let\next\doTBLcharalign} + {\let\next\gobbleoneargument}% + \next} + +\long\def\doTBLcharalign#1#2% column data + {\edef\alignmentclass{#1}% + \edef\alignmentcharacter{\tbltbluitlijnkarakter}% + \ifcase\TBLpass\or + \setfirstpasscharacteralign\checkalignment{\strut#2\unskip}% + \fi % force hsize, so always a second + \setsecondpasscharacteralign\checkalignment{\strut#2\unskip}% + \ignorespaces} + +\long\def\dohandleTBLcellA#1#2[#3]#4% + {\setbox\scratchbox=\hbox + {\setupTBLcell{#1}{#2}% + \localframed + [\@@tbl\@@tbl] + [#3,\c!achtergrond=,\c!kader=\v!uit]% 25% faster + {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{##1}{##2}}}% + \scratchdimen=\gettblwid\colTBL\relax + \ifdim\wd\scratchbox>\scratchdimen + \settblwid\colTBL{\the\wd\scratchbox}% auto set + \fi + \let\rowTBLx\rowTBL\increment\rowTBLx + \scratchdimen=\gettblhei\rowTBLx\relax + \ifdim\ht\scratchbox<\scratchdimen + \settblhei\rowTBLx{\the\ht\scratchbox}% auto set + \fi + \settblht{#1}{#2}{\the\ht\scratchbox}% + \settblwd{#1}{#2}{\the\wd\scratchbox}% + \ifdim\wd\scratchbox<.75\hsize + \ifdim\ht\scratchbox>2\openlineheight % honor width since this can be a + \scratchdimen=\gettblaut\colTBL\relax % figure or so + \ifdim\wd\scratchbox>\scratchdimen + \settblaut\colTBL{\the\wd\scratchbox}% + %\message{[forcing width of \colTBL\space(\the\wd\scratchbox/\the\hsize)]}% + \fi + \fi + \fi + \setbox2=\null + \wd2=\wd\scratchbox \ht2=\ht\scratchbox \dp2=\dp\scratchbox + \box2} + +\long\def\dohandleTBLcellBC#1#2#3[#4]#5% + {\setbox\scratchbox=\hbox + {\setupTBLcell{#2}{#3}% + \localframed + [\@@tbl\@@tbl] + [#4,#1,\c!kader=\v!uit,\c!achtergrond=] + {\bTBLCELL#5\eTBLCELL}}% + \setbox2=\null + \wd2=\wd\scratchbox \ht2=\ht\scratchbox \dp2=\dp\scratchbox + \ifautoTBLrowspan + \let\rowTBLx\rowTBL\increment\rowTBLx + \scratchdimen=\gettblhei\rowTBLx\relax + \ifnum\gettblrow\rowTBLx\colTBL>1 \ifdim\ht\scratchbox>\scratchdimen + \scratchdimen=-\scratchdimen \advance\scratchdimen by -\ht\scratchbox + \ht2=\scratchdimen + \fi \fi + \fi + \box2 } + +\long\def\dohandleTBLcellB#1#2[#3]#4% + {\scratchdimen=\gettblaut\colTBL\relax + \ifdim\scratchdimen>\!!zeropoint\relax + \let\tblwidthkey\c!breedte \edef\tblwidth{\the\scratchdimen}% + \else + \scratchdimen=\gettblwid\colTBL\relax + \ifdim\scratchdimen>\!!zeropoint\relax + \ifnum\gettblcol{#1}{#2}=\maximumcol\relax + \scratchdimen=\hsize + \fi + \let\tblwidthkey\c!breedte \edef\tblwidth{\the\scratchdimen}% + \else + \let\tblwidthkey\s!unknown \let \tblwidth \!!zeropoint + \fi + \fi + \dohandleTBLcellBC{\tblwidthkey=\tblwidth}{#1}{#2}[#3]{\TBLcharalign{#2}{#4}}} + +\long\def\dohandleTBLcellC% + {\dohandleTBLcellBC{}} + +\long\def\dohandleTBLcellD#1#2[#3]#4% + {\setupTBLcell{#1}{#2}% + \localframed + [\@@tbl\@@tbl] + [#3,\c!breedte=\widthTBL, + \c!achtergrond=,\c!kader=\v!uit]% 25% faster + {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}} + +\long\def\dohandleTBLcellE#1#2[#3]#4% + {\setupTBLcell{#1}{#2}% + \getparameters[\@@tbl\@@tbl][#3]% to get the color right, the way we + \color % handle color here prevents interference due to whatsit nodes + [\tbltblkleur] % as well as permits local colors to take precedence + {\ifdim\heightTBL=\!!zeropoint\relax % case: nc=maxcolumns + \localframed + [\@@tbl\@@tbl] + [\c!kleur=,\c!breedte=\widthTBL] + {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}% + \else + \localframed + [\@@tbl\@@tbl] + [\c!kleur=,\c!breedte=\widthTBL,\c!hoogte=\heightTBL] + {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}% + \fi}} + +\setupTABLE + [\c!kaderoffset=.5\linewidth, + \c!achtergrondoffset=\v!kader, + \c!kaderkleur=black, + \c!kleur=, + \c!letter=, +\c!kopletter=\v!vet, +\c!kopkleur=, + \c!strut=\v!nee, + \c!karakteruitlijnen=\v!nee, + \c!uitlijnkarakter={,}, + \c!maxbreedte=8em] + +%D We have already prepared the previous macros for nesting, +%D so we only have to pop in the right ones: + +%D Redefined: + +\newcounter\TBLlevel + +\def\@@tblprefix{\@@tbl:\ifnum\TBLlevel>1 \TBLlevel:\fi} + +\long\def\settbltxt#1#2#3% + {\setxvalue{\@@tblprefix#1:#2:l}{\TBLlevel}% + \long\setvalue{\@@tblprefix#1:#2:t}% + {\doifdefined{\@@tblprefix#1:#2:l} + {\edef\TBLlevel{\getvalue{\@@tblprefix#1:#2:l}}}% + #3}} + +\def\gettbltxt#1#2% + {\getvalue{\@@tblprefix#1:#2:t}} + +%D New: + +\def\pushTBLparameters% + {\pushmacro\TBLlevel + \ifcase\TBLpass + % we're just after \bTABLE + \else\ifnum\TBLlevel>0 + \doglobal\increment\TBLlevel\relax + \fi\fi} + +\def\popTBLparameters% + {\popmacro\TBLlevel} + +\def\pushTBL% + {\ifnum\TBLlevel=0 + \doglobal\increment\currenttbl\relax + \fi + \doglobal\increment\TBLlevel\relax + \ifnum\TBLlevel>1 + \resetallTABLEparameters + \pushmacro\colTBL + \pushmacro\rowTBL + \else + \global\intabletrue + \fi} + +\def\popTBL% + {\ifnum\TBLlevel>1 + \popmacro\rowTBL + \popmacro\colTBL + \else + \global\intablefalse + \fi + \doglobal\decrement\TBLlevel\relax} + +\chardef\resetTABLEmode=0 + +\def\resetallTABLEparameters% moet genest wel werken + {\ifnum\TBLlevel>1 % in ieder geval + \ifcase\resetTABLEmode + \presetlocalframed % breedte hoogte diepte offset + [\@@tbl\@@tbl]% % achtergrond, achtergrondraster, achtergrondkleur + % not ok yet + \setupTABLE + [\c!kaderoffset=.5\linewidth, + \c!achtergrondoffset=\v!kader, + \c!kaderkleur=black, + \c!kleur=, + \c!letter=, +\c!kopletter=, +\c!kopkleur=, + \c!strut=\v!nee, + \c!karakteruitlijnen=\v!nee, + \c!uitlijnkarakter={,}, + \c!maxbreedte=8em]% + \else + \setupTABLE + [\c!breedte=\v!passend, + \c!hoogte=\v!passend]% + \fi + \fi} + +\protect \endinput diff --git a/tex/context/base/core-obj.tex b/tex/context/base/core-obj.tex index 8c6d0e079..d44235a22 100644 --- a/tex/context/base/core-obj.tex +++ b/tex/context/base/core-obj.tex @@ -35,6 +35,16 @@ 31: duplicitni object -- \stopmessages +\startmessages italian library: references + 30: oggetto sconosciuto -- + 31: oggetto duplicato -- +\stopmessages + +\startmessages norwegian library: references + 30: ukjent objekt -- + 31: duplikat objekt -- +\stopmessages + %D \macros %D {setobject,getobject,ifinobject} %D diff --git a/tex/context/base/core-pag.tex b/tex/context/base/core-pag.tex index 6ed2f3475..8a175b972 100644 --- a/tex/context/base/core-pag.tex +++ b/tex/context/base/core-pag.tex @@ -124,7 +124,7 @@ \fi \fi} -% cleaner, but unchecked +% cleaner, but unchecked, and incomplete % % \def\dostelarrangereninXY#1#2#3#4#5#6#7#8% % {\global\chardef\arrangedpageX =#1% diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex new file mode 100644 index 000000000..761acf08d --- /dev/null +++ b/tex/context/base/core-pos.tex @@ -0,0 +1,1088 @@ +%D \module +%D [ file=core-pos, +%D version=1999.08.01, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Positioning Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{Context Positioning Support} + +%D Although \TEX\ has a rather powerful channel to the outside +%D world, called \type {\special}, real communication with +%D other programs is complicated by the fact that no positional +%D information is available. Mid 1999, I discussed this with +%D \THANH, the author of \PDFTEX, and after some experiments, +%D \PDFTEX\ was extended with a simple but effective mechanism, +%D that provided positional information. The interesting +%D thought is that, although \TEX\ is frozen, similar +%D functionality could have been achieved with \type +%D {\specials} and an additional \DVI\ postprocessor. +%D +%D Since we want to be as compatible as can be, \CONTEXT\ will +%D support both methods, although the development is primarily +%D driven by the \PDFTEX\ way of doing things. Since the +%D mechanism is basically not limited to one application, for +%D the moment we stick to building the functionality around one +%D \CONTEXT\ special command, but at the same time we keep our +%D eyes open for extensions in other directions. +%D +%D A question that may arise when one reads this module, is to +%D what extend these macros are generic, in the sense that they +%D could be collected in a support module instead of a core +%D module. Since the mechanism described here will closely +%D cooperate with the \METAPOST\ support built in \CONTEXT, +%D which in turn will be tightly integrated with the \CONTEXT\ +%D overlay mechanisms, I decided to write a core module instead +%D of a support one. This makes even more sense, when one takes +%D into account that this kind of support depends on special +%D drivers. + +\unprotect + +%D The first application of positional information was embedded +%D graphics. Since we are interacting with text, it made sense +%D to take the current line height and depth into account too. +%D This is why we have two basic position macros: one for +%D simple positions, and one for boxes. +%D +%D We could have sticked to one special, and actually did so in +%D earlier experiments, but for convenience, as well for +%D clearness, we now have two alternatives. This approach will +%D save us quite some bytes when storing large quantities of +%D positional information. We save as less information as +%D needed, that is, we save no dimensions, in a \METAPOST\ +%D friendly way. +%D +%D The three specials involved are: +%D +%D \starttypen +%D \dosetposition {identifier} +%D \dosetpositionwhd {identifier} {width} {height} {depth} +%D \dosetpositionpapersize {width} {height} +%D \stoptypen +%D +%D Either directly, when using \PDFTEX, or by means of a +%D postprocessor, when using \DVI\ output, these end up in the +%D utility file as: +%D +%D \starttypen +%D \pospxy {identifier} {page} {x} {y} +%D \pospxywhd {identifier} {page} {x} {y} {w} {h} {d} +%D \stoptypen +%D +%D This means that we have to provide both a utility set and +%D reset macro for positions. + +\def\POSprefix{POS::} + +\def\pxypos {\pospxy} +\def\pxyposwhd{\pospxywhd} + +\def\resetpositions% + {\let\pospxy =\gobblefourarguments + \let\pospxywhd=\gobblesevenarguments} + +\resetpositions + +\def\setpositions% + {\def\pospxy##1##2##3##4% + {\dosetpositionnm\@@posp{##2}% + \dosetpositionpt\@@posx{##3}% + \dosetpositionpt\@@posy{##4}% + \setxvalue{\POSprefix##1}{\@@posp,\@@posx,\@@posy}}% + \def\pospxywhd##1##2##3##4##5##6##7% + {\dosetpositionnm\@@posp{##2}% + \dosetpositionpt\@@posx{##3}% + \dosetpositionpt\@@posy{##4}% + \dosetpositionpt\@@posw{##5}% + \dosetpositionpt\@@posh{##6}% + \dosetpositionpt\@@posd{##7}% + \setxvalue{\POSprefix##1}{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}}} + +%D For postprocessing purposes, we save the number of +%D positions. + +\newcounter\currentpositions % current number of positions +\newcounter\totalnofpositions % total from previous run + +\prependtoks + \savecurrentvalue\totalnofpositions\currentpositions +\to \everybye % \everylastshipout + +%D We save positionional information without dimensions, which +%D saves some bytes. The conversion too saves some bytes, but +%D is primarily needed because we want to pass those values to +%D \METAPOST\ too. + +\def\dosetpositionpt#1#2% + {\scratchdimen=#2sp\xdef#1{\@EA\withoutpt\the\scratchdimen}} + +\def\dosetpositionnm#1#2% + {\xdef#1{\number#2}} + +\def\checkpositions% + {\bgroup + \setbox0=\hbox{\doutilities{positions}{\jobname}{}{}{}}% + \global\let\checkpositions=\relax + \egroup} + +%D Since the positional values are to be fully expandable, we +%D need to preload them as soon as possible, which is why we +%D load the data when we start a text. + +\appendtoks \checkpositions \to \everystarttext + +%D \macros +%D {MPp, MPx, MPy, MPw, MPh, MPd, +%D MPxy, MPll, MPlr, MPur, MPul, MPpos} +%D +%D Access to the positional information is provided by macros +%D with short names that are clearly meant for \METAPOST. + +\def\MPp {\doMPxyhdwlr\doMPp } +\def\MPx {\doMPxyhdwlr\doMPx } +\def\MPy {\doMPxyhdwlr\doMPy } +\def\MPw {\doMPxyhdwlr\doMPw } +\def\MPh {\doMPxyhdwlr\doMPh } +\def\MPd {\doMPxyhdwlr\doMPd } +\def\MPxy {\doMPxyhdwlr\doMPxy } +\def\MPll {\doMPxyhdwlr\doMPll } +\def\MPlr {\doMPxyhdwlr\doMPlr } +\def\MPur {\doMPxyhdwlr\doMPur } +\def\MPul {\doMPxyhdwlr\doMPul } +\def\MPpos{\doMPxyhdwlr\doMPpos} + +%D So \type {\MPx{identifier}} returns a position, specified +%D in points. When unknown, \type {0pt} is returned. From the +%D next definitions, we can see that some positions are +%D expressions. + +\def\doMPp #1,#2,#3,#4,#5,#6,#7\relax{#1} +\def\doMPx #1,#2,#3,#4,#5,#6,#7\relax{#2pt} +\def\doMPy #1,#2,#3,#4,#5,#6,#7\relax{#3pt} +\def\doMPw #1,#2,#3,#4,#5,#6,#7\relax{#4pt} +\def\doMPh #1,#2,#3,#4,#5,#6,#7\relax{#5pt} +\def\doMPd #1,#2,#3,#4,#5,#6,#7\relax{#6pt} +\def\doMPxy #1,#2,#3,#4,#5,#6,#7\relax{(#2pt,#3pt)} +\def\doMPll #1,#2,#3,#4,#5,#6,#7\relax{(#2pt,#3pt-#6pt)} +\def\doMPlr #1,#2,#3,#4,#5,#6,#7\relax{(#2pt+#4pt,#3pt-#6pt)} +\def\doMPur #1,#2,#3,#4,#5,#6,#7\relax{(#2pt+#4pt,#3pt+#5pt)} +\def\doMPul #1,#2,#3,#4,#5,#6,#7\relax{(#2pt,#3pt+#5pt)} +\def\doMPpos#1,#2,#3,#4,#5,#6,#7\relax{#1,#2pt,#3pt,#4pt,#5pt,#6pt} + +%D As said, we will default to zero (dimensions) when a +%D position is unknown. + +\def\doMPxyhdwlr#1#2% + {\ifundefined{\POSprefix#2}% + #10,0,0,0,0,0,0\relax + \else + \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,0,0,0,0\relax + \fi} + +%D \macros +%D {MPanchor} +%D +%D For readability we define a few synonyms: + +\let\MPanchor\MPpos + +%D \macros +%D {POSp, POSx, POSy, POSh, POSd, POSw} +%D +%D and: + +\let\POSp\MPp \let\POSx\MPx \let\POSy\MPy +\let\POSh\MPh \let\POSd\MPd \let\POSw\MPw + +\newbox\positionbox +\newif\ifpositioning + +%D There are two low level positioning macros. Both store the +%D position as well as execute an action associated with that +%D position. + +\def\initializenextposition% + {\ifpositioning \else + \global\positioningtrue + \dosetpositionpapersize + {\number\printpapierbreedte} + {\number\printpapierhoogte }% + \fi + \doglobal\increment\currentpositions} + +\def\setposition#1% + {\initializenextposition + \dosetposition{#1}% + \dopositionaction{#1}} + +\def\setpositionbox#1% + {\dowithnextbox + {\hbox to \wd\nextbox + {\initializenextposition + \def\currentposition{#1}% + \dosetpositionwhd{#1} + {\number\wd\nextbox}{\number\ht\nextbox}{\number\dp\nextbox}% + \setbox\positionbox=\box\nextbox + \dopositionaction{#1}% + \box\positionbox + \hss}}} + +\let\currentposition\s!unknown + +%D A few more low level macros take care of defining and +%D recalling actions. We could save this information in the +%D position containers themselves, this would save hash +%D entries, but at the cost of much more time consuming +%D expansion. Actions are saved globally! + +\newtoks\everypositionaction + +\let\POSactionprefix\POSprefix + +\def\dosetpositionaction#1% + {\setgvalue{\POSactionprefix#1::}} + +\def\dopositionaction#1% test saves hash entry in etex + {\doifdefined{\POSactionprefix#1::}% + {\bgroup + \the\everypositionaction + \getvalue{\POSactionprefix#1::}% + \egroup}} + +\def\doifpositionaction#1% + {\doifdefined{\POSactionprefix#1::}} + +%D We can copy a position with: +%D +%D \starttypen +%D \copyposition {to} {from} +%D \stoptypen +%D +%D Again, this is a global action. + +\def\copyposition#1#2% + {\bgroup + \edef\to {\POSprefix#1}% + \edef\from{\POSprefix#2}% + \doifdefined\from + {\global\@EA\@EA\@EA\let\@EA\csname\@EA\to\@EA\endcsname\csname\from\endcsname}% + \egroup} + +%D The fact that handling positions is a two pass operation, is +%D one of the reasons why we need to be able to test for +%D existence, using: +%D +%D \starttypen +%D \doifpositionelse {identifier} {found action} {not found action} +%D \stoptypen + +\def\doifpositionelse#1% + {\doifdefinedelse{\POSprefix#1}} + +%D We have now arrived at a few macros that would make sense as +%D support macros, but ended up in the core. + +%D \macros +%D {xypos} +%D +%D We have several macros available to save positions. Later +%D we will see applications. +%D +%D \starttabulatie[|l|l||] +%D \NC \type {\xypos} \NC \NC simple position with no dimensions \NC \NR +%D \NC \type {\hpos} \NC \NC position and characteristics of a \type {\hbox} \NC \NR +%D \NC \type {\vpos} \NC \NC position and characteristics of a \type {\vbox} \NC \NR +%D \NC \type {\lpos} \NC l: \NC left edge of a line \NC \NR +%D \NC \type {\rpos} \NC r: \NC right edge of a line \NC \NR +%D \NC \type {\bpos} \NC b: \NC begin point in a line \NC \NR +%D \NC \type {\epos} \NC e: \NC end point in a line \NC \NR +%D \NC \type {\fpos} \NC f: \NC begin point in a paragraph \NC \NR +%D \NC \type {\tpos} \NC t: \NC end point in a paragraph \NC \NR +%D \stoptabulatie +%D +%D Each macro takes an identifier as argument, and the \type +%D {\hpos} and \type {\vpos} also expect box content. + +\def\xypos{\initializenextposition\dosetposition} + +\def\hpos#1{\dontleavehmode\setpositionbox{#1}\hbox} +\def\vpos#1{\setpositionbox{#1}\vbox} + +\def\lpos#1{\lrpos{l:#1}{\kern\leftskip}} +\def\rpos#1{\lrpos{r:#1}{\hskip\hsize\hskip-\rightskip}} + +\def\bpos#1{\hpos{b:#1}{\strut}\ignorespaces} +\def\epos#1{\ifhmode\unskip\fi\hpos{e:#1}{\strut}} + +\def\fpos#1{\lpos{#1}\rpos{#1}\bpos{#1}} +\def\tpos#1{\epos{#1}} + +%D The macros \type {\lpos} and \type {\rpos} share some code. + +\def\lrpos#1#2% + {\dontleavehmode\vadjust + {\setbox0=\hbox{\raise\dp\strutbox\hbox{\hpos{#1}{\strut}}}% + \smashbox0 + \rlap{#2\box0}}} + +%D \macros +%D {doifoverlappingelse} +%D +%D A first application of positional information, is to +%D determine if two boxes do overlap: +%D +%D \starttypen +%D \doifoverlappingelse{point a}{point b} +%D {action when overlapping} +%D {action when not overlapping} +%D \stoptypen + +\def\doifoverlappingelse#1#2#3#4% + {\ifnum\MPp{#1}=\MPp{#2}\relax + \bgroup + \donefalse + \def\check##1##2% + {\ifdone\else + \ifdim\dimen1##1<\dimen0 \else \ifdim\dimen1##1>\dimen2 \else + \ifdim\dimen1##2<\dimen4 \else \ifdim\dimen1##2>\dimen6 \else + \donetrue + \fi\fi + \fi\fi + \fi}% + \dimen 0=\MPx{#1}% + \dimen 2=\MPx{#1}\advance\dimen 2 by \MPw{#1}% + \dimen 4=\MPy{#1}\advance\dimen 4 by -\MPd{#1}% + \dimen 6=\MPy{#1}\advance\dimen 6 by \MPh{#1}% + \dimen10=\MPx{#2}% + \dimen12=\MPx{#2}\advance\dimen12 by \MPw{#2}% + \dimen14=\MPy{#2}\advance\dimen14 by -\MPd{#2}% + \dimen16=\MPy{#2}\advance\dimen16 by \MPh{#2}% + %\message{\the\dimen 0-\the\dimen 2,\the\dimen 4-\the\dimen 6}\wait + %\message{\the\dimen10-\the\dimen12,\the\dimen14-\the\dimen16}\wait + \check04\check24\check26\check06\ifdone\egroup#3\else\egroup#4\fi + \else + #4% + \fi} + +%D \macros +%D {doifpositionsonsamepageelse, +%D doifpositionsonthispageelse} +%D +%D Instead of letting the user handle fuzzy expansion, we +%D provide a simple test on positione being on the same page. +%D +%D \starttypen +%D \doifpositionsonsamepageelse{point a}{point b} +%D {action when on same page} +%D {action when not on same page} +%D \doifpositionsonthispageelse{point a}{point b} +%D {action when on this page} +%D {action when not on this page} +%D \stoptypen + +\def\doifpositionsonsamepageelse#1#2#3#4% + {\bgroup + \scratchcounter=#1\donefalse + \def\docommando##1% + {\ifcase\scratchcounter + \scratchcounter=\MPp{##1}\donetrue + \else + \ifnum\scratchcounter=\MPp{##1}\relax\else\donefalse\fi + \fi}% + \rawprocesscommalist[#2]\docommando + \ifdone\egroup#3\else\egroup#4\fi} + +\def\doifpositionsonsamepageelse% + {\doifpositionsonsamepageelse{0}} + +\def\doifpositionsonthispageelse#1#2#3% + {\doifpositionsonsamepageelse\realfolio} + +%D Before we come to graphics support, we have to make sure of +%D the reference point on the page. The next macro does so and +%D is hooked into the page building routine. + +\def\placepositionanchors% + {\ifpositioning + \vbox to \teksthoogte + {\hpos{head:\realfolio}{\hskip\tekstbreedte} + \vfill + \hpos{tail:\realfolio}{\hskip\tekstbreedte}} + \else + \vskip\teksthoogte + \fi} + +%D \macros +%D {positionoverlay,startpositionoverlay} +%D +%D As long as we're dealing with graphics it makes much sense +%D to use the available overlay mechanism. For this purpose, we +%D define some dedicated overlay extensions. +%D +%D \startbuffer[sample] +%D \defineoverlay [sample] [\positionoverlay{sample}] +%D +%D \startpositionoverlay{sample} +%D \setMPpositiongraphic{A-1}{connectcenter}{from=A-1m,to=A-2} +%D \stoppositionoverlay +%D \stopbuffer +%D +%D \typebuffer[sample] +%D +%D \startbuffer[graphic] +%D \startMPpositiongraphic{connectcenter} +%D path pa, pb ; pair ca, cb ; +%D initialize_box(\MPvar{from}) ; pa := pxy ; ca := cxy ; +%D initialize_box(\MPvar{to}) ; pb := pxy ; cb := cxy ; +%D draw pa withcolor red ; +%D draw pb withcolor red ; +%D draw ca -- cb withcolor blue ; +%D anchor_box(\MPanchor{\MPvar{from}}) ; +%D \stopMPpositiongraphic +%D \stopbuffer +%D +%D We can best demonstrate this in an example, say: +%D +%D \startbuffer[text] +%D \omlijnd +%D [achtergrond=sample,uitlijnen=midden,breedte=7cm] +%D {We want to connect \hpos {A-1} {this} word with its +%D grammatical cousin \hpos {A-2} {that}.} +%D \stopbuffer +%D +%D \typebuffer[text] +%D +%D \startregelcorrectie +%D %\haalbuffer[graphic,sample,text] +%D \stopregelcorrectie +%D +%D The graphic is defined in the following way, using some +%D macros defined in an auxiliary \METAPOST\ module that is +%D preloaded. +%D +%D \typebuffer[graphic] + +\def\MPanchoridentifier{mp-anchor} +\def\MPoverlayposprefix{MO::} + +\long\def\defineMPpositiongraphic#1% + {\long\setvalue{\MPoverlayposprefix#1}} + +%D The rest of the definitions concerning such overlays may +%D look complicated, + +\let\currentpositionoverlay\empty + +%D Position actions are automatically executed when a position +%D is set. In the next macro, the definitions sort of prelude +%D this process. + +\def\positionoverlay#1% + {\ifpositioning + \vbox to \overlayheight + {\edef\MPanchor##1{\MPpos{#1::\MPanchoridentifier}}% + \def\dohandlepositionboxes##1##2##3% pos tag setups + {\ifnum\MPp{##1}=\realpageno\relax % extra saveguard / beter in \dodo + \dodohandlepositionboxes{##1}{##2}{##3}% + \fi}% + \def\dohandleMPpositiongraphic##1##2##3% pos tag setups + {\ifnum\MPp{##1}=\realpageno\relax % extra saveguard / beter in \dodo + \dodohandleMPpositiongraphic{##1}{##2}{##3}% + \fi}% + \hpos{#1::\MPanchoridentifier}{\hskip\overlaywidth}% + \vfill}% + \fi} + +\def\startpositionoverlay#1% + {\def\currentpositionoverlay{#1}} + +\def\stoppositionoverlay% + {\let\currentpositionoverlay\empty} + +\def\resetpositionoverlay#1% + {\dosetpositionaction{#1::\MPanchoridentifier::}{}} + +%D Here the complication has to do with collecting actions +%D for later execution. + +\def\handlepositionboxes#1#2#3% + {\bgroup + \ifx\currentpositionoverlay\empty + \edef\!!stringa{\POSactionprefix#2::}% + \else + \edef\!!stringa{\POSactionprefix\currentpositionoverlay::\MPanchoridentifier::}% + \fi + \let\dohandlepositionboxes\relax + \doifundefinedelse\!!stringa + {\let\!!stringb\empty} + {\edef\!!stringb{\getvalue\!!stringa}}% + \setxvalue\!!stringa + {\!!stringb\dohandlepositionboxes{#1}{#2}{#3}}% + \egroup} + +%D The indirectness enables us (as was demonstrated a few lines +%D ago) to redefine this macro but still use its functionality. + +\def\dodohandlepositionboxes#1#2#3% + {\doifdefined{\MPoverlayposprefix#1} + {\getvalue{\MPoverlayposprefix#1}{#1}{#2}{#3}}} + +\let\dohandlepositionboxes\dodohandlepositionboxes + +%D A position graphic is a normal (non||reused) \METAPOST\ +%D graphic, used immediately, with zero dimensions, so that a +%D sequence of them does not harm. + +\newbox\positiongraphicbox + +\def\setMPpositiongraphic% + {\dotriplegroupempty\dosetMPpositiongraphic} + +\def\dosetMPpositiongraphic#1#2#3% pos tag vars + {\ifx\currentpositionoverlay\empty + \dosetpositionaction{#1}{\MPpositiongraphic{#2}{#3}}% + \else % silly can be one + \handlepositiongraphics{#1}{#2}{#3}% + \fi} + +\def\handlepositiongraphics#1#2#3% combine with boxes + {\bgroup + \ifx\currentpositionoverlay\empty + \edef\!!stringa{\POSactionprefix#2::}% #2 ? + \else + \edef\!!stringa{\POSactionprefix\currentpositionoverlay::\MPanchoridentifier::}% + \fi + \let\dohandleMPpositiongraphic\relax + \doifundefinedelse\!!stringa + {\let\!!stringb\empty} + {\edef\!!stringb{\getvalue\!!stringa}}% + \setxvalue\!!stringa + {\!!stringb\dohandleMPpositiongraphic{#1}{#2}{#3}}% + \egroup} + +\def\dodohandleMPpositiongraphic#1#2#3% + {\def\currentposition{#1}\MPpositiongraphic{#2}{#3}} + +\let\dohandleMPpositiongraphic\dodohandleMPpositiongraphic + +\def\startMPpositiongraphic% id setups + {\dodoublegroupempty\dostartMPpositiongraphic} + +\long\def\dostartMPpositiongraphic#1#2#3\stopMPpositiongraphic% + {\long\setgvalue{MPG:#1}% tag list mpcode + {\useMPpositiongraphic{#1}{#2}{#3}}} + +\def\prepareMPpositionvariables% + {\doifundefined{\@@meta self}{\setvalue{\@@meta self}{\currentposition}}% + \doifundefined{\@@meta from}{\setvalue{\@@meta from}{\currentposition}}} + +\long\def\useMPpositiongraphic#1#2#3% + {\bgroup + \prepareMPvariables{#2}% + \prepareMPpositionvariables +% \startuseMPgraphic{MPG}#3\stopuseMPgraphic +% \getvalue{MP:MPG}% + \enableincludeMPgraphics + \startMPgraphic#3\stopMPgraphic + \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% + \deallocateMPslot\currentMPgraphic + \placeMPgraphic + \egroup} + +\def\MPpositiongraphic% + {\dodoublegroupempty\doMPpositiongraphic} + +\def\doMPpositiongraphic#1#2% tag setups + {\bgroup + \def\@@meta{#1:}% + \setupMPvariables[#2]% + \prepareMPpositionvariables + \MPshiftdrawingtrue + \def\doMPpositiongraphic##1##2{\getvalue{MPG:##1}}% temp hack + \setbox\positiongraphicbox=\hbox + {\doifdefinedelse{MPM:#1} % method + {\ignorespaces\getvalue{MPM:#1}\unskip} + {\getvalue{MPG:#1}}}% + \smashbox\positiongraphicbox + \box\positiongraphicbox + \egroup} + +\long\def\startMPpositionmethod#1#2\stopMPpositionmethod% + {\long\setgvalue{MPM:#1}{#2}} % todo: var list here + +%D The auxiliary \METAPOST\ macros are defined by default, +%D by saying: + +\appendtoks + if unknown context_core : input mp-core.mp ; fi ; +\to \MPinitializations + +%D Some of these macros are pretty clever but too complicated +%D to be nice. + +\setupMPvariables + [mpos:box] + [linecolor=blue, + linewidth=\linewidth, + backgroundcolor=lightgray] + +\startMPpositiongraphic{mpos:box}{backgroundcolor,linecolor} + initialize_box(\MPpos{\MPvar{self}}) ; + boxfillcolor := \MPvar{backgroundcolor} ; + boxlinecolor := \MPvar{linecolor} ; + draw_box ; + anchor_box(\MPanchor{\MPvar{self}}) ; +\stopMPpositiongraphic + +\setupMPvariables + [mpos:area] + [linecolor=blue, + linewidth=\linewidth, + backgroundcolor=lightgray] + +\startMPpositiongraphic{mpos:area}{backgroundcolor,linecolor} + initialize_area(\MPpos{b:\MPvar{self}},\MPpos{e:\MPvar{self}}) ; + boxfillcolor := \MPvar{backgroundcolor} ; + boxlinecolor := \MPvar{linecolor} ; + draw_area ; + anchor_area(\MPanchor{b:\MPvar{self}}) ; +\stopMPpositiongraphic + +\setupMPvariables + [mpos:par] + [linecolor=blue, + linewidth=\linewidth, + backgroundcolor=lightgray] + +\startMPpositionmethod{mpos:par} + \ifnum\MPp{b:\MPvar{self}}=\MPp{e:\MPvar{self}}\relax + \startMPpositiongraphic{mpos:par}{backgroundcolor,linecolor} + initialize_par(\MPpos{b:\MPvar{self}},\MPpos{l:\MPvar{self}}, + \MPpos{r:\MPvar{self}},\MPpos{e:\MPvar{self}}) ; + boxfillcolor := \MPvar{backgroundcolor} ; + boxlinecolor := \MPvar{linecolor} ; + draw_par ; + anchor_par(\MPanchor{b:\MPvar{self}}) ; + \stopMPpositiongraphic + \MPpositiongraphic{mpos:par}{}% + \else + \startMPpositiongraphic{mpos:par}{backgroundcolor,linecolor} + initialize_par(\MPpos{b:\MPvar{self}},\MPpos{l:\MPvar{self}}, + \MPpos{r:\MPvar{self}},\MPpos{tail:\realfolio}) ; + boxfillcolor := \MPvar{backgroundcolor} ; + boxlinecolor := \MPvar{linecolor} ; + draw_par ; + anchor_par(\MPanchor{b:\MPvar{self}}) ; + \stopMPpositiongraphic + \MPpositiongraphic{mpos:par}{}% + \advance\realpageno by 1 + \dosetpositionaction{head:\realfolio}% + {\copyposition{b:\MPvar{self}}{head:\realfolio}% + \doshowpositionpar{\MPvar{self}}}% + \fi +\stopMPpositionmethod + +% lelijk, aanpassen + +\setupMPvariables + [mpos:connect] + [linecolor=blue, + linewidth=\linewidth, + arrowcolor=red, + backgroundcolor=lightgray] + +\startMPpositiongraphic{mpos:connect}{linecolor,linewidth,arrowcolor} + path pa, pb ; pair ca, cb ; + initialize_box(\MPpos{\MPvar{from}}) ; pa := pxy ; ca := cxy ; + initialize_box(\MPpos{\MPvar{to}}) ; pb := pxy ; cb := cxy ; + drawoptions(withpen pencircle scaled \MPvar{linewidth}) ; + draw pa withcolor \MPvar{linecolor} ; + draw pb withcolor \MPvar{linecolor} ; + drawoptions(withpen pencircle scaled (3*\MPvar{linewidth})) ; + drawarrow ca -- cb withcolor \MPvar{arrowcolor} ; + anchor_box(\MPanchor{\MPvar{from}}) ; +\stopMPpositiongraphic + +%D \macros +%D {stackposdown, stackposup, stackposleft,stackposright} +%D +%D A non graphic example of the use of positioning, is to stack +%D text in for instance the margin. +%D +%D \stackposdown \inlinker {some text}The text \type {some text} +%D goes into the left margin, and \stackposdown \inlinker {some +%D more}\type {some more} as well. When they overlap, they +%D will not touch. +%D +%D Here we said \type {\stackposdown \inlinker{some text}}. Instead +%D of \stackposleft \inlinker {one}stacking \stackposleft \inlinker +%D {two}vertically, one can stack horizontally by \stackposleft +%D \inlinker {three}using \type {\stackposleft}. +%D +%D We can go in all four directions, using \type {\stackposdown}, +%D \type {\stackposup}, \type {\stackposleft} and \type +%D {\stackposright}. + +\def\stackposdistance{.5em} + +\newcounter\currentautopos + +\def\POSstackprefix{stack:} + +\def\dostackposbox#1#2% + {\dowithnextbox + {#2{\let\previousautopos\currentautopos + \doglobal\increment\currentautopos + \hpos{\POSstackprefix\currentautopos} + {\doifoverlappingelse{\POSstackprefix\currentautopos}{\POSstackprefix\previousautopos} + {#1} + {\box\nextbox}}}}% + \hbox} + +\def\stackposup {\dostackposbox{\raise\lineheight\box\nextbox}} +\def\stackposdown {\dostackposbox{\lower\lineheight\box\nextbox}} +\def\stackposleft {\dostackposbox{\copy\nextbox\hskip\wd\nextbox\hskip\stackposdistance}} +\def\stackposright{\dostackposbox{\hskip\stackposdistance\hskip\wd\nextbox\box\nextbox}} + +%D The next hack make sure that margin texts near faulty +%D strutted lines are handled ok. + +\newif\ifrepositionmarginbox % \repositionmarginboxtrue + +\newcounter\currentmarginpos + +\def\dopositionmarginbox#1% + {\bgroup + \ifrepositionmarginbox + \doglobal\increment\currentmarginpos + \setposition{\s!margin:\currentmarginpos}% + \scratchdimen=\MPy{\s!margin:\currentmarginpos}% + \doglobal\increment\currentmarginpos + \advance\scratchdimen by -\MPy{\s!margin:\currentmarginpos}% + \advance\scratchdimen by -\dp\strutbox + \setbox#1=\hbox + {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}% + \dp#1=\!!zeropoint + \ht#1=\!!zeropoint + \fi + \vadjust{\box#1}% + \egroup} + +%D For a right menu, a sequence of calls to \type +%D {right_menu_button} is generated. +%D +%D \starttypen +%D right_menu_button (n, p, s=0/1/2, x, y, w, h, d) ; +%D \stoptypen +%D +%D Here, n is the number of the button, s a status variable, +%D while the rest is positional info. The status variable is +%D 0, 1 or~2: not found, found and found but current page. + +% 0=not found 1=found 2=current page + +% geen leeg + +\newtoks\MPmenutoks + +\def\MPmenubuttons#1{\the\MPmenutoks} + +\appendtoks \global\MPmenutoks\emptytoks \to \everyshipout + +% 0=notfound 1=found 2=currentpage + +\def\do@@amposition#1#2#3% + {\doifelsevalue{\??am#1\c!positie}{\v!ja} + {\doglobal\increment\currentamposition + \doifnumberelse{#2} + {\docheckrealreferencepage{#2}% + \global\chardef\currentamrealpage=\ifrealreferencepage2\else1\fi} + {\doifreferencefoundelse{#2} + {\global\chardef\currentamrealpage=\ifrealreferencepage2\else1\fi} + {\global\chardef\currentamrealpage=0}}% % not found + \expanded + {\doglobal\noexpand\appendtoks + #1_menu_button(\currentamposition,\the\currentamrealpage,\noexpand\MPpos{#1:\currentamposition}) ; + \to \MPmenutoks}% + \hpos{#1:\currentamposition}{#3}} + {#3}} + +\def\do@@ammenuposition#1% + {\ifnum\currentamposition>0 + \dowithnextbox{\hpos{menu:#1:\realfolio}{\box\nextbox}}\hbox + \fi} + +\protect \endinput + +%D \macros +%D {GFC, GTC, GSC} +%D +%D The next macros extend tables and tabulation with +%D backgrounds and position related features. Areas are +%D specified with symbolic names, and symbolic references to +%D the graphics involved. Each table has its own namespace. + +\newcounter\noftabpositions +\newtoks \posXCtoks + +\def\tbPOSprefix% + {tbp:\noftabpositions:} + +\def\tablepos% + {\scratchtoks\posXCtoks + \global\posXCtoks\emptytoks + \the\scratchtoks} + +\let\tabulatepos\tablepos + +\def\dodododoGSC[#1:#2]% + {\remappositionframed{#2}{\tbPOSprefix#1}% + \bpos{\tbPOSprefix#1}% + \doglobal\appendtoks\@EA\epos\@EA{\tbPOSprefix#1}\to\posXCtoks} + +\def\dododoGSC[#1:#2:#3]% + {\doglobal\appendtoks\dodododoGSC[#1:#2]\to\posXCtoks\NC} + +\def\dodoGSC[#1]% + {\def\docommando##1{\dododoGSC[##1:##1]}% + \processcommalist[#1]\docommando} + +\def\dodododoGFC[#1:#2:#3]% + {\remappositionframed{#2}{\tbPOSprefix#1}% + \bpos{\tbPOSprefix#1}} + +\def\dododoGFC[#1]% + {\def\docommando##1{\dodododoGFC[##1:##1]}% + \processcommalist[#1]\docommando} + +\def\dodoGFC[#1]% + {\doglobal\appendtoks\dododoGFC[#1]\to\posXCtoks\NC} + +\def\dododododoGTC[#1:#2]% + {\epos{\tbPOSprefix#1}} + +\def\dodododoGTC[#1]% + {\def\docommando##1{\dododododoGTC[##1:##1]}% + \processcommalist[#1]\docommando} + +\def\dododoGTC[#1]% + {\doglobal\appendtoks\dodododoGTC[#1]\to\posXCtoks} + +\def\dodoGTC[#1]% + {\doglobal\appendtoks\dododoGTC[#1]\to\posXCtoks\NC} + +\def\dodododoXC[#1#2]% + {\if#1>\dodoGFC [#2:#2]\else + \if#1+\dodoGFC [#2:#2]\else + \if#1<\dodoGTC [#2:#2]\else + \if#1-\dodoGTC [#2:#2]\else + \if#1=\dodoGSC [#2:#2]\else + \dodoGSC[#1#2:#1#2]\fi\fi\fi\fi\fi} + +\def\dododoXC#1% + {\dodododoXC[#1]} + +\def\dodoXC[#1]% + {{\let\NC\relax\processcommalist[#1]\dododoXC}} + +\def\doGSC[#1]{\iffirstargument\dodoGSC[#1]\else\expandafter\NC\fi} +\def\doGFC[#1]{\iffirstargument\dodoGFC[#1]\else\expandafter\NC\fi} +\def\doGTC[#1]{\iffirstargument\dodoGTC[#1]\else\expandafter\NC\fi} +\def\doXC [#1]{\iffirstargument\dodoXC [#1]\else\expandafter\fi\NC} + +\def\GSC{\dosingleempty\doGSC} +\def\GFC{\dosingleempty\doGFC} +\def\GTC{\dosingleempty\doGTC} +\def\XC {\dosingleempty\doXC } + +%D The amount of code to support tables and tabulation is +%D rather minimalistic. + +\let\tabulatepos\tablepos + +\def\tabulatenormalpos% + {\hss\tabulatepos\hss} + +\def\tabulateequalpos% + {\setbox\scratchbox=\hbox{\tabulateEQ}% + \hbox to \wd\scratchbox{\hss\kern\!!zeropoint\tabulatepos\hss}% + \hskip-\wd\scratchbox + \box\scratchbox} + +\def\tabulatenormalcolumn#1% + {&\iftabulateequal\tabulateequalpos\else\tabulatenormalpos\fi + &\global\chardef\tabulatetype=#1&} + +\def\tabulateequalcolumn#1% + {&\tabulateequalpos + &\global\chardef\tabulatetype=#1&} + +\appendtoks \doglobal\increment\noftabpositions \to \everytabulate + +%D \macros +%D {definepositionframed} +%D +%D The next example show how to provide backgrounds to table +%D cells. First we define some framed backgrounds. +%D +%D \startbuffer +%D \definepositionframed[x][background=color,backgroundcolor=red] +%D \definepositionframed[y][background=color,backgroundcolor=green] +%D \definepositionframed[z][background=color,backgroundcolor=blue] +%D \stopbuffer +%D +%D \typebuffer +%D +%D % \haalbuffer +%D +%D \startbuffer +%D \starttabulatie[|c|c|c|] +%D \GFC[f:x] this is a small \NC table \NC in which we \NC \FR +%D \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR +%D \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR +%D \stoptabulatie +%D \stopbuffer +%D +%D The table itself defines three areas (a, b and~c) using +%D these frames. +%D +%D \typebuffer +%D % \haalbuffer +%D +%D Tables (based on \TABLE) are supported by: + +\def\normalTABLEsimplebar {\unskip\!ttRightGlue&\tablepos&} % | +\def\normalTABLEcomplexbar{\unskip\!ttRightGlue&\omit\tablepos\!ttAlternateVrule} % \| +\def\normalTABLEquote {\unskip\!ttRightGlue&\omit\tablepos&} % " + +\appendtoks \doglobal\increment\noftabpositions \to \EveryTable + +%D In the previous example, we could have provided an overlay to +%D the framed definition. A more direct approach is demonstrated +%D below: +%D +%D \startbuffer +%D \def\cw#1{\color[white]{#1}} +%D +%D \def\TableShade#1#2% +%D {\startMPpositiongraphic +%D initialize_area(\MPpos{b:#1},\MPpos{e:#1}) ; +%D linear_shade(pxy,0,.4#2,.9#2) ; +%D anchor_area(\MPanchor{b:#1}) ; +%D \stopMPpositiongraphic} +%D +%D \dosetpositionaction{b:x}{\TableShade{x}{red}} +%D \dosetpositionaction{b:y}{\TableShade{y}{green}} +%D \dosetpositionaction{b:z}{\TableShade{z}{blue}} +%D \stopbuffer +%D +%D \typebuffer +%D +%D % \haalbuffer +%D +%D The definition of the table looks about the same as the +%D previous one: +%D +%D \startbuffer +%D \starttabel[|c|c|c|] +%D \GFC[b:z] \cw{this is a small} \NC \cw{table} \NC in which we \NC \FR +%D \NC \cw{will demonstrate} \GFC[c:y] \cw{that this} \GTC[c] \cw{positioning} \NC \MR +%D \GSC[a:x] \cw{mechanism also} \GTC[b] \cw{works quite well} \NC in tables \NC \LR +%D \stoptabel +%D \stopbuffer +%D +%D \typebuffer +%D +%D % \haalbuffer + +% \definepositionframed[w][background=color,backgroundcolor=yellow] +% \definepositionframed[x][background=color,backgroundcolor=red] +% \definepositionframed[y][background=color,backgroundcolor=green] +% \definepositionframed[z][background=color,backgroundcolor=blue] +% +% \starttabulate[|c|c|c|] +% \NC this is a small \NC table \NC in which we \NC \FR +% \NC will demonstrate \NC that this \NC positioning \NC \MR +% \NC mechanism also \NC works quite well \NC in tables \NC \LR +% \stoptabulate +% +% \starttabulate[|c|c|c|] +% \GFC[f:x] this is a small \GTC table \NC in which we \NC \FR +% \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR +% \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR +% \stoptabulate +% +% \starttabulate[|c|c|c|] +% \GFC[f:x,d:w] this is a small \GTC[d] table \NC in which we \NC \FR +% \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR +% \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR +% \stoptabulate +% +% \starttabulate[|c|c|c|] +% \XC[+f:x] this is a small \XC table \NC in which we \NC \FR +% \NC will demonstrate \XC[+g:z] that this \XC[-g] positioning \NC \MR +% \XC[=e:y] mechanism also \XC[-f] works quite well \NC in tables \NC \LR +% \stoptabulate +% +% \starttabulate[|c|c|c|] +% \XC[+f:x,+d:w] this is a small \XC[-d] table \NC in which we \NC \FR +% \NC will demonstrate \XC[+g:z] that this \XC[-g] positioning \NC \MR +% \XC[=e:y] mechanism also \XC[-f] works quite well \NC in tables \NC \LR +% \stoptabulate + +% evt [b:x] +% +% \definepositionframed[x][background=color,backgroundcolor=red] +% \definepositionframed[y][background=color,backgroundcolor=green] +% \definepositionframed[z][background=color,backgroundcolor=blue] + +\def\remappositionframed#1#2% from to + {\copyposition{b:#1}{b:#2}% + \copyposition{e:#1}{e:#2}% + \dosetpositionaction{b:#2}{\dopositionaction{b:#1}}} + +\def\definepositionframed% + {\dodoubleargument\dodefinepositionframed} + +\def\dodefinepositionframed[#1][#2]% + {\dosetpositionaction{b:#1}{\dopositionframed[#1][#2]}} + +\def\positionframed% + {\dodoubleempty\dopositionframed} + +\def\dopositionframed[#1][#2]% + {\bgroup + \setbox\scratchbox=\hbox + {\dimen0=\MPx{e:#1}% + \advance\dimen0 by -\MPx{b:#1}% + \dimen2=\MPy{b:#1}% + \advance\dimen2 by -\MPy{e:#1}% + \advance\dimen2 by \MPd{e:#1}% + \lower\dimen2\hbox + {\advance\dimen2 by \MPh{b:#1}% + \framed + [\c!breedte=\dimen0,\c!hoogte=\dimen2, + \c!offset=\v!overlay,#2]{}}}% + \smashbox\scratchbox + \box\scratchbox + \egroup} + +% \def\sethdistances#1% +% {\hbox{\lpos{ml:#1}\hpos{mh:#1}{\strut}\rpos{mr:#1}}} +% +% \def\gethdistances#1% +% {\scratchdimen=\MPx{mh:#1}% +% \advance\scratchdimen by -\MPx{ml#1}% +% \edef\lefthdistance{\the\scratchdimen}% +% \scratchdimen=\MPx{mr:#1}% +% \advance\scratchdimen by -\MPx{mh:#1}% +% \edef\righthdistance{\the\scratchdimen}} + +\protect \endinput diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex index 8604bafab..c4705cd0e 100644 --- a/tex/context/base/core-ref.tex +++ b/tex/context/base/core-ref.tex @@ -37,9 +37,9 @@ % rt!list -> \definereference % rt!exec -> \definereference % -% not, because the current implementation permits to -% determine the page state and is more efficient. - +% but for the moment will not do so, if only because +% the current implementation permits us to determine +% the page state and is also more efficient \unprotect @@ -87,6 +87,28 @@ 23: obskurni (nejasna) reference -- (prefix=--) \stopmessages +\startmessages italian library: references + title: riferimenti + 1: riferimento sconosciuto -- + 2: riferimento duplicato -- a pagina -- + 3: riferimento di tipo sconosciuto -- + 4: riferimento illecito -- + 21: documento -- caricato + 22: il documento -- non è interattivo + 23: riferimento ambiguo -- (prefisso=--) +\stopmessages + +\startmessages norwegian library: references + title: referanser + 1: ukjent referanse -- + 2: duplikat referanse -- på side -- + 3: ukjent referansetype -- + 4: ulovlig referanse -- + 21: dokument -- er lest inn + 22: dokument -- er ikke interaktivt + 23: obskur referanse -- (Prefix=--) +\stopmessages + %D This module deals with referencing. In \CONTEXT\ referencing %D is one of the core features, although at a first glance %D probably nobody will notice. This is good, because @@ -259,18 +281,55 @@ %D In practice this comes to giving \type {\mainreference} a %D appropriate meaning and loading the utility file. -%\def\setreferences% -% {\def\mainreference##1##2##3##4##5% -% {\doifundefinedelse{\r!cross\fileprefix##1##2} -% {\setglobalcrossreference{##1##2}{##3}{##4}{##5}} -% {\showmessage{\m!references}{2}{[##1][##2],##4}}}} +% \def\setreferences% +% {\def\mainreference##1##2##3##4##5% +% {\doifundefinedelse{\r!cross\fileprefix##1##2} +% {\setglobalcrossreference{##1##2}{##3}{##4}{##5}} +% {\showmessage{\m!references}{2}{[##1][##2],##4}}}} + +% \def\setreferences% +% {\the\everyreference % we're grouped anyway +% \def\mainreference##1##2##3##4##5% +% {\doifundefinedelse{\r!cross\fileprefix##1##2} +% {\setglobalcrossreference{##1##2}{##3}{##4}{##5}} +% {\ifcase0##4\else\showmessage{\m!references}{2}{[##1][##2],##4}\fi}}} + +%D For a long time the only way to access an external file was +%D to use the file prefix (\type {somefile::}. However, when +%D you split up a document, redefining the references may be +%D such a pain, that another approach is feasible. By setting +%D the \type {autofile} variable to \type {yes} or \type +%D {page}, you can access the reference directly. The latter +%D case nills the prefix method, thereby saving some memory. +%D +%D \starttabulatie[||||] +%D \NC filename::tag \NC page(filename::pnum) \NC tag \NC\NR +%D \NC $\star$ \NC \NC \NC\NR +%D \NC $\star$ \NC $\star$ \NC $\star$ \NC\NR +%D \NC \NC $\star$ \NC \NC\NR +%D \stoptabulatie + +\chardef\autocrossfilereferences=0 -\def\setreferences% +\def\setreferences% some day, filename will be stored in ref record {\the\everyreference % we're grouped anyway \def\mainreference##1##2##3##4##5% {\doifundefinedelse{\r!cross\fileprefix##1##2} - {\setglobalcrossreference{##1##2}{##3}{##4}{##5}} - {\ifcase0##4\else\showmessage{\m!references}{2}{[##1][##2],##4}\fi}}} + {\ifcase\autocrossfilereferences + \setglobalcrossreference{##1##2}{##3}{##4}{##5}% + \or + \setglobalcrossreference{##1##2}{##3}{##4}{##5}% + \doifundefinedelse{\r!cross##1##2} + {\expanded{\definereference[##1##2][\fileprefix##1##2]}} + {\showmessage{\m!references}{2}{[##1][##2],##4 (auto \currentutilityfilename)}}% + \or + \doifundefinedelse{\r!cross##1##2} + {\expanded{\definereference[##1##2][\noexpand\v!pagina(\fileprefix##4)]}} + {\showmessage{\m!references}{2}{[##1][##2],##4 (auto \currentutilityfilename)}}% + \fi} + {\ifcase0##4\else + \showmessage{\m!references}{2}{[##1][##2],##4 (\currentutilityfilename)}% + \fi}}} \def\resetreferences% {\let\mainreference=\gobblefivearguments} @@ -291,6 +350,15 @@ \newtoks\everycheckreferences +%D When we load references, the file name is stored in a +%D list. + +\let\loadedreferences\empty + +%D We only load references ones. + +\newconditional\jobreferencesloaded + %D This token list is expanded after the references are loaded. %D This hook can be used to initialize mechanisms that depend %D on the reference mechsnism. An example can be found in the @@ -305,12 +373,27 @@ \egroup \the\everycheckreferences} +% \def\usereferences[#1]% +% {\bgroup +% \checkreferences % Load job ones first! +% \setbox0=\hbox +% {\doonlyonce{references:#1}{\doutilities{references}{#1}{}{}{}}}% +% \egroup} + \def\usereferences[#1]% - {\bgroup - \checkreferences - \setbox0=\hbox - {\doonlyonce{references:#1}{\doutilities{references}{#1}{}{}{}}}% - \egroup} + {\bgroup\setbox\scratchbox=\hbox\bgroup + \checkreferences + \doifparentfileelse{#1} + {\ifconditional\jobreferencesloaded\else + \doutilities{references}{#1}{}{}{}% + \global\settrue\jobreferencesloaded + \fi} + {\ExpandBothAfter\doifnotinset{#1}{\loadedreferences} + {\doutilities{references}{#1}{}{}{}% + \ifx\fileprefix\empty\else + \doglobal\addtocommalist{#1}\loadedreferences + \fi}} + \egroup\egroup} %D As mentioned we will also use the cross reference mechanism %D for navigational purposes. The main reason for this is that @@ -800,6 +883,9 @@ \ifx\currentreferencespecial\empty \ifx\currentouterreference\empty \docheckinnerreference + \ifreferencefound \else + \checkglobalfilereferences + \fi \else \docheckouterreference \fi @@ -822,6 +908,9 @@ \ifx\currentreferencespecial\empty \ifx\currentouterreference\empty \docheckinnerreference + \ifreferencefound \else + \checkglobalfilereferences + \fi \else \docheckouterreference \fi @@ -833,8 +922,6 @@ \fi \fi \fi -% \doif{\currentfullreference}{\v!geen} % DOCUMENT THIS ONE! -% {\global\referencefoundfalse} \iftracereferences \doshowcurrentreference\space \writestatus{\m!references}{\currentreferenceshow}% @@ -868,6 +955,9 @@ \ifx\currentreferencespecial\empty \ifx\currentouterreference\empty \docheckinnerreference + \ifreferencefound \else + \checkglobalfilereferences + \fi \else \docheckouterreference \fi @@ -890,6 +980,9 @@ \ifx\currentreferencespecial\empty \ifx\currentouterreference\empty \docheckinnerreference + \ifreferencefound \else + \checkglobalfilereferences + \fi \else \docheckouterreference \fi @@ -901,8 +994,6 @@ \fi \fi \fi -% \doif{\currentfullreference}{\v!geen} % DOCUMENT THIS ONE! -% {\global\referencefoundfalse}% \iftracereferences \doshowcurrentreference\space \writestatus{\m!references}{\currentreferenceshow}% @@ -913,6 +1004,26 @@ \endETEX +%D Although this can be considered a hack, we provide the +%D option to locate unknown references in other (loaded) files. +%D This can be dangerous, since there can be conflicting +%D definitions. + +\newconditional\autoglobalfilereferences + +\def\checkglobalfilereferences% + {\ifconditional\autoglobalfilereferences + \processcommacommand[\loadedreferences]\docheckglobalfilereference + \fi} + +\def\docheckglobalfilereference#1% + {\doifdefined{\r!cross#1::\currentinnerreference} + {\def\currentouterreference{#1}% + \edef\currentfullreference% + {\currentouterreference::\currentinnerreference}% + \global\referencefoundtrue + \quitcommalist}} + %D For most situations, we could use: %D %D \starttypen @@ -1340,15 +1451,28 @@ %D uppercase here, since the suffix is handled in the special %D driver. Conversion is taken care of by: %D -%D \startypen +%D \starttypen %D \setreferencefilename somefilename\to\SomeFileName %D \stoptypen +% \def\setreferencefilename#1\to#2% +% {\doifelse{\@@converteerfile}{\v!ja} % boolean is sneller +% {\uppercasestring#1\to#2} +% {\edef#2{#1}}} + +\chardef\referencefilecase=0 + \def\setreferencefilename#1\to#2% - {\doifelsevalue{\??rf\c!converteerfile}{\v!ja} % boolean is sneller - {\uppercasestring#1\to#2} - {\edef#2{#1}}} - + {\ifcase\referencefilecase + \edef#2{#1}% + \or + \uppercasestring#1\to#2% + \or + \lowercasestring#1\to#2% + \else + \edef#2{#1}% + \fi} + %D Internal references can best be set using the next few %D macros. Setting such references to unique values is %D completely up to the macros that call them. @@ -1569,8 +1693,8 @@ \setglobalsystemreference \rt!exec \v!ResumeMovie {resumemovie} \setglobalsystemreference \rt!exec \v!ResumeSound {resumesound} \setglobalsystemreference \rt!exec \v!SaveDocument {save} -\setglobalsystemreference \rt!exec \v!SearchAgain {searchagain} \setglobalsystemreference \rt!exec \v!SearchDocument {search} +\setglobalsystemreference \rt!exec \v!SearchAgain {searchagain} \setglobalsystemreference \rt!exec \v!StartMovie {startmovie} \setglobalsystemreference \rt!exec \v!StartSound {startsound} \setglobalsystemreference \rt!exec \v!StopMovie {stopmovie} @@ -1581,6 +1705,8 @@ \setglobalsystemreference \rt!exec \v!HideField {hide} \setglobalsystemreference \rt!exec \v!ShowField {show} \setglobalsystemreference \rt!exec \v!GotoPage {gotopage} +\setglobalsystemreference \rt!exec \v!Query {query} +\setglobalsystemreference \rt!exec \v!QueryAgain {queryagain} %D Executing the command looks alike the previous goto macros. @@ -1644,23 +1770,37 @@ \v!label=>\let\dowantedreference=\dolabelonlyreference, \v!tekst=>\let\dowantedreference=\dotextonlyreference, \v!symbool=>\let\dowantedreference=\dosymbolreference]% - %\doifelse{\@@rfstrut}{\v!ja} % some day an option - % {\referencetruttrue} - % {\referencestrutfalse}% - \ifx\@@rfprefix\s!unknown - % retain the current value - \else\ifx\@@rfprefix\empty - \let\referenceprefix=\empty - \else\ifx\@@rfprefix\incrementreferenceprefix - \advance\prefixcounter by 1 - \edef\referenceprefix{\the\prefixcounter:}% - \let\@@rfprefix\s!unknown - \else\ifx\@@rfprefix\decrementreferenceprefix - \let\referenceprefix=\empty - \let\@@rfprefix\s!unknown - \else - \edef\referenceprefix{\@@rfprefix:}% - \fi\fi\fi\fi} + \chardef\autocrossfilereferences=0 + \processaction + [\@@rfautofile] + [ \v!ja=>\chardef\autocrossfilereferences=1, + \v!pagina=>\chardef\autocrossfilereferences=2]% + \chardef\referencefilecase=0 + \processaction[\@@rfconverteerfile] + [ \v!ja=>\chardef\referencefilecase=1, + \v!groot=>\chardef\referencefilecase=1, + \v!klein=>\chardef\referencefilecase=2]% + % \doifelse{\@@rfstrut}{\v!ja} % some day an option + % {\referencetruttrue}{\referencestrutfalse}% + % + % This is a typical example where \ifx\@@rfprefix\s!unknown fails: + % + \doifnot{\@@rfprefix}{\s!unknown} % retain the current value + {\ifx\@@rfprefix\empty + \let\referenceprefix=\empty + \else\ifx\@@rfprefix\incrementreferenceprefix + \advance\prefixcounter by 1 + \edef\referenceprefix{\the\prefixcounter:}% + \let\@@rfprefix\s!unknown + \else\ifx\@@rfprefix\decrementreferenceprefix + \let\referenceprefix=\empty + \let\@@rfprefix\s!unknown + \else + \edef\referenceprefix{\@@rfprefix:}% + \fi\fi\fi}% + \doifelse{\@@rfglobaal}{\v!ja} + {\settrue \autoglobalfilereferences} + {\setfalse\autoglobalfilereferences}} \def\incrementreferenceprefix{+} \def\decrementreferenceprefix{-} @@ -1774,8 +1914,8 @@ {\dontleavehmode \bgroup \def\thecurrentsubtextreference% - {\limitatetext{\currentsubtextreference}{\@@rfbreedte}{...}}% - %\leaveoutervmode + {\limitatetext{\currentsubtextreference}{\@@rfbreedte}{\unknown}}% + %\leaveoutervmode % no \@@rflinks \doifreferencefoundelse{#1} {\let\crlf\space @@ -1908,9 +2048,13 @@ % better: \def\docompletereference#1#2[#3]% - {\doifsomespaceelse{#2} - {\donaarspace{\dotextprefix{#2}#1}[#3]} - {\donaarfixed{\dotextprefix{#2}#1}[#3]}} + {\iflocationsplit + \doifsomespaceelse{#2} + {\donaarspace{\dotextprefix{#2}#1}[#3]} + {\donaarfixed{\dotextprefix{#2}#1}[#3]}% + \else + \donaarfixed{\dotextprefix{#2}#1}[#3]% + \fi} \def\dolabelonlyreference#1#2[#3]% {\doifsomespaceelse{#2} @@ -1959,7 +2103,8 @@ \c!label=, % can be {left}{right} \c!commando=\in, #2]% - \unexpanded\setvalue{#1}{\doexecutereferenceformat{#1}}% + \unexpanded\setvalue{#1}% + {\dontleavehmode\doexecutereferenceformat{#1}}% \fi} \def\noexecutelabelreferenceformat#1% @@ -2063,20 +2208,29 @@ \newcount\similarreference % 0=noppes 1=create/refer 2,3,..=refer \def\donaarspace#1[#2]% - {\ifsecondaryreference\setbox0=\hbox\fi % due to space insertion - {\let\donaarspace=\donaarfixed - \iflocation - \def\processisolatedword##1% - {\ifisolatedwords\ifsharesimilarreferences - \global\advance\similarreference by 1 - \fi\fi - \hbox{\gotolocation{#2}{##1\presetgoto}}}% - \doattributes\??ia\c!letter\c!kleur - {\processisolatedwords{#1}\processisolatedword}% - \global\similarreference=0 - \else - #1\relax % \relax prevents #1's next macros from gobbling \fi - \fi}} + {\iflocationsplit + \ifsecondaryreference\setbox0=\hbox\fi % due to space insertion + {\let\donaarspace=\donaarfixed + \iflocation + \def\processisolatedword##1% + {\ifisolatedwords\ifsharesimilarreferences + \global\advance\similarreference by 1 + \fi\fi + \hbox{\gotolocation{#2}{##1\presetgoto}}}% + \doattributes\??ia\c!letter\c!kleur + {\processisolatedwords{#1}\processisolatedword}% + \else + #1\relax % \relax prevents #1's next macros from gobbling \fi + \fi}% + \else + \iflocation + \doattributes\??ia\c!letter\c!kleur + {\gotolocation{#2}{#1\presetgoto}}% + \else + #1\relax % \relax prevents #1's next macros from gobbling \fi + \fi + \fi + \global\similarreference=0 } \def\donaarfixed#1[#2]% {{\iflocation @@ -2142,22 +2296,30 @@ \def\dogebruikexterndocument[#1][#2][#3]% {\bgroup - \doifelsenothing{#1} - {\dogebruikexterndocument[#2][#2][#3]} - {\doifelsenothing{#3} - {\dogebruikexterndocument[#1][#2][#2]} - {\doifsomething{#2} - {\setgvalue{\v!file:::#1}{\doexternaldocument[][#2][#3]}% just \do - \doifparentfileelse{#2} - {\showmessage{\m!references}{21}{#2}} - {\bgroup % prevents wrong loading of \jobname - \def\fileprefix{#1::}% - \let\setglobalcrossreference=\setoutercrossreference - \usereferences[#2]% - \egroup % when called nested - \showmessage{\m!references}{21}{#2}}}}}% + \ifsecondargument + \doifelsenothing{#1} + {\dogebruikexterndocument[#2][#2][#3]} + {\doifelsenothing{#3} + {\dogebruikexterndocument[#1][#2][#2]} + {\doifsomething{#2} + {\setgvalue{\v!file:::#1}{\doexternaldocument[][#2][#3]}% just \do + \doif{\@@rfstatus}{\v!start} + {\doifparentfileelse{#2} + {\showmessage{\m!references}{21}{#2}} + {\dodogebruikexterndocument{#1}{#2}}}}}}% + \else + \dodogebruikexterndocument{#1}{#1}% + \fi \egroup} +\def\dodogebruikexterndocument#1#2% + {\bgroup % prevents wrong loading of \jobname + \def\fileprefix{#1::}% + \let\setglobalcrossreference=\setoutercrossreference + \usereferences[#2]% + \egroup % when called nested + \showmessage{\m!references}{21}{#2}} + %D The \URL\ alternative takes four arguments: %D %D \showsetup{\y!gebruikURL} @@ -2329,8 +2491,18 @@ {\docomplexuit[#1]} {\docomplexuit[#1::]}} +% \def\docomplexuit[#1::#2]% +% {\bgroup +% \doifdefinedelse{\v!file:::#1} +% {\def\doexternaldocument[##1][##2][##3]% +% {\naar{##3}[#1::#2]}% +% \getvalue{\v!file:::#1}} +% {\tttf[#1]}% +% \egroup} + \def\docomplexuit[#1::#2]% - {\bgroup + {\dontleavehmode % added, but probably not needed + \bgroup \doifdefinedelse{\v!file:::#1} {\def\doexternaldocument[##1][##2][##3]% {\naar{##3}[#1::#2]}% @@ -2652,16 +2824,16 @@ \def\docoupledocument[#1][#2][#3][#4]% {\ifthirdargument \begingroup - \def\dolijstelement##1##2##3##4##5##6% + \def\dolijstelement##1##2##3##4##5##6% 2=aut 6=pag / 2 goes into text ref slot {\global\utilitydonetrue %{Watch the braces here below!} - %\setglobalcrossreference{{##1::\strippedlistentry[##5]}}{}{}{##6}}% - \setglobalcrossreference{{##1::\strippedlistentry[##5]}}{}{##6}{}}% + \setglobalcrossreference{{##1::\strippedlistentry[##5]}}{}{##6}{##2}}% \def\usereferences[##1]% {\setbox0=\vbox{\doutilities{#3}{##1}{#3}{}{}}}% \dogebruikexterndocument[#1][#2][#4]% \doglobal\addtocommalist{#1}\crossdocumentreferences \def\docommando##1% - {\doglobal\addtocommalist{##1}\crossdocumentelements}% + {\setxvalue{\??rf##1\c!status}{\v!start}% for fast checking + \doglobal\addtocommalist{##1}\crossdocumentelements}% \processcommalist[#3]\docommando \ifutilitydone \global\autocrossdocumenttrue @@ -2796,8 +2968,8 @@ \checkinteractiebalk{1.5em}\v!ruim\!!zeropoint % brrrrr \setbox2=\hbox {\setupsymbolset[\@@iasymboolset]% - \localframed[\??ib][]{\symbol[\v!vorigepagina]}}% - \!!heighta=\ht2 + \localframed[\??ib][#1,\c!achtergrond=]{\symbol[\v!vorigepagina]}}% + \!!heighta=\ht2 % needed because we default to nothing \stelinteractiebalkin[#1,\c!strut=\v!nee]% \setupinteraction[\c!breedte=\!!zeropoint]% %\!!counta=1 @@ -2827,6 +2999,7 @@ \edef\localreference{##1}% \dodocomplexbutton\??ib [\c!hoogte=\!!heighta,\c!breedte=\!!widtha]% +% funny buggy left over: [\c!breedte=\!!widtha]% {\dontleavehmode\symbol[\localreference]}% [\localreference]% \hss}% @@ -2912,6 +3085,7 @@ \setupreferencing [\c!status=\v!start, + \c!autofile=\v!nee, \v!deel\c!nummer=\v!ja, \v!hoofdstuk\c!nummer=\v!nee, \c!interactie=\v!alles, @@ -2919,12 +3093,13 @@ %\c!urlspatie=\v!nee, %\c!urlletter=, %\c!urlkleur=, - \c!converteerfile=\v!ja, + \c!converteerfile=\v!nee, %\c!strut=\v!nee, % some day an option \c!prefix=, \c!breedte=.75\zetbreedte, \c!links=\citaat\bgroup, \c!rechts=\egroup, + \c!globaal=\v!nee, \c!scheider=~] \setupurl diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex index c25fa87fb..26f93fb9d 100644 --- a/tex/context/base/core-rul.tex +++ b/tex/context/base/core-rul.tex @@ -164,10 +164,18 @@ %D A quite valid way of letting drivers do the job, is giving %D a solid rule a gray texture. +\def\raster[#1]% + {\groupedcommand{\startraster[#1]}{\stopraster}} + \def\setgraybox\width#1\height#2\depth#3\raster#4\corner#5\radius#6\\% - {\startraster[#4]% - \dofilledbox\width#1\height#2\depth#3\corner#5\radius#6\\% - \stopraster} + {\doifelsenothing{#4} % avoid black rules when no gray + {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\} + {\raster[#4]% + {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}}} + +%D The auxiliary macro is defined as: + +\def\dophantombox#1\\{\hphantom{\dofilledbox#1\\}} %D We don't have to stick to a \TEX\ drawn rule, but %D also can use rounded or even fancier shapes, as we will @@ -218,19 +226,18 @@ \def\setcolorbox\width#1\height#2\depth#3\color#4\corner#5\radius#6\\% {\ifincolor - \doifsomething{#4} - {\startcolor[#4]% - \dofilledbox\width#1\height#2\depth#3\corner#5\radius#6\\% - \stopcolor}% + \doifcolorelse{#4}{\color[#4]% + {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}} + {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\}% \else - \dofilledbox\width#1\height#2\depth#3\corner#5\radius#6\\% + \dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\% \fi} \def\colorbox% {\setcolorbox} %D \macros -%D {defineoverlay, +%D {defineoverlay,doifoverlayelse, %D overlaywidth, overlayheight, overlaydepth, %D overlaycolor, overlaylinecolor, overlaylinewidth} %D @@ -287,12 +294,12 @@ %D %D The resulting box is lowered to the right depth. -\def\overlaywidth {\the\vsize} % We preset the variables -\def\overlayheight {\the\hsize} % to some reasonable default -\let\overlaydepth \!!zeropoint % values. The attributes -\let\overlaycolor \empty % of the frame can be (are) -\let\overlaylinewidth \!!zeropoint % set somewhere else. -\let\overlaylinecolor \empty % +\def\overlaywidth {\the\vsize\space} % We preset the variables +\def\overlayheight {\the\hsize\space} % to some reasonable default +\let\overlaydepth \!!zeropoint % values. The attributes +\let\overlaycolor \empty % of the frame can be (are) +\let\overlaylinewidth \!!zeropoint % set somewhere else. +\let\overlaylinecolor \empty % \newtoks\everyoverlay @@ -301,23 +308,23 @@ \def\dodefineoverlay[#1][#2]% {\def\docommando##1% - {\setvalue{executeoverlay##1}{\executedefinedoverlay##1\\#2\\}}% + {\setvalue{\??ov##1}{\executedefinedoverlay##1\\#2\\}}% \processcommalist[#1]\docommando} \long\def\executedefinedoverlay#1\\#2\\#3#4#5#6#7#8#9% {\bgroup \scratchdimen=#3% - \edef\overlaywidth{\the\scratchdimen}% + \edef\overlaywidth{\the\scratchdimen\space}% \scratchdimen=#4% \advance\scratchdimen by #5% - \edef\overlayheight{\the\scratchdimen}% + \edef\overlayheight{\the\scratchdimen\space}% \scratchdimen=#5% - \edef\overlaydepth{\the\scratchdimen}% + \edef\overlaydepth{\the\scratchdimen\space}% \edef\overlaycolor{#6}% -\prependtoks - \hsize=\overlaywidth - \vsize=\overlayheight -\to\everyoverlay + \prependtoks + \hsize=\overlaywidth + \vsize=\overlayheight + \to\everyoverlay %\writestatus % {overlay} % {#1\space w=\overlaywidth/h+d=\overlayheight/d=\overlaydepth]}% @@ -339,12 +346,17 @@ \def\executeoverlay#1#2#3#4#5#6#7% {} +%D For testing we provide: + +\def\doifoverlayelse#1% + {\doifdefinedelse{\??ov#1}} + %D We predefine two already familiar backgrounds: -\setvalue{executeoverlay\v!raster}#1#2#3#4#5#6#7% +\setvalue{\??ov\v!raster}#1#2#3#4#5#6#7% {\graybox\width#1\height#2\depth#3\raster#5\corner#6\radius#7\\} -\setvalue{executeoverlay\v!kleur}#1#2#3#4#5#6#7% +\setvalue{\??ov\v!kleur}#1#2#3#4#5#6#7% {\colorbox\width#1\height#2\depth#3\color#4\corner#6\radius#7\\} %D After all these preparations, the background macro does no @@ -358,21 +370,30 @@ %D \som a \TEX\ or driver based method %D \stopopsomming %D -%D Here we go: +%D The macro can be extended by adding commands to the token +%D list register \type {\everybackgroundbox}. For this +%D purpose, the name of the current background is available in +%D \type {\currentbackgound}. \newbox\extraframebox +\newtoks\everybackgroundbox + +\let\currentbackground\empty + \def\dodobackgroundbox#1#2#3#4#5#6% {\bgroup + \def\currentbackground{#1}% + \the\everybackgroundbox \setbox\extraframebox=\hbox - {\executeifdefined{executeoverlay#1}\gobblesevenarguments + {\executeifdefined{\??ov\currentbackground}\gobblesevenarguments {\dimen2}{\dimen4}{\dimen6}{#3}{#4}{#5}{#6}}% \setbox\extraframebox=\hbox {\vbox{\moveleft\dimen0\box\extraframebox}}% - \wd\extraframebox=\backgroundwidth + \wd\extraframebox=\!!zeropoint % \backgroundwidth \ht\extraframebox=\backgroundheight \dp\extraframebox=\backgrounddepth - \box\extraframebox\hskip-\backgroundwidth + \box\extraframebox % \hskip-\backgroundwidth \egroup} \def\dobackgroundbox#1\background#2\color#3\raster#4\offset#5\corner @@ -383,18 +404,20 @@ \dimen2=\wd#1\advance\dimen2 by 2\dimen0 \dimen4=\ht#1\advance\dimen4 by \dimen0 \dimen6=\dp#1\advance\dimen6 by \dimen0\advance\dimen6 by #8\relax + \edef\backgroundwidth {\the\wd#1}% + \edef\backgroundheight{\the\ht#1}% + \edef\backgrounddepth {\the\dp#1}% + %\edef\foregroundbox{\box#1}% + \def\foregroundbox% fuzzy but needed hack, this \vss, otherwise + {\vbox to \backgroundheight{\vss\box#1\vss}}% vertical shift \def\docommando##1% {\dodobackgroundbox{##1}{#1}{#3}{#4}{#6}{#7}}% - \hbox - {\edef\backgroundwidth {\the\wd#1}% - \edef\backgroundheight{\the\ht#1}% - \edef\backgrounddepth {\the\dp#1}% - \edef\foregroundbox{\box#1}% - \expanded{\rawprocesscommalist[#2]\noexpand\docommando}% - \box#1}}} + \hbox to \backgroundwidth % in case 'foreground' is uses as overlay + {\expanded{\rawprocesscommalist[#2]\noexpand\docommando}% + \box#1\hss}}} %D One can explictly insert the foreground box. For that -%D purpose we introduce the overlay \tyupe {foreground}. +%D purpose we introduce the overlay \type {foreground}. \defineoverlay[\v!voorgrond][\foregroundbox] @@ -536,6 +559,8 @@ %D mere fact that this way we can use the optional argument %D grabbers. +\def\defaultframeoffset{.25ex} + \unexpanded\def\framed% {\bgroup \presetlocalframed[\??ol]% @@ -576,7 +601,6 @@ \def\localframed% {\bgroup - \inframedtrue \dodoubleempty\startlocalframed} %D Before we go into details, we present (and implement) the @@ -592,16 +616,154 @@ %D backgrounds, when \type {#2} sets the offset to \type %D {overlay}, both offsets become invalid. +% \def\startlocalframed[#1][#2]% beware, also on cont-loc! +% {\bgroup +% \inframedtrue +% \edef\@@framed{#1}% +% % this piece of pre expansion is needed +% \scratchdimen\getvalue{\@@framed\c!kaderoffset}% +% \setevalue{\@@framed\c!kaderoffset}{\the\scratchdimen}% +% \doifnotvalue{\@@framed\c!achtergrondoffset}{\v!kader} +% {\scratchdimen\getvalue{\@@framed\c!achtergrondoffset}% +% \setevalue{\@@framed\c!achtergrondoffset}{\the\scratchdimen}}% +% % to prevent deadlock in case of self refering +% \ifsecondargument % faster +% \getparameters[\@@framed][#2]% here ! +% \fi +% % beware, both the frame and background offset can be overruled +% \edef\localoffset{\getvalue{\@@framed\c!offset}}% +% \edef\localwidth {\getvalue{\@@framed\c!breedte}}% +% \edef\localheight{\getvalue{\@@framed\c!hoogte}}% +% \edef\localformat{\getvalue{\@@framed\c!uitlijnen}}% +% \edef\localstrut {\getvalue{\@@framed\c!strut}}% +% \doifvaluesomething{\@@framed\c!lijndikte} % nested \framed inherits +% {\linewidth=\getvalue{\@@framed\c!lijndikte}}% +% \doifelsenothing{\localformat} +% {\boxhasformatfalse} +% {\boxhasformattrue +% \dosetraggedcommand{\localformat}% +% \edef\beforeframedbox{\raggedtopcommand\getvalue{\@@framed\c!boven}}% +% \edef\afterframedbox {\getvalue{\@@framed\c!onder}\raggedbottomcommand}}% +% \doifelse{\localoffset}{\v!geen} +% {\boxhasoffsetfalse +% \boxhasstrutfalse +% \boxisoverlaidfalse +% \@@localoffset=\linewidth} +% {\doifelse{\localoffset}{\v!overlay} +% {\boxhasoffsetfalse +% \boxhasstrutfalse +% \boxisoverlaidtrue +% \@@localoffset=\!!zeropoint} +% {\boxhasoffsettrue +% \boxhasstruttrue +% \boxisoverlaidfalse +% \ifx\localoffset\v!default % new per 2-6-2000 +% \let\localoffset\defaultframeoffset +% \letvalue{\@@framed\c!offset}\defaultframeoffset +% \else +% \let\defaultframeoffset\localoffset +% \fi +% \@@localoffset=\localoffset +% \advance\@@localoffset by \linewidth}}% +% \doifelse{\localwidth}{\v!passend} +% {\ifboxhasformat +% \boxhaswidthtrue +% \!!widtha=\hsize +% \else +% \boxhaswidthfalse +% \fi} +% {\boxhaswidthtrue +% \doifelse{\localwidth}{\v!ruim} +% {\!!widtha=\hsize} +% {\!!widtha=\localwidth}}% +% \doifelse{\localheight}{\v!passend} +% {\boxhasheightfalse} % no longer: \boxhasstrutfalse +% {\doifelse{\localheight}{\v!ruim} +% {\boxhasheightfalse} +% {\boxhasheighttrue +% \!!heighta=\localheight}}% +% \ifdim\!!widtha=\hsize +% \parindent=\!!zeropoint +% \setlocalhsize +% \!!widtha=\localhsize +% \fi +% \advance\!!widtha by -2\@@localoffset +% \advance\!!heighta by -2\@@localoffset +% \doif{\localstrut}{\v!nee} +% {\boxhasstrutfalse}% +% \ifboxhasstrut +% \setstrut +% \let\localbegstrut=\begstrut +% \let\localendstrut=\endstrut +% \let\localstrut =\strut +% \else +% \let\localbegstrut=\pseudobegstrut % was: \relax +% \let\localendstrut=\pseudoendstrut % was: \relax +% \let\localstrut =\pseudostrut % was: \relax +% %\ifboxhasheight\ifdim\!!heighta<\ht\strutbox % saveguard +% % \let\localbegstrut=\relax % but not that +% % \let\localstrut =\relax % save afterall +% %\fi\fi +% \fi +% \ifboxhasheight +% \let\\=\vboxednewline +% \ifboxhaswidth +% \let\hairline=\vboxedhairline +% \ifboxhasformat +% \let\next=\doformatboxSomeFormat +% \else +% \let\next=\doformatboxNoFormat +% \fi +% \else +% \let\hairline=\hboxedhairline +% \ifboxhasformat +% \let\next=\doformatboxHeight +% \else +% \let\next=\doformatboxVSize +% \fi +% \fi +% \else +% \ifboxhaswidth +% \ifboxhasformat +% \let\hairline=\vboxedhairline +% \let\\=\vboxednewline +% \let\next=\doformatboxWidth +% \else +% \let\hairline=\hboxedhairline +% \let\\=\hboxednewline +% \let\next=\doformatboxHSize +% \fi +% \else +% \let\hairline=\hboxedhairline +% \let\\=\hboxednewline +% \let\next=\doformatboxNoSize +% \fi +% \fi +% \def\dowithframedbox% +% {\let\postprocessframebox\undefined %new +% \aftergroup\stoplocalframed}% +% \edef\framedwidth % a new feature +% {\ifdim\!!widtha >\!!zeropoint\the\!!widtha \else\!!zeropoint\fi}% +% \edef\framedheight% a new feature +% {\ifdim\!!heighta>\!!zeropoint\the\!!heighta\else\!!zeropoint\fi}% +% \afterassignment\dowithframedbox +% \setbox\framebox=\next} + \def\startlocalframed[#1][#2]% {\bgroup + \inframedtrue \edef\@@framed{#1}% + % this piece of pre expansion is needed \scratchdimen\getvalue{\@@framed\c!kaderoffset}% \setevalue{\@@framed\c!kaderoffset}{\the\scratchdimen}% - \scratchdimen\getvalue{\@@framed\c!achtergrondoffset}% - \setevalue{\@@framed\c!achtergrondoffset}{\the\scratchdimen}% + \doifnotvalue{\@@framed\c!achtergrondoffset}{\v!kader} + {\scratchdimen\getvalue{\@@framed\c!achtergrondoffset}% + \setevalue{\@@framed\c!achtergrondoffset}{\the\scratchdimen}}% + % to prevent deadlock in case of self refering \ifsecondargument % faster \getparameters[\@@framed][#2]% here ! \fi + % beware, both the frame and background offset can be overruled \edef\localoffset{\getvalue{\@@framed\c!offset}}% \edef\localwidth{\getvalue{\@@framed\c!breedte}}% \edef\localheight{\getvalue{\@@framed\c!hoogte}}% @@ -609,45 +771,59 @@ \edef\localstrut{\getvalue{\@@framed\c!strut}}% \doifvaluesomething{\@@framed\c!lijndikte} {\linewidth=\getvalue{\@@framed\c!lijndikte}}% - \doifelsenothing{\localformat} - {\boxhasformatfalse} - {\boxhasformattrue - \dosetraggedcommand{\localformat}% - \edef\beforeframedbox{\raggedtopcommand\getvalue{\@@framed\c!boven}}% - \edef\afterframedbox {\getvalue{\@@framed\c!onder}\raggedbottomcommand}}% - \doifelse{\localoffset}{\v!geen} - {\boxhasoffsetfalse - \boxhasstrutfalse - \boxisoverlaidfalse - \@@localoffset=\linewidth} - {\doifelse{\localoffset}{\v!overlay} - {\boxhasoffsetfalse - \boxhasstrutfalse - \boxisoverlaidtrue - \@@localoffset=\!!zeropoint} - {\boxhasoffsettrue - \boxhasstruttrue - \boxisoverlaidfalse - \@@localoffset=\localoffset - \advance\@@localoffset by \linewidth}}% - \doifelse{\localwidth}{\v!passend} - {\ifboxhasformat - \boxhaswidthtrue - \!!widtha=\hsize - \else - \boxhaswidthfalse - \fi} - {\doifelse{\localwidth}{\v!ruim} - {\boxhaswidthtrue - \!!widtha=\hsize} - {\boxhaswidthtrue - \!!widtha=\localwidth}}% - \doifelse{\localheight}{\v!passend} - {\boxhasheightfalse} % no longer: \boxhasstrutfalse - {\doifelse{\localheight}{\v!ruim} - {\boxhasheightfalse} - {\boxhasheighttrue - \!!heighta=\localheight}}% + \ifx\localformat\empty + \boxhasformatfalse + \else + \boxhasformattrue + \dosetraggedcommand{\localformat}% + \edef\beforeframedbox{\raggedtopcommand\getvalue{\@@framed\c!boven}}% + \edef\afterframedbox {\getvalue{\@@framed\c!onder}\raggedbottomcommand}% + \fi + \ifx\localoffset\v!geen + \boxhasoffsetfalse + \boxhasstrutfalse + \boxisoverlaidfalse + \@@localoffset=\linewidth + \else\ifx\localoffset\v!overlay + \boxhasoffsetfalse + \boxhasstrutfalse + \boxisoverlaidtrue + \@@localoffset=\!!zeropoint + \else + \boxhasoffsettrue + \boxhasstruttrue + \boxisoverlaidfalse + \ifx\localoffset\v!default % new per 2-6-2000 + \let\localoffset\defaultframeoffset + \letvalue{\@@framed\c!offset}\defaultframeoffset + \else + \let\defaultframeoffset\localoffset + \fi + \@@localoffset=\localoffset + \advance\@@localoffset by \linewidth + \fi\fi + \ifx\localwidth\v!passend + \ifboxhasformat + \boxhaswidthtrue + \!!widtha=\hsize + \else + \boxhaswidthfalse + \fi + \else\ifx\localwidth\v!ruim + \boxhaswidthtrue + \!!widtha=\hsize + \else + \boxhaswidthtrue + \!!widtha=\localwidth + \fi\fi + \ifx\localheight\v!passend + \boxhasheightfalse % no longer: \boxhasstrutfalse + \else\ifx\localheight\v!ruim + \boxhasheightfalse + \else + \boxhasheighttrue + \!!heighta=\localheight + \fi\fi \ifdim\!!widtha=\hsize \parindent=\!!zeropoint \setlocalhsize @@ -655,8 +831,9 @@ \fi \advance\!!widtha by -2\@@localoffset \advance\!!heighta by -2\@@localoffset - \doif{\localstrut}{\v!nee} - {\boxhasstrutfalse}% + \ifx\localstrut\v!nee + \boxhasstrutfalse + \fi \ifboxhasstrut \setstrut \let\localbegstrut=\begstrut @@ -715,7 +892,9 @@ \afterassignment\dowithframedbox \setbox\framebox=\next} - +\let\afterframedbox \relax +\let\beforeframedbox\relax + %D Carefull analysis of this macro will learn us that not all %D branches in the last conditionals can be encountered, that %D is, some assignments to \type{\next} will never occur. @@ -739,6 +918,8 @@ \doif{\localwidth}{\v!passend} {\ifreshapeframebox\doreshapeframedbox\fi \boxhaswidthfalse}% + \else + \resetshapeframebox \fi \ifboxhaswidth \wd\framebox=\!!widtha @@ -759,9 +940,9 @@ \ifx\postprocessframebox\undefined \else \postprocessframebox\framebox \fi - \doifelsevalue{\@@framed\c!kader}{\v!overlay} - {\edef\overlaylinecolor{\getvalue{\@@framed\c!kaderkleur}}% - \edef\overlaylinewidth{\the\linewidth}}% + \edef\overlaylinecolor{\getvalue{\@@framed\c!kaderkleur}}% + \edef\overlaylinewidth{\the\linewidth}% + \doifnotvalue{\@@framed\c!kader}{\v!overlay} % faster -) {\doframedbox}% \doifvaluesomething{\@@framed\c!achtergrond} {\dobackedbox}% @@ -947,17 +1128,12 @@ %D putting rules around boxes, inserting offsets and aligning %D text. Each step is handled by separate macros. -\def\dooffsetframebox% - {\doifinstringelse{\getvalue{\@@framed\c!offset}}{\v!geen\c!offset} - {}{\doifelsevaluenothing{\@@framed\c!offset} - {}{\edef\do{\kern\getvalue{\@@framed\c!offset}}% - \setbox\framebox=\vbox{\do\hbox{\do\box\framebox\do}\do}}}} +\def\dowidenframebox#1% + {\setbox\framebox=\vbox + {\kern#1\hbox{\kern#1\box\framebox\kern#1}\kern#1}} -\def\dolocateframebox% - {\setbox\framebox=\vbox - {\kern\linewidth - \hbox{\kern\linewidth\box\framebox\kern\linewidth} - \kern\linewidth}} +\def\dooffsetframebox{\dowidenframebox\localoffset} +\def\dolocateframebox{\dowidenframebox\linewidth } %D Let's hope that the next few examples show us enough of %D what needs to be done by the auxiliary macros. @@ -1044,12 +1220,17 @@ %D have to take care of additional offsets. \def\dobackedbox% + {\doifelsevalue{\@@framed\c!achtergrondoffset}{\v!kader} % new + {\dodobackedbox\c!kaderoffset} + {\dodobackedbox\c!achtergrondoffset}} + +\def\dodobackedbox#1% {\setbox\framebox=\vbox {\dobackgroundbox\framebox \background \getvalue{\@@framed\c!achtergrond}% \color \getvalue{\@@framed\c!achtergrondkleur}% \raster \getvalue{\@@framed\c!achtergrondraster}% - \offset \getvalue{\@@framed\c!achtergrondoffset}% + \offset \getvalue{\@@framed#1}% \corner \getvalue{\@@framed\c!achtergrondhoek}% \radius \getvalue{\@@framed\c!achtergrondstraal}% \depth \getvalue{\@@framed\c!achtergronddiepte}\\}} @@ -1200,18 +1381,33 @@ %D \egroup %D \stopuitstellen +%D \macros +%D {framednoflines, framedlastlength} +%D %D It is possible to let the frame macro calculate the width %D of a centered box automatically (\type{\v!passend}). When %D doing so, we need to reshape the box: +\newcount\framednoflines +\newdimen\framedlastlength + +\def\resetshapeframebox% + {\framednoflines=0 + \framedlastlength=\!!zeropoint} + \def\doreshapeframedbox% {\beginofshapebox \unvcopy\framebox \endofshapebox \global\@@globalwidth=\!!zeropoint + \resetshapeframebox \reshapebox {\setbox0=\hbox {\strut\ifhbox\shapebox\unhbox\else\box\fi\shapebox}% + \global\advance\framednoflines by 1 + \ifdim\framedlastlength>\!!zeropoint\else + \global\framedlastlength=\wd0 + \fi \ifdim\wd0>\@@globalwidth \global\@@globalwidth=\wd0 \fi}% @@ -1230,7 +1426,13 @@ \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}% \innerflushshapebox}% \dp\framebox=\dp\strutbox - \fi} + \fi + \ifdim\framedlastlength=\!!zeropoint\global\framednoflines=\wd\framebox\fi + \ifcase\framednoflines\global\framednoflines=1\fi} + +%D The two variables \type {\framednoflines} and \type +%D {\framedlastlength} can be used in a second pass to +%D optimized framed material. %D The examples on the next page show how one can give the %D frame as well as the background an additional offset and @@ -1783,8 +1985,7 @@ {\ifoptimizethinrules\penalty500\fi} %D \macros -%D {startframedtext, setupframedtexts, -%D defineframedtext, start<>, <>} +%D {startframedtext, setupframedtexts, defineframedtext} %D %D The general framing command we discussed previously, is not %D entirely suited for what we call framed texts, as for @@ -2076,7 +2277,7 @@ {\bgroup \advance\hsize by -\rightskip \advance\hsize by -\leftskip - \setbox0=\hbox to \hsize + \setbox\scratchbox=\hbox to \hsize {\dimen4=.5ex \dimen6=-.5ex \advance\dimen4 by .5\linewidth @@ -2093,9 +2294,9 @@ \fi \color[\@@tllijnkleur] {\leaders\hrule\!!height\dimen4\!!depth\dimen6\hfill}}% - \ht0=\ht\strutbox - \dp0=\dp\strutbox - \noindent\box0 + \ht\scratchbox=\ht\strutbox + \dp\scratchbox=\dp\strutbox + \noindent\box\scratchbox \egroup} \def\dotoptextrule#1% @@ -2113,7 +2314,7 @@ \fi \dimen0=\dp\strutbox \ifdim\prevdepth<\dp\strutbox - \ifdim\prevdepth>\!!zeropoint + \ifdim\prevdepth>\!!zeropoint \advance\dimen0 by -\prevdepth \fi \fi @@ -2493,7 +2694,7 @@ \setupframed [\c!breedte=\v!passend, \c!hoogte=\v!ruim, - \c!offset=0.25ex, + \c!offset=0.25ex, % \defaultframeoffset \c!leeg=\v!nee, \c!kader=\v!aan, \c!bovenkader=, diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex index ea24cf852..e37f015fa 100644 --- a/tex/context/base/core-sec.tex +++ b/tex/context/base/core-sec.tex @@ -8,8 +8,8 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. \writestatus{loading}{Context Core Macros / Sectioning} @@ -37,7 +37,19 @@ 2: konec oddilu (sekce) -- \stopmessages -\unprotect +\startmessages italian library: structures + title: struttura + 1: inizio del blocco (sezione) -- + 2: fine del blocco (sezione) -- +\stopmessages + +\startmessages norwegian library: structures + title: struktur + 1: starten av blokk -- (seksjon) + 2: slutten av blokk -- (seksjon) +\stopmessages + +\unprotect \def\dodochecknummer#1#2#3% {\bgroup @@ -125,7 +137,7 @@ \huidigenummer[#1]% \rawreference{#2}{#3}{\hetnummer}} -% sectioning +% sectioning \newcount\nofsections @@ -152,7 +164,7 @@ \setvalue{\??by\v!per }{\v!tekst} \setvalue{\??by\v!per\v!tekst }{\v!tekst} \setvalue{\??by\v!per\v!alles }{\v!tekst} -\setvalue{\??by\v!per\v!pagina}{\v!tekst} % see footnotes +\setvalue{\??by\v!per\v!pagina}{\v!tekst} % see footnotes %%%%%%%%% old @@ -165,7 +177,7 @@ \def\stelsectiein% {\dodoubleargument\dostelsectiein} -%%%%%%%%% new, multilingual +%%%%%%%%% new, multilingual \def\dostelsectiein[#1][#2][#3]% {\ifthirdargument @@ -255,10 +267,10 @@ % \def\@@sectionconversion#1% % {\getvalue{\??cv\getvalue{\??se#1\@@sectieblok\c!conversie}}} -% suited for chinese too: +% suited for chinese too: \def\@@sectionconversion#1#2% a doublure with \@@shortsectionnumber - {\ifnum#2=0 0\else % else troubles with \uchar + {\ifnum#2=0 0\else % else troubles with \uchar \@EA\ifx\csname\??se#1\@@sectieblok\c!conversie\endcsname\relax \@EA\ifx\csname\??se#1\c!conversie\endcsname\relax #2% @@ -398,7 +410,7 @@ \@@sectionconversion{#1}{\@@sectionvalue{#1}}% \fi} -% suited for chinese too: +% suited for chinese too: \def\@@shortsectionnumber#1% {\@EA\ifx\csname\??se#1\@@sectieblok\c!conversie\endcsname\relax @@ -424,11 +436,12 @@ \def\dostartsectieblok#1#2% {\begingroup - \doaroundsectieblok{#1}% - \getvalue{\??sb#1}% - \expandafter\csname#2true\endcsname % vervangen door mode - \enablemode[\systemmodeprefix#1]% - \getvalue{\??sb\@@sectieblok\c!voor}% don't move + \doaroundsectieblok{#1}% % going to a new page or so + \getvalue{\??sb#1}% % set name of section block + \getsectieblokomgeving{#1}% % special settings, grouped + %\expandafter\csname#2true\endcsname % obsolete + \enablemode[\systemmodeprefix#1]% % can be used in conditionals + \getvalue{\??sb\@@sectieblok\c!voor}% this one is not to be moved! \showmessage{\m!structures}{1}{\@@sectieblokken}} \def\dostopsectieblok% @@ -443,10 +456,43 @@ \def\stelsectieblokin% {\dodoubleargument\dostelsectieblokin} -% We used to use the first char as id, but a counter is -% better, because in english we get a name clash. - -\newcounter\currentsectionblock +\long\def\setsectieblokomgeving#1#2% + {\long\setvalue{\??sb\s!do#1}{\do{#2}}} + +\def\getsectieblokomgeving#1% + {\let\do\firstofoneargument\getvalue{\??sb\s!do#1}} + +\setvalue{\e!start\e!sectieblokomgeving}% + {\dosingleargument\dostartsectieblokomgeving} + +\def\dostartsectieblokomgeving[#1]% evt \pushendofline \popendofline + {\long\def\do##1##2{\setsectieblokomgeving{#1}{##1##2}}% + \grabuntil{\e!stop\e!sectieblokomgeving}{\getvalue{\??sb\s!do#1}}} + +%D \starttypen +%D \startsectionblockenvironment[frontpart] +%D \setuppagenumbering[conversion=romannumerals] +%D \stopsectionblockenvironment +%D +%D \startsectionblockenvironment[bodypart] +%D \setuppagenumber[number=1] +%D \stopsectionblockenvironment +%D +%D \startsectionblockenvironment[frontpart] +%D \setuppagenumbering[conversion=character] +%D \stopsectionblockenvironment +%D +%D \starttext +%D \startfrontmatter \chapter{test} \stopfrontmatter +%D \startbodymatter \chapter{test} \stopbodymatter +%D \startappendices \chapter{test} \stopappendices +%D \stoptext +%D \stoptypen + +% We used to use the first char as id, but a counter is +% better, because in english we get a name clash. + +\newcounter\currentsectionblock \def\dodefinieersectieblok[#1][#2][#3]% {\getparameters @@ -457,7 +503,8 @@ %\c!na=, #3]% \expandafter\newif\csname if#2\endcsname - \doglobal\increment\currentsectionblock + \doglobal\increment\currentsectionblock + \setsectieblokomgeving{#1}{}% \setevalue{\??sb#1}% {\noexpand\dosetlocalsectieblok{\currentsectionblock}{#1}{#2}}% \setvalue{\e!start#2}% @@ -557,17 +604,17 @@ %\def\dolocalkopsetup#1% koppeling met standaard kopcommando / engels % {\forgetall -% \doifvaluesomething{\??ko#1\c!uitlijnen} +% \doifvaluesomething{\??ko#1\c!uitlijnen} % {\ExpandFirstAfter\steluitlijnenin[\getvalue{\??ko#1\c!uitlijnen}]}% -% \doifvaluesomething{\??ko#1\c!tolerantie} +% \doifvaluesomething{\??ko#1\c!tolerantie} % {\ExpandFirstAfter\steltolerantiein[\getvalue{\??ko#1\c!tolerantie}]}% % \def\\{\crlf\strut\ignorespaces}} \def\dolocalkopsetup#1% koppeling met standaard kopcommando / engels {\forgetall - \doifvaluesomething{\??ko#1\c!uitlijnen} + \doifvaluesomething{\??ko#1\c!uitlijnen} {\expanded{\steluitlijnenin[\getvalue{\??ko#1\c!uitlijnen}]}}% - \doifvaluesomething{\??ko#1\c!tolerantie} + \doifvaluesomething{\??ko#1\c!tolerantie} {\expanded{\steltolerantiein[\getvalue{\??ko#1\c!tolerantie}]}}% \def\\{\crlf\strut\ignorespaces}} @@ -651,7 +698,7 @@ \def\setsomeheadconversion#1#2% {\someheadconversionfalse - \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} + \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} {\def\someheadconversion{#2}} {\bepaalkopnummer[#1]% \@EA\ifx\csname\??se\@@sectie\@@sectieblok\c!kopconversie\endcsname\relax @@ -674,11 +721,11 @@ \def\someheadconversion% {\fullsectionnumber{#1}{\getvalue{\??se\@@sectie\@@sectieblok\c!kopconversie}}{#2}}% \fi - \fi}} + \fi}} -\def\writtenfullsectionnumber{\string\fullsectionnumber} -\def\ignoredfullsectionnumber#1#2#3{#3} -\let\storedfullsectionnumber\relax + \def\writtenfullsectionnumber {\string\fullsectionnumber} + \def\ignoredfullsectionnumber#1#2#3{#3} + \let \storedfullsectionnumber \relax \unexpanded\def\naturalfullsectionnumber#1#2#3{\sectiebloklabel{#1}{\getvalue{\??cv#2}{#3}}} \unexpanded\def\limitedfullsectionnumber#1#2#3{\getvalue{\??cv#2}{#3}} @@ -694,7 +741,7 @@ % \dodododosomekop IS NON GROUPED, SO WE NEED TO RESTORE !!!! % -% dit kan dus beter \everyaroundhead zijn +% dit kan dus beter \everyaroundhead zijn \def\dodododosomekop#1[#2]#3#4#5% % pas met \ExpandFirstAfter op bij twee||taligheid {\flushingcolumnfloatsfalse % #3=#1=redundant @@ -745,7 +792,7 @@ \getvalue{\e!volgende\@@sectie}% \getvalue{\??ko#1\c!tussen}% \ifkopnummer -\setsomeheadconversion{#1}{#4}% +\setsomeheadconversion{#1}{#4}% \ifsomeheadconversion \let\fullsectionnumber\naturalfullsectionnumber \doplaatskopnummertekst @@ -780,7 +827,7 @@ {\marking[#1]{#5}% \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} % rommelig omdat {\edef\finalsectionnumber{#4}} % #4 al is toegekend - {\bepaalkopnummer[#1]}% migreert naar 3e argument + {\bepaalkopnummer[#1]}% migreert naar 3e argument \expanded{\marking[#1\v!nummer]{\finalsectionnumber}}}% \writesection{#1}{#4}{#5}% \fi @@ -818,7 +865,7 @@ \resetsectionmarks[\@@sectie]% \marking[#1]{#5}% \doifelsevalue{\??ko#1\c!eigennummer}{\v!ja} - {\edef\finalsectionnumber{#4}} + {\edef\finalsectionnumber{#4}} {\bepaalkopnummer[#1]}% \expanded{\marking[#1\v!nummer]{\finalsectionnumber}}% \ExpandFirstAfter\soortpagina[\@@koppeling]% @@ -869,7 +916,7 @@ \def\doplaatskoptekst#1#2#3#4% {\beginheadplacement{#1}% - \setbox0=\hbox + \setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox {\getvalue{\??ko#1\c!commando} {} % no number {\doattributes @@ -897,7 +944,7 @@ \def\doplaatskopnummertekst#1#2#3#4#5% {\beginheadplacement{#1}% - \setbox0=\hbox + \setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox {\getvalue{\??ko#1\c!commando}% {\doattributes{\??ko#1}\c!letter\c!kleur {\doattributes{\??ko#1}\c!nummerletter\c!nummerkleur @@ -953,27 +1000,35 @@ \startsynchronisatie} \def\endheadplacement#1#2% - {\doifvaluenothing{\??ko#1\c!file}{\locationfalse}% + {\doifelsevalue{\??rf#1\c!status}{\v!start} + {\doifvaluenothing{\??ko#1\c!file}{\autocrossdocumentfalse}} + {\autocrossdocumentfalse}% + % no message needed here, should be a proper switch + \let\unknownreference\relax + % \ifdisplaysectionhead \let\headlastlinewidth\!!zeropoint \snaptogrid\hbox {\iflocation \ifautocrossdocument - \naarbox{\box0}[\getvalue{\??ko#1\c!file}::#1]% + \doifreferencefoundelse{\getvalue{\??ko#1\c!file}::#1} + {\edef\currentinnerreference{\s!aut:\currenttextreference}% stored in + \gotoouterlocation{}{\box0}} % text slot + {\hbox{\box0}}% \else \hbox{\box0}% \fi \else \hbox{\box0}% - \fi - \doflushfootnotes}% new + \fi}% + \doflushfootnotes % new, not really needed \endgraf \nointerlineskip \dosomebreak\nobreak #2% \else \strut - \doflushfootnotes % new + \doflushfootnotes % new, here since we're in par mode \iflocation \ifautocrossdocument \hhboxindent=\ifcontinuoushead\headlastlinewidth\else\!!zeropoint\fi @@ -1003,7 +1058,6 @@ \stopsynchronisatie \egroup \egroup - \doflushfootnotes % new, still needed? \ifdisplaysectionhead \doifvalue{\??ko#1\c!springvolgendein}{\v!nee}{\noindentation}% \else @@ -1088,8 +1142,8 @@ \def\plaatskopalinea#1#2% {\vbox - {\localkopsetup - \begstrut\doifsomething{#1}{#1\hskip\numberheaddistance}#2}} + {\localkopsetup + \begstrut\doifsomething{#1}{#1\hskip\numberheaddistance}#2}} \def\plaatskopnormaal#1#2% {\doifelsenothing{#1} @@ -1124,7 +1178,7 @@ \def\plaatskopintekst#1#2% {\bgroup - \localkopsetup % no stretch in distance + \localkopsetup % no stretch in distance \doifsomething{#1}{{#1}\kern\numberheaddistance}{\begstrut#2}% \egroup} @@ -1469,7 +1523,7 @@ [\v!sub\v!sub\v!sub\v!sub\v!paragraaf] [\c!breedte=7em] -% hm +% hm \stelnummeringin % na instellen hoofdteksten ! [\c!variant=\v!enkelzijdig, @@ -1485,7 +1539,7 @@ \c!tekstscheider=\tfskip, \c!status=\v!start, \c!commando=, - \c!letter=\v!normaal, + \c!letter=, % \v!normaal, % empty, otherwise conflict \c!kleur=] -\protect \endinput +\protect \endinput diff --git a/tex/context/base/core-syn.tex b/tex/context/base/core-syn.tex index ad19dc973..6b6678392 100644 --- a/tex/context/base/core-syn.tex +++ b/tex/context/base/core-syn.tex @@ -327,7 +327,9 @@ \dowritesort{#2}{#4}{#4}% \fi} -\def\dodefinieersorteren[#1][#2][#3]% +% if #3=\relax or \v!geen, then no command but still protected + +\def\dodefinieersorteren[#1][#2][#3]% {\getparameters[\??so#1] [%\c!commando=, % we test for defined ! \c!status=\v!start, @@ -336,11 +338,13 @@ \c!voor=, \c!na=\endgraf]% \presetheadtext[#2=\Word{#2}]% - \setvalue{\e!stel#2\e!in}[##1]% vervalt tzt + \setvalue{\e!stel#2\e!in}[##1]% vervalt tzt, soort oo-mode {\getparameters[\??so#1][##1]}% \ifthirdargument - \def#3##1% - {\getvalue{\??so:#1:##1}} + \ConvertConstantAfter\doifnot{#3}{\v!geen} + {\ifx#3\relax \else + \def#3##1{\getvalue{\??so:#1:##1}} + \fi}% \setvalue{#1}% {\dotripleempty\docomplexsort[\??so:#1:][#1]}% \else diff --git a/tex/context/base/core-tab.tex b/tex/context/base/core-tab.tex index b216cf448..58025c2b5 100644 --- a/tex/context/base/core-tab.tex +++ b/tex/context/base/core-tab.tex @@ -487,12 +487,13 @@ \def\EndTableParBox% {\removelastskip % added - %\MakeStrut{0pt}{\StrutDepthFactor\StrutUnit} % removed + %\MakeStrut{0pt}{\StrutDepthFactor\StrutUnit} % removed + \par \ifnum\prevgraf>0 \strut \vskip-\lineheight \fi % added \egroup % finishes the \vtop begun by \BeginTableParbox - \getboxheight\scratchdimen\of\box\scratchbox\relax % added - \ifdim\scratchdimen>\TABLEparheight % added - \global\TABLEparheight=\scratchdimen % added - \fi % added + \getboxheight\scratchdimen\of\box\scratchbox\relax % added + \ifdim\scratchdimen>\TABLEparheight % added + \global\TABLEparheight=\scratchdimen % added + \fi % added \box\scratchbox} %D To give an impression of what the (well documented) source diff --git a/tex/context/base/core-tbl.tex b/tex/context/base/core-tbl.tex index db534fca7..9776464ac 100644 --- a/tex/context/base/core-tbl.tex +++ b/tex/context/base/core-tbl.tex @@ -129,7 +129,15 @@ \newbox \tabulatebox -\let\handletabulatecharalign\empty +% [|lg{.}|] => \NG 12.34 \NC + +\gdef\handletabulatecharalign#1 % space delimited ! + {\edef\alignmentclass{\tabulatecolumn}% + \edef\alignmentcharacter{\getvalue{\@@tabalign@@\tabulatecolumn}}% + \ifcase\tabulatepass\or + \setfirstpasscharacteralign\checkalignment{#1}% + \fi % force hsize + \setsecondpasscharacteralign\checkalignment{#1}} \def\noftabcolumns{16} % quick and dirty stack @@ -685,6 +693,7 @@ \setbox0=\vbox % outside if because of line counting {\footnotesenabledfalse \let\tabulateindent\!!zeropoint +\trialtypesettingtrue \@EA\halign\@EA{\the\!!toksa\cr\tabulatecontent\crcr}}% \ifnum\nofautotabulate>0 \tabulatewidth\hsize diff --git a/tex/context/base/core-uti.tex b/tex/context/base/core-uti.tex index 721ca9e69..8bd490fb8 100644 --- a/tex/context/base/core-uti.tex +++ b/tex/context/base/core-uti.tex @@ -163,6 +163,8 @@ \def\checkutilityfile% {} +\def\currentutilityfilename{\jobname} + \long\def\doutilities#1#2#3#4#5% % introduceren in utility file {\restorecatcodes \resetutilities @@ -170,9 +172,13 @@ {\getvalue{\s!set##1}}% % in een pass worden gedaan, \processcommacommand[#1]\docommando % zie bijvoorbeeld lijsten \begingroup + \def\currentutilityfilename{#2}% \footnotesenabledfalse \doinpututilitiestrue \global\utilitydonefalse +\catcode`\\=\@@escape +\catcode`\{=\@@begingroup +\catcode`\}=\@@endgroup \catcode`\%=\@@comment\relax \pushendofline % geeft problemen zodra andere file wordt ingelezen \ifunprotectutilities % nog nodig ? diff --git a/tex/context/base/core-var.tex b/tex/context/base/core-var.tex index 2b17ef1c5..ab9c3d6b0 100644 --- a/tex/context/base/core-var.tex +++ b/tex/context/base/core-var.tex @@ -29,6 +29,7 @@ \newevery \everystarttext \relax \newevery \everystoptext \relax \newevery \everypagebody \relax +\newevery \everyforgetall \relax %D \macros %D {ifproductionrun} diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex index e85f23c7a..31a32f408 100644 --- a/tex/context/base/core-ver.tex +++ b/tex/context/base/core-ver.tex @@ -1,6 +1,6 @@ %D \module %D [ file=core-ver, -%D version=1996.06.01, +%D version=2000.05.09, %D title=\CONTEXT\ Core Macros, %D subtitle=Verbatim, %D author=Hans Hagen, @@ -33,6 +33,16 @@ 1: soubor -- neexistuje \stopmessages +\startmessages italian library: verbatims + title: verbatim + 1: il file -- non esiste +\stopmessages + +\startmessages norwegian library: verbatims + title: verbatim + 1: fil -- eksisterer ikke +\stopmessages + \unprotect % \type{ char} geeft bagger @@ -46,41 +56,104 @@ \def\prettyidentifier {TEX} \def\prettypalet {} +% \def\setupprettiesintype#1% +% {\edef\prettyidentifier{#1}% +% \doifinstringelse{\prettyidentifier}{tex,TEX} +% {\def\prettyidentifier{TEX}} +% {\doifinstringelse{\prettyidentifier}{perl,pl,pm,PERL,PL,PM} +% {\def\prettyidentifier{PL}} +% {\doifinstringelse{\prettyidentifier}{metapost,mp,metafont,mf,METAPOST,MP,METAFONT,MF} +% {\def\prettyidentifier{MP}} +% {\doifinstringelse{\prettyidentifier}{javascript,js,java,jv,JAVASCRIPT,JS,JAVA,JV} +% {\def\prettyidentifier{JV}} +% {\doifinstringelse{\prettyidentifier}{sql,SQL} +% {\def\prettyidentifier{SQL}} +% {\doifinstringelse{\prettyidentifier}{pascal,pas,PAS,modula,mod,MOD,delphi,DELPHI} +% {\def\prettyidentifier{PAS}} +% {\doifinstringelse{\prettyidentifier}{eiffel,e,E,EIFFEL} +% {\def\prettyidentifier{EIF}} +% {\doifinstringelse{\prettyidentifier}{xml,XML} +% {\def\prettyidentifier{XML}} +% {\def\prettyidentifier{TEX}}}}}}}}}% +% \doifundefined{setuppretty\prettyidentifier type}% +% {\bgroup +% \setbox0=\hbox % get rid of spaces when in-line \newpretty loading +% {\restorecatcodes % also needed when loading during \newpretty +% \startreadingfile % restore < and > if needed +% \lowercasestring verb-\prettyidentifier.tex\to\filename +% \readsysfile{\filename}{}{} +% \stopreadingfile}% +% \egroup}% +% \doifdefinedelse{setuppretty\prettyidentifier type}% +% {\def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}} +% {\let\setupprettytype=\relax}} + +\def\installprettytype% + {\dodoubleargument\doinstallprettytype} + +\def\doinstallprettytype[#1][#2]% map #1 onto #2 + {\uppercasestring#1\to\asciiA + \uppercasestring#2\to\asciiB + \setevalue{\??ty\??ty\asciiA}{\asciiB}} + \def\setupprettiesintype#1% - {\edef\prettyidentifier{#1}% - \doifinstringelse{\prettyidentifier}{tex,TEX} - {\def\prettyidentifier{TEX}} - {\doifinstringelse{\prettyidentifier}{perl,pl,pm,PERL,PL,PM} - {\def\prettyidentifier{PL}} - {\doifinstringelse{\prettyidentifier}{metapost,mp,metafont,mf,METAPOST,MP,METAFONT,MF} - {\def\prettyidentifier{MP}} - {\doifinstringelse{\prettyidentifier}{javascript,js,java,jv,JAVASCRIPT,JS,JAVA,JV} - {\def\prettyidentifier{JV}} - {\doifinstringelse{\prettyidentifier}{sql,SQL} - {\def\prettyidentifier{SQL}} - {\def\prettyidentifier{TEX}}}}}}% + {\uppercasestring#1\to\ascii + \edef\prettyidentifier% + {\ifundefined{\??ty\??ty\ascii}TEX% + \else\getvalue{\??ty\??ty\ascii}\fi}% \doifundefined{setuppretty\prettyidentifier type}% {\bgroup \setbox0=\hbox % get rid of spaces when in-line \newpretty loading {\restorecatcodes % also needed when loading during \newpretty \startreadingfile % restore < and > if needed \lowercasestring verb-\prettyidentifier.tex\to\filename - \readsysfile{\filename}{}{} + \readsysfile{\filename}{}{}% \stopreadingfile}% \egroup}% \doifdefinedelse{setuppretty\prettyidentifier type}% {\def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}} {\let\setupprettytype=\relax}} +\installprettytype [TEX] [TEX] + +\installprettytype [PERL] [PL] +\installprettytype [PL] [PL] +\installprettytype [PM] [PL] + +\installprettytype [METAPOST] [MP] +\installprettytype [METAFONT] [MP] +\installprettytype [MP] [MP] +\installprettytype [MF] [MP] + +\installprettytype [JAVASCRIPT] [JV] +\installprettytype [JAVA] [JV] +\installprettytype [JS] [JV] +\installprettytype [JV] [JV] + +\installprettytype [SQL] [SQL] + +\installprettytype [PASCAL] [PAS] +\installprettytype [PAS] [PAS] +\installprettytype [MODULA] [PAS] +\installprettytype [MOD] [PAS] + +\installprettytype [EIFFEL] [EIF] +\installprettytype [EIF] [EIF] +\installprettytype [E] [EIF] + +\installprettytype [XML] [XML] + \installnewpretty M {\setupprettiesintype {MP}\setupprettytype} \installnewpretty P {\setupprettiesintype {PL}\setupprettytype} \installnewpretty T {\setupprettiesintype{TEX}\setupprettytype} \installnewpretty J {\setupprettiesintype {JV}\setupprettytype} \installnewpretty S {\setupprettiesintype{SQL}\setupprettytype} +\installnewpretty W {\setupprettiesintype{PAS}\setupprettytype} % Wirth +\installnewpretty E {\setupprettiesintype{EIF}\setupprettytype} +\installnewpretty X {\setupprettiesintype{XML}\setupprettytype} \def\setupcommonverbatim#1% - {\def\verbatimfont{\tttf}% - \def\prettyidentifier{TEX}% + {\def\prettyidentifier{TEX}% % \doifelsevalue{#1\c!tekst}{\v!ja} {\naturaltextexttrue}{\naturaltextextfalse}% @@ -106,8 +179,8 @@ \s!unknown=>\setupprettiesintype{\getvalue{#1\c!optie}}% \let\obeycharacters=\setupprettytype \let\obeytabs=\ignoretabs]% - \edef\prettypalet% - {\prettyidentifier\getvalue{#1\c!palet}}} + \def\verbatimfont{\getvalue{#1\c!letter}}% + \setupverbatimcolor{#1}} %D The verbatim commands have a rather long and turbulent %D history. Most users of \CONTEXT\ probably will never use @@ -153,7 +226,7 @@ \unexpanded\def\type% {\bgroup - \getvalue{\getvalue{\??ty\c!kleur}}% hm, assumes \somecolor + \verbatimcolor \catcode`\<=\@@other \catcode`\>=\@@other \futurelet\next\dotype} @@ -321,10 +394,36 @@ \fi \fi} +%\def\setupcommandsintype#1% +% {\setupgroupedtype +% \edef\!!stringa{\getvalue{#1\c!escape}}% +% \@EA\catcode\@EA`\!!stringa=\@@escape} + \def\setupcommandsintype#1% {\setupgroupedtype - \edef\!!stringa{\getvalue{#1\c!escape}}% - \@EA\catcode\@EA`\!!stringa=\@@escape} + \edef\\{\getvalue{#1\c!escape}}% + \letvalue{\\}=\\% for instance \/=/ + \@EA\catcode\@EA`\\=\@@escape + \def\BTEX##1\ETEX##2% ##2 gobbles active space + {\naturaltextext##1\unskip\relax}} + +%D The following lines show what happens when we set +%D \type {option=commands}. +%D +%D \startbuffer +%D \starttyping +%D test//test test/BTEX \footnote{test test test}/ETEX test +%D test//test test/BTEX \footnote{test test test}/ETEX test +%D test test test/BTEX \bf(nota bene)/ETEX test +%D test test test /BTEX \bf(nota bene)/ETEX test +%D \stoptyping +%D \stopbuffer +%D +%D % \bgroup\setuptyping[option=commands]\getbuffer\egroup +%D +%D this was keyed in as: +%D +%D \typebuffer \def\setupslantedtype% {\setupgroupedtype @@ -357,7 +456,7 @@ \def\initializetype% {\let\obeylines=\ignorelines - \setupcommonverbatim{\??ty}% + \setupcommonverbatim\??ty \setupinlineverbatim} %D \macros @@ -373,6 +472,7 @@ \setuptype [\c!spatie=\v!uit, \c!kleur=, + \c!letter=\tttf, \c!pagina=\v!nee, \c!tab=\v!nee, \c!optie=\v!normaal] @@ -514,7 +614,11 @@ \v!geen=>\scratchskip=\!!zeropoint, \s!unknown=>\scratchskip=\commalistelement]% \ifgridsnapping - \edef\verbatimbaselineskip{\the\baselineskip}% + \ifdim\scratchskip=.5\baselineskip\relax + \edef\verbatimbaselineskip{\the\scratchskip}% new + \else + \edef\verbatimbaselineskip{\the\baselineskip}% + \fi \else \edef\verbatimbaselineskip{\the\scratchskip}% \fi @@ -527,12 +631,12 @@ \def\dostarttyping#1% {\getvalue{\??tp#1\c!voor}% \startopelkaar % includes \bgroup - \startcolor[\getvalue{\??tp#1\c!kleur}]% \initializetyping{#1}% + \startverbatimcolor \expandafter\processdisplayverbatim\expandafter{\s!stop#1}} \def\dostoptyping#1% - {\stopcolor + {\stopverbatimcolor \stopopelkaar % includes \egroup \getvalue{\??tp#1\c!na}% \doifvalue{\??tp#1\c!springvolgendein}{\v!nee}{\noindentation}} @@ -584,9 +688,10 @@ \c!optie=\v!geen, \c!palet=colorpretty, \c!tekst=\v!nee, + \c!letter=\tttf, \c!icommando=\ttsl, \c!vcommando=, - \c!ccommando=\tf, + \c!ccommando=\tttf, \c!springvolgendein=\v!ja, \c!marge=\!!zeropoint, \c!evenmarge=\!!zeropoint, @@ -614,7 +719,7 @@ \def\presettyping[#1][#2]% {\copyparameters [\??tp#1][\??tp] - [\c!voor,\c!na,\c!spatie,\c!pagina,\c!tab,\c!kleur, + [\c!voor,\c!na,\c!spatie,\c!pagina,\c!tab,\c!kleur,\c!letter, \c!tekst,\c!icommando,\c!vcommando,\c!ccommando, \c!optie,\c!palet,\c!marge,\c!evenmarge,\c!onevenmarge, \c!springvolgendein,\c!blanko,\c!escape]% @@ -632,13 +737,20 @@ \definetyping[\v!typen] -\definetyping[MP] [\c!optie=MP] -\definetyping[PL] [\c!optie=PL] -\definetyping[PM] [\c!optie=PL] -\definetyping[JS] [\c!optie=JS] -\definetyping[JV] [\c!optie=JV] -\definetyping[SQL][\c!optie=SQL] -\definetyping[TEX][\c!optie=TEX] +\definetyping[MP] [\c!optie=MP] +\definetyping[PL] [\c!optie=PL] +\definetyping[PM] [\c!optie=PL] +\definetyping[JS] [\c!optie=JS] +\definetyping[JV] [\c!optie=JV] +\definetyping[SQL] [\c!optie=SQL] +\definetyping[TEX] [\c!optie=TEX] +\definetyping[PAS] [\c!optie=PAS] +\definetyping[PASCAL][\c!optie=PAS] +\definetyping[MOD] [\c!optie=PAS] +\definetyping[MODULA][\c!optie=PAS] +\definetyping[DELPHI][\c!optie=PAS] +\definetyping[EIFFEL][\c!optie=EIF] +\definetyping[XML] [\c!optie=XML] %D We use the \CONTEXT\ color system for switching to and from %D color mode. We can always redefine these colors afterwards. @@ -669,29 +781,65 @@ % ---> naar verb-* ? of predefine als undefined? -\definepalet [TEXcolorpretty] [colorpretty] -\definepalet [TEXgraypretty] [graypretty] -\definepalet [PLcolorpretty] [colorpretty] -\definepalet [PLgraypretty] [graypretty] -\definepalet [PMcolorpretty] [colorpretty] -\definepalet [PMgraypretty] [graypretty] -\definepalet [MPcolorpretty] [colorpretty] -\definepalet [MPgraypretty] [graypretty] -\definepalet [JVcolorpretty] [colorpretty] -\definepalet [JVgraypretty] [graypretty] -\definepalet [JScolorpretty] [colorpretty] -\definepalet [JSgraypretty] [graypretty] -\definepalet [SQLcolorpretty] [colorpretty] -\definepalet [SQLgraypretty] [graypretty] +\definepalet [TEXcolorpretty] [colorpretty] +\definepalet [TEXgraypretty] [graypretty] +\definepalet [PLcolorpretty] [colorpretty] +\definepalet [PLgraypretty] [graypretty] +\definepalet [PMcolorpretty] [colorpretty] +\definepalet [PMgraypretty] [graypretty] +\definepalet [MPcolorpretty] [colorpretty] +\definepalet [MPgraypretty] [graypretty] +\definepalet [JVcolorpretty] [colorpretty] +\definepalet [JVgraypretty] [graypretty] +\definepalet [JScolorpretty] [colorpretty] +\definepalet [JSgraypretty] [graypretty] +\definepalet [SQLcolorpretty] [colorpretty] +\definepalet [SQLgraypretty] [graypretty] +\definepalet [PAScolorpretty] [colorpretty] +\definepalet [PASgraypretty] [graypretty] +\definepalet [EIFcolorpretty] [colorpretty] +\definepalet [EIFgraypretty] [graypretty] +\definepalet [XMLcolorpretty] [colorpretty] +\definepalet [XMLgraypretty] [graypretty] + +% Some real in-depth knowlegde of palets: `palet:color' it is! %D We can use some core color commands. These are faster than %D the standard color switching ones and work ok on a line by %D line basis. - -% Some real in-depth knowlegde of palets: `palet:color' it is! - -\def\beginofpretty[#1]{\startcolormode{\prettypalet:#1}} -\def\endofpretty {\stopcolormode} +%D +%D \starttypen +%D \def\setupverbatimcolor#1% +%D {\edef\prettypalet{\prettyidentifier\getvalue{#1\c!palet}}% +%D \def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}% +%D \def\endofpretty {\stopcolormode}} +%D \stoptypen +%D +%D Since we support a global color too, the folowing +%D definition is better: + +\def\setupverbatimcolor#1% fast and local versus slow and global + {\doifelsevaluenothing{#1\c!kleur} + {\def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}% + \let\endofpretty \stopcolormode + \let\startverbatimcolor \relax + \let\stopverbatimcolor \relax + \let\verbatimcolor \relax} + {\def\beginofpretty[##1]{\startcolor[\prettypalet:##1]}% + \let\endofpretty \stopcolor + \def\startverbatimcolor{\startcolor[\getvalue{#1\c!kleur}]}% + \let\stopverbatimcolor \stopcolor + \def\verbatimcolor {\getvalue{\getvalue{#1\c!kleur}}}}% + \doifelsevaluenothing{#1\c!palet} + {\let\prettypalet\empty + \let\endofpretty\relax + \def\beginofpretty[##1]{}} + {\edef\prettypalet{\prettyidentifier\getvalue{#1\c!palet}}}} + +\let\prettypalet \empty +\let\startverbatimcolor\relax +\let\stopverbatimcolor \relax +\let\verbatimcolor \relax %D In the verbatim module, there are some examples given of %D the more obscure features of the verbatim environments. @@ -802,23 +950,28 @@ \presettyping[\v!file][] -\def\typefile#1% - {\getvalue{\??tp\v!file\c!voor}% - \doiflocfileelse{\pathplusfile\f!currentpath{#1}} +\definecomplexorsimple\typefile + +\def\simpletypefile% + {\complextypefile[\v!file]} + +\def\complextypefile[#1]#2% + {\getvalue{\??tp#1\c!voor}% + \doiflocfileelse{\pathplusfile\f!currentpath{#2}} {\startopelkaar % includes \bgroup - \startcolor[\getvalue{\??tp\v!file\c!kleur}]% - \doifinset{\getvalue{\??tp\v!file\c!optie}}{\v!commandos,\v!schuin,\v!normaal} - {\setuptyping[\v!file][\c!optie=\v!geen]}% - \doifvalue{\??tp\v!file\c!optie}{\v!kleur} - {\expandafter\aftersplitstring#1\at.\to\prettyidentifier - \letvalue{\??tp\v!file\c!optie}=\prettyidentifier}% - \initializetyping\v!file - \processfileverbatim{\pathplusfile\f!currentpath{#1}}% - \stopcolor + \doifinset{\getvalue{\??tp#1\c!optie}}{\v!commandos,\v!schuin,\v!normaal} + {\setuptyping[#1][\c!optie=\v!geen]}% + \doifvalue{\??tp#1\c!optie}{\v!kleur} + {\expandafter\aftersplitstring#2\at.\to\prettyidentifier + \letvalue{\??tp#1\c!optie}=\prettyidentifier}% + \initializetyping{#1}% + \startverbatimcolor + \processfileverbatim{\pathplusfile\f!currentpath{#2}}% + \stopverbatimcolor \stopopelkaar} % includes \egroup - {{\tttf[\makemessage{\m!verbatims}{1}{#1}]}% - \showmessage{\m!verbatims}{1}{#1}}% - \getvalue{\??tp\v!file\c!na}} + {{\tttf[\makemessage{\m!verbatims}{1}{#2}]}% + \showmessage{\m!verbatims}{1}{#2}}% + \getvalue{\??tp#1\c!na}} %D \macros %D {filename} diff --git a/tex/context/base/enco-ans.tex b/tex/context/base/enco-ans.tex index 79bb55d67..7936a9b18 100644 --- a/tex/context/base/enco-ans.tex +++ b/tex/context/base/enco-ans.tex @@ -3,9 +3,9 @@ %D version=1995.1.1, %D title=\CONTEXT\ Encoding Macros, %D subtitle=\YandY\ texnansi Encoding, -%D author=J. Hagen, +%D author=Hans Hagen, %D date=\currentdate, -%D copyright=J. Hagen] +%D copyright=Hans Hagen] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for diff --git a/tex/context/base/enco-chi.tex b/tex/context/base/enco-chi.tex index 2e420a9f7..5addd57e9 100644 --- a/tex/context/base/enco-chi.tex +++ b/tex/context/base/enco-chi.tex @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% actually this is also a filter -> enco-fcn.tex + %D This is an experimental definition. Since we are dealing %D with unicode's, the registered values are not saved, so %D actually we're dealing with an pseudo encoding. The digits @@ -126,6 +128,28 @@ \defineudigit 10000* 184 85 \defineudigit 100000000* 187 245 +\defineudigit 20 164 220 +\defineudigit 21 164 64 +\defineudigit 22 164 71 +\defineudigit 23 164 84 +\defineudigit 24 165 124 +\defineudigit 25 164 173 +\defineudigit 26 164 187 +\defineudigit 27 164 67 +\defineudigit 28 164 75 +\defineudigit 29 164 69 + +\defineudigit 30 164 202 +\defineudigit 31 164 64 +\defineudigit 32 164 71 +\defineudigit 33 164 84 +\defineudigit 34 165 124 +\defineudigit 35 164 173 +\defineudigit 36 164 187 +\defineudigit 37 164 67 +\defineudigit 38 164 75 +\defineudigit 39 164 69 + \stopencoding \startencoding[gbk] @@ -210,6 +234,28 @@ \defineudigit 10000* 200 102 \defineudigit 100000000* 210 218 +\defineudigit 20 216 165 +\defineudigit 21 210 187 +\defineudigit 22 182 254 +\defineudigit 23 200 253 +\defineudigit 24 203 196 +\defineudigit 25 206 229 +\defineudigit 26 193 249 +\defineudigit 27 198 223 +\defineudigit 28 176 203 +\defineudigit 29 190 197 + +\defineudigit 30 216 166 +\defineudigit 31 210 187 +\defineudigit 32 182 254 +\defineudigit 33 200 253 +\defineudigit 34 203 196 +\defineudigit 35 206 229 +\defineudigit 36 193 249 +\defineudigit 37 198 223 +\defineudigit 38 176 203 +\defineudigit 39 190 197 + \stopencoding \endinput diff --git a/tex/context/base/enco-ec.tex b/tex/context/base/enco-ec.tex index 611523885..83cbf0174 100644 --- a/tex/context/base/enco-ec.tex +++ b/tex/context/base/enco-ec.tex @@ -173,8 +173,8 @@ \definecharacter OE 215 \definecharacter o 248 \definecharacter O 216 -\definecharacter sz 255 % was 223 -\definecharacter SS 255 % was 223 +\definecharacter sz 255 +\definecharacter SS 223 \definecharacter th 254 \definecharacter TH 222 diff --git a/tex/context/base/enco-fde.tex b/tex/context/base/enco-fde.tex new file mode 100644 index 000000000..fe6ea0312 --- /dev/null +++ b/tex/context/base/enco-fde.tex @@ -0,0 +1,118 @@ +%D \module +%D [ file=enco-fde, +%D version=2000.08.20, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=German Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D These definitions used to be part of lang-ger.tex. + +\unprotect + +\startlanguagespecifics[\s!de] + + \installcompoundcharacter "a {\moveaccent{-.1ex}\"a\midworddiscretionary} + \installcompoundcharacter "e {\moveaccent{-.1ex}\"e\midworddiscretionary} + \installcompoundcharacter "i {\moveaccent{-.1ex}\"\i\midworddiscretionary} + \installcompoundcharacter "o {\moveaccent{-.1ex}\"o\midworddiscretionary} + \installcompoundcharacter "u {\moveaccent{-.1ex}\"u\midworddiscretionary} + \installcompoundcharacter "s {\sz} + \installcompoundcharacter "z {\sz} + + + \installcompoundcharacter "A {\smashaccent\"A} + \installcompoundcharacter "E {\smashaccent\"E} + \installcompoundcharacter "I {\smashaccent\"I} + \installcompoundcharacter "O {\smashaccent\"O} + \installcompoundcharacter "U {\smashaccent\"U} + \installcompoundcharacter "Z {SZ} + \installcompoundcharacter "S {SS} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!de] + + \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} + \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} + \installcompoundcharacter "ll {\discretionary{ll-}{l}{ll}} + \installcompoundcharacter "mm {\discretionary{mm-}{m}{mm}} + \installcompoundcharacter "nn {\discretionary{nn-}{n}{nn}} + \installcompoundcharacter "pp {\discretionary{pp-}{p}{pp}} + \installcompoundcharacter "rr {\discretionary{rr-}{r}{rr}} + \installcompoundcharacter "tt {\discretionary{tt-}{t}{tt}} + + \installcompoundcharacter "CK {\discretionary {K-}{K}{CK}} + \installcompoundcharacter "FF {\discretionary{FF-}{F}{FF}} + \installcompoundcharacter "LL {\discretionary{LL-}{L}{LL}} + \installcompoundcharacter "MM {\discretionary{MM-}{M}{MM}} + \installcompoundcharacter "NN {\discretionary{NN-}{N}{NN}} + \installcompoundcharacter "PP {\discretionary{PP-}{P}{PP}} + \installcompoundcharacter "RR {\discretionary{RR-}{R}{RR}} + \installcompoundcharacter "TT {\discretionary{TT-}{T}{TT}} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!de] + + \installcompoundcharacter "` {\handlequotation\c!leftquotation} + \installcompoundcharacter "' {\handlequotation\c!rightquotation} + \installcompoundcharacter ". {\kern.1em\ignorespaces} + + \def\setupDElanguage% + {\setuplanguage + [\s!de] + [\c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\leftsubguillemot, + \c!rightsubsentence=\rightsubguillemot]} + + \installcompoundcharacter "< {{\setupDElanguage|<|}} + \installcompoundcharacter "> {{\setupDElanguage|>|}} + +\stoplanguagespecifics + +%D An experimental hack: + +\startencoding[pdfdoc] + \startlanguagespecifics[\s!de]% hm, a % is needed + \defineactivecharacter " {\"} % no {\simplifiedcompoundcharacter"} + \stoplanguagespecifics +\stopencoding + +\startencoding[ec] + \startlanguagespecifics[\s!de]% + \installcompoundcharacter "a {\"a} + \installcompoundcharacter "e {\"e} + \installcompoundcharacter "i {\"\i} + \installcompoundcharacter "o {\"o} + \installcompoundcharacter "u {\"u} + \installcompoundcharacter "A {\"A} + \installcompoundcharacter "E {\"E} + \installcompoundcharacter "I {\"I} + \installcompoundcharacter "O {\"O} + \installcompoundcharacter "U {\"U} + \stoplanguagespecifics +\stopencoding + +\startencoding[texnansi] + \startlanguagespecifics[\s!de]% + \installcompoundcharacter "a {\"a} + \installcompoundcharacter "e {\"e} + \installcompoundcharacter "i {\"\i} + \installcompoundcharacter "o {\"o} + \installcompoundcharacter "u {\"u} + \installcompoundcharacter "A {\"A} + \installcompoundcharacter "E {\"E} + \installcompoundcharacter "I {\"I} + \installcompoundcharacter "O {\"O} + \installcompoundcharacter "U {\"U} + \stoplanguagespecifics +\stopencoding + +\protect \endinput diff --git a/tex/context/base/enco-fpl.tex b/tex/context/base/enco-fpl.tex new file mode 100644 index 000000000..acf3caa50 --- /dev/null +++ b/tex/context/base/enco-fpl.tex @@ -0,0 +1,90 @@ +%D \module +%D [ file=enco-fpl, +%D version=2000.08.20, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Polish Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D These definitions used to be part of lang-sla.tex. + +\unprotect + +\startlanguagespecifics[\s!pl] + + \installcompoundcharacter /a {\k a} + \installcompoundcharacter /c {\'c} + \installcompoundcharacter /e {\k e} + \installcompoundcharacter /l {\l} + \installcompoundcharacter /n {\'n} + \installcompoundcharacter /o {\'o} + \installcompoundcharacter /s {\'s} + \installcompoundcharacter /x {\'z} + \installcompoundcharacter /z {\.z} + \installcompoundcharacter /A {\k A} + \installcompoundcharacter /C {\'C} + \installcompoundcharacter /E {\k E} + \installcompoundcharacter /L {\L} + \installcompoundcharacter /N {\'N} + \installcompoundcharacter /O {\'O} + \installcompoundcharacter /S {\'S} + \installcompoundcharacter /X {\'Z} + \installcompoundcharacter /Z {\.Z} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!pl] + + \installcompoundcharacter /, {\handlequotation\c!leftquotation} + \installcompoundcharacter /' {\handlequotation\c!rightquotation} + + \def\setupPLlanguage% + {\setuplanguage + [\s!pl] + [\c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\leftsubguillemot, + \c!rightsubsentence=\rightsubguillemot]} + + \installcompoundcharacter /< {{\setupPLlanguage|<|}} + \installcompoundcharacter /> {{\setupPLlanguage|>|}} + + \installcompoundcharacter /- {|-|} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!pl] + + \definesortkey {/a}{a}{a}{\k a} + \definesortkey {/A}{a}{a}{\k a} + \definesortkey {/c}{c}{a}{\'c} + \definesortkey {/C}{c}{a}{\'c} + \definesortkey {/e}{e}{a}{\k e} + \definesortkey {/E}{e}{a}{\k e} + \definesortkey {/l}{l}{a}{\l } + \definesortkey {/L}{l}{a}{\l } + \definesortkey {/n}{n}{a}{\'n} + \definesortkey {/N}{n}{a}{\'n} + \definesortkey {/o}{o}{a}{\'o} + \definesortkey {/O}{o}{a}{\'o} + \definesortkey {/s}{s}{a}{\'s} + \definesortkey {/S}{s}{a}{\'s} + \definesortkey {/x}{z}{a}{\'x} + \definesortkey {/X}{z}{a}{\'x} + \definesortkey {/z}{z}{b}{\.z} + \definesortkey {/Z}{z}{b}{\.z} + +\stoplanguagespecifics + +\startencoding[pdfdoc] + \startlanguagespecifics[pl]% hm + \defineactivecharacter / {\simplifiedcompoundcharacter/} + \stoplanguagespecifics +\stopencoding + +\protect \endinput diff --git a/tex/context/base/enco-fro.tex b/tex/context/base/enco-fro.tex new file mode 100644 index 000000000..8b12dfefd --- /dev/null +++ b/tex/context/base/enco-fro.tex @@ -0,0 +1,33 @@ +%D \module +%D [ file=enco-fro, +%D version=2000.08.20, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Romanian Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D These definitions used to be part of lang-ita.tex. + +\unprotect + +\startlanguagespecifics[\s!ro] + + \installcompoundcharacter "a {\u{a}} + \installcompoundcharacter "i {\^{\i}} + \installcompoundcharacter "s {\c{s}} + \installcompoundcharacter "t {\c{t}} + \installcompoundcharacter "A {\^{a}} + \installcompoundcharacter "I {\^{I}} + \installcompoundcharacter "S {\c{S}} + \installcompoundcharacter "T {\c{T}} + \installcompoundcharacter "` {\handlequotation\c!leftquotation} + \installcompoundcharacter "' {\handlequotation\c!rightquotation} + +\stoplanguagespecifics + +\protect \endinput diff --git a/tex/context/base/enco-ibm.tex b/tex/context/base/enco-ibm.tex index 382c87795..24c7cfb9d 100644 --- a/tex/context/base/enco-ibm.tex +++ b/tex/context/base/enco-ibm.tex @@ -57,7 +57,7 @@ \stopregime -\enableregime[windows] +\enableregime[ibm] %D The next section will be changed as soon as we get grip on %D the other encodings. diff --git a/tex/context/base/enco-il2.tex b/tex/context/base/enco-il2.tex index 25767ea4f..4230f04bc 100644 --- a/tex/context/base/enco-il2.tex +++ b/tex/context/base/enco-il2.tex @@ -3,9 +3,9 @@ %D version=1998.12.1, %D title=\CONTEXT\ Encoding Macros, %D subtitle=Czech and Slovak ISO Latin 2 Encoding, -%D author=J. Hagen, +%D author=Hans Hagen, %D date=\currentdate, -%D copyright=J. Hagen] +%D copyright=Hans Hagen] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex index 874114eb9..533852389 100644 --- a/tex/context/base/enco-ini.tex +++ b/tex/context/base/enco-ini.tex @@ -82,10 +82,25 @@ 3: nezname kodovani -- \stopmessages +\startmessages italian library: encodings + title: codifica + 1: codifica -- + 2: codifica -- caricata + 3: codifica sconosciuta -- +\stopmessages + +\startmessages norwegian library: encodings + title: koding + 1: koding -- + 2: koding -- er lest inn + 3: ukjent koding -- +\stopmessages + %D First we define a few local or not yet initialized constants. \def\@map@{@m@ap@} % mapping prefix \def\@reg@{@r@eg@} % regime prefix +\def\@fha@{@f@ha@} % font prefix \ifx\currentlanguage\undefined \let\currentlanguage\s!en \fi @@ -125,13 +140,13 @@ %D low level implementation may change. \def\startregime[#1]% - {\pushmacro\characterregime + {\localpushmacro\characterregime \edef\characterregime{@#1@}% \doifundefined{\@reg@\characterregime} {\expanded{\newtoks\csname\@reg@\characterregime\endcsname}}} \def\stopregime% - {\popmacro\characterregime} + {\localpopmacro\characterregime} %\long\def\startregime[#1]#2\stopregime{} @@ -800,6 +815,105 @@ \stoptextrule \egroup} +%D {\em The next section is experimental and implemnts font +%D specific features, like hanging punctuation.} + +\def\startfonthandling[#1]% + {\def\fonthandling{#1}% + \doifundefined{\@fha@\fonthandling} + {\expanded{\newtoks\csname\@fha@\fonthandling\endcsname}}} + +\def\stopfonthandling% + {\let\fonthandling\empty} + +\def\setfonttoks% + {\@EA\let\@EA\fonttoks\csname\@fha@\fonthandling\endcsname} + +\def\definefonthandling% + {\dotripleempty\dodefinefonthandling} + +\def\dodefinefonthandling[#1][#2][#3]% + {\setvalue{\@fha@\@fha@#1}{#2}% + \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} + +\def\setupfonthandling% + {\dodoubleempty\dosetupfonthandling} + +\def\dosetupfonthandling[#1][#2]% + {\getparameters[\@fha@\@fha@#1][#2]} + +\def\doenablehandling#1% + {\doifdefined{\@fha@#1}{\@EA\the\csname\@fha@#1\endcsname}} + +\def\enablehandling[#1]% + {\doifdefinedelse{\@fha@\@fha@#1}% + {\setprotrudingfactor + {\getvalue{\@fha@\@fha@#1\c!links}} + {\getvalue{\@fha@\@fha@#1\c!rechts}}% + \edef\fonthandling{\getvalue{\@fha@\@fha@#1}}% + \@EA\rawprocesscommalist\@EA[\fonthandling]\doenablehandling} + {\doenablehandling{#1}}} + +\ifx\undefined\pdfprotrudechars % we don't use pdftex + + \def\defineprotrudefactor#1 #2 #3 {} + \def\setprotrudingfactor #1#2{} + \def\enableprotruding {} + \def\disableprotruding {} + +\else + + \newdimen\lproddimen + \newdimen\rproddimen + \let\prodfont\font + + \def\enableprotruding {\pdfprotrudechars=2 } + \def\disableprotruding{\pdfprotrudechars=0 } + + \appendtoks \disableprotruding \to \everyforgetall % Here or not here? + + \def\setprotrudingfactor#1#2% + {\lproddimen=#1pt\multiply\lproddimen\!!thousand\divide\lproddimen \!!maxcard\relax + \rproddimen=#2pt\multiply\rproddimen\!!thousand\divide\rproddimen \!!maxcard\relax} + + \setprotrudingfactor{1}{1} + + \def\dodefineprotrudefactor#1 #2 #3 % + {\scratchdimen=#2\lproddimen\lpcode\prodfont#1=\number\scratchdimen + \scratchdimen=#3\rproddimen\rpcode\prodfont#1=\number\scratchdimen} + + \def\dodefinefonthandling[#1][#2][#3]% + {\setvalue{\@fha@\@fha@#1}{#2}% + \getparameters[\@fha@\@fha@#1][\c!links=1,\c!rechts=1,#3]} + + \def\defineprotrudefactor#1 #2 #3 % + {\setfonttoks + \doifnumberelse{\string#1} + {\appendtoks\dodefineprotrudefactor #1 #2 #3 \to\fonttoks} % + {\appendtoks\dodefineprotrudefactor`#1 #2 #3 \to\fonttoks}}% + + \def\defineprotrudefactor#1 #2 #3 % + {\setfonttoks + \doifnumberelse{\string#1} + {\appendtoks\dodefineprotrudefactor #1 #2 #3 \to\fonttoks} + {\doifcharactercodeelse{#1} + {\@EA\appendtoks\@EA\dodefineprotrudefactor\charactercode #2 #3 \to\fonttoks} + {\appendtoks\dodefineprotrudefactor`#1 #2 #3 \to\fonttoks}}} + +\fi + +%D {\em Another experiment: named glyphs. Incomplete yet.} + +\def\definecharactercode#1 #2 % + {\setvalue{\characterencoding-#1}{#2}} + +\def\doifcharactercodeelse#1#2#3% + {\doifdefinedelse{\characterencoding-\string#1} + {\edef\charactercode{\getvalue{\characterencoding-#1}\space}#2} + {#3}} + +%D {\em So far for the experiment.} + %D \macros %D {everyuppercase, EveryUppercase, %D everyuppercase, EveryUppercase} diff --git a/tex/context/base/enco-pdf.tex b/tex/context/base/enco-pdf.tex index a4fbfdac2..c8f03e3d0 100644 --- a/tex/context/base/enco-pdf.tex +++ b/tex/context/base/enco-pdf.tex @@ -3,9 +3,9 @@ %D version=1995.1.1, %D title=\CONTEXT\ Encoding Macros, %D subtitle=\YandY\ texnansi Encoding, -%D author=J. Hagen, +%D author=Hans Hagen, %D date=\currentdate, -%D copyright=J. Hagen] +%D copyright=Hans Hagen] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for diff --git a/tex/context/base/enco-pol.tex b/tex/context/base/enco-pol.tex index 40c9dfa86..283d074a8 100644 --- a/tex/context/base/enco-pol.tex +++ b/tex/context/base/enco-pol.tex @@ -3,7 +3,7 @@ %D version=1999.28.8, %D title=\CONTEXT\ Encoding Macros, %D subtitle=Polish Mixed Encoding, -%D author=Taco Hoekwater, +%D author={Taco Hoekwater \& Hans Hagen}, %D date=\currentdate, %D copyright=Hans Hagen] %C diff --git a/tex/context/base/enco-pro.tex b/tex/context/base/enco-pro.tex new file mode 100644 index 000000000..b245554e3 --- /dev/null +++ b/tex/context/base/enco-pro.tex @@ -0,0 +1,72 @@ +%D \module +%D [ file=enco-pro, +%D version=2000.29.9, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Protruding Factors, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is an experimental definition file. The protruding +%D values we use here are those found from \THANH's thesis. + +\unprotect + +\definecharactercode leftupperninequote 92 +\definecharactercode rightupperninequote 34 +\definecharactercode endash 123 +\definecharactercode emdash 124 + +\startfonthandling[defpunc] + + \defineprotrudefactor ! 0 .2 + \defineprotrudefactor ' 0 .7 + \defineprotrudefactor ` .7 0 + \defineprotrudefactor ( .05 0 + \defineprotrudefactor ) 0 .05 + \defineprotrudefactor , 0 .7 + \defineprotrudefactor - 0 .7 + \defineprotrudefactor . 0 .7 + \defineprotrudefactor : 0 .5 + \defineprotrudefactor ; 0 .5 + + \defineprotrudefactor rightupperninequote 0 .5 + \defineprotrudefactor leftupperninequote .5 0 + \defineprotrudefactor endash 0 .3 + \defineprotrudefactor emdash 0 .2 + +\stopfonthandling + +\startfonthandling[defalph] + + \defineprotrudefactor A .05 .05 + \defineprotrudefactor F 0 .05 + \defineprotrudefactor J .05 0 + \defineprotrudefactor K 0 .05 + \defineprotrudefactor L 0 .05 + \defineprotrudefactor T .05 .05 + \defineprotrudefactor V .05 .05 + \defineprotrudefactor W .05 .05 + \defineprotrudefactor X .05 .05 + \defineprotrudefactor Y .05 .05 + + \defineprotrudefactor k 0 .05 + \defineprotrudefactor r 0 .05 + \defineprotrudefactor t 0 .05 + \defineprotrudefactor v .05 .05 + \defineprotrudefactor w .05 .05 + \defineprotrudefactor x .05 .05 + \defineprotrudefactor y .05 .05 + +\stopfonthandling + +\definefonthandling [normal] [defpunc,defalph] +\definefonthandling [slanted] [defpunc] [\c!rechts=1.5] +\definefonthandling [bold] [defpunc,defalph] +\definefonthandling [boldslanted] [defpunc] [\c!links=1.5] + +\protect \endinput diff --git a/tex/context/base/enco-win.tex b/tex/context/base/enco-win.tex index e31fb311a..06f8ab41f 100644 --- a/tex/context/base/enco-win.tex +++ b/tex/context/base/enco-win.tex @@ -3,7 +3,7 @@ %D version=1997.08.29, %D title=\CONTEXT\ Encoding Macros, %D subtitle=Windows 1252 ANSI keys, -%D author=Hans Hagen / Tobias Burnus, +%D author={Tobias Burnus \& Hans Hagen}, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C @@ -76,7 +76,7 @@ \defineactivecharacter Š {\v{S}} \defineactivecharacter š {\v{s}} -\defineactivecharacter ß {\SS{}} +\defineactivecharacter ß {\sz{}} \defineactivecharacter Ù {\`U} \defineactivecharacter Ú {\'U} @@ -102,7 +102,7 @@ \defineactivecharacter — {---} \defineactivecharacter … {\dots{}} \defineactivecharacter © {\copyright{}} -\defineactivecharacter £ {\pounds{}} +\defineactivecharacter £ {\sterling{}} \defineactivecharacter „ {\char44\kern-.1em\char44 } \defineactivecharacter “ {\char96\kern-.1em\char96 } diff --git a/tex/context/base/enco-x5.tex b/tex/context/base/enco-x5.tex index f654be0ec..910c7a35c 100644 --- a/tex/context/base/enco-x5.tex +++ b/tex/context/base/enco-x5.tex @@ -3,9 +3,9 @@ %D version=1999.12.12, %D title=\CONTEXT\ Encoding Macros, %D subtitle=Vietnamese Encoding, -%D author=J. Hagen, +%D author=Hans Hagen, %D date=\currentdate, -%D copyright=J. Hagen] +%D copyright=Hans Hagen] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for diff --git a/tex/context/base/font-aer.tex b/tex/context/base/font-aer.tex new file mode 100644 index 000000000..4e21fc1d8 --- /dev/null +++ b/tex/context/base/font-aer.tex @@ -0,0 +1,69 @@ +%D \module +%D [ file=font-aer, +%D version=2000.09.20, +%D title=\CONTEXT\ Font Macros, +%D subtitle=Computer Modern, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This file remaps the default Computer Modern Font Files +%D onto the virtual EC ones, so that hyphenations work well. + +\resetfontdefinitionfile[cmr] + +\definefontsynonym [cmb10] [aeb10] [encoding=ec] +\definefontsynonym [cmcsc10] [aecsc10] [encoding=ec] +\definefontsynonym [cmsl10] [aesl10] [encoding=ec] +\definefontsynonym [cmssbx10] [aessbx10] [encoding=ec] +\definefontsynonym [cmti7] [aeti7] [encoding=ec] +\definefontsynonym [cmbx10] [aebx10] [encoding=ec] +\definefontsynonym [cmitt10] [aeitt10] [encoding=ec] +\definefontsynonym [cmsl12] [aesl12] [encoding=ec] +\definefontsynonym [cmssdc10] [aessdc10] [encoding=ec] +\definefontsynonym [cmti8] [aeti8] [encoding=ec] +\definefontsynonym [cmbx12] [aebx12] [encoding=ec] +\definefontsynonym [cmr10] [aer10] [encoding=ec] +\definefontsynonym [cmsl8] [aesl8] [encoding=ec] +\definefontsynonym [cmssi10] [aessi10] [encoding=ec] +\definefontsynonym [cmti9] [aeti9] [encoding=ec] +\definefontsynonym [cmbx5] [aebx5] [encoding=ec] +\definefontsynonym [cmr12] [aer12] [encoding=ec] +\definefontsynonym [cmsl9] [aesl9] [encoding=ec] +\definefontsynonym [cmssi12] [aessi12] [encoding=ec] +\definefontsynonym [cmtt10] [aett10] [encoding=ec] +\definefontsynonym [cmbx6] [aebx6] [encoding=ec] +\definefontsynonym [cmr17] [aer17] [encoding=ec] +\definefontsynonym [cmsltt10] [aesltt10] [encoding=ec] +\definefontsynonym [cmssi17] [aessi17] [encoding=ec] +\definefontsynonym [cmtt12] [aett12] [encoding=ec] +\definefontsynonym [cmbx7] [aebx7] [encoding=ec] +\definefontsynonym [cmr5] [aer5] [encoding=ec] +\definefontsynonym [cmss10] [aess10] [encoding=ec] +\definefontsynonym [cmssi8] [aessi8] [encoding=ec] +\definefontsynonym [cmtt8] [aett8] [encoding=ec] +\definefontsynonym [cmbx8] [aebx8] [encoding=ec] +\definefontsynonym [cmr6] [aer6] [encoding=ec] +\definefontsynonym [cmss12] [aess12] [encoding=ec] +\definefontsynonym [cmssi9] [aessi9] [encoding=ec] +\definefontsynonym [cmtt9] [aett9] [encoding=ec] +\definefontsynonym [cmbx9] [aebx9] [encoding=ec] +\definefontsynonym [cmr7] [aer7] [encoding=ec] +\definefontsynonym [cmss17] [aess17] [encoding=ec] +\definefontsynonym [cmtcsc10] [aetcsc10] [encoding=ec] +\definefontsynonym [cmbxsl10] [aebxsl10] [encoding=ec] +\definefontsynonym [cmr8] [aer8] [encoding=ec] +\definefontsynonym [cmss8] [aess8] [encoding=ec] +\definefontsynonym [cmti10] [aeti10] [encoding=ec] +\definefontsynonym [cmbxti10] [aebxti10] [encoding=ec] +\definefontsynonym [cmr9] [aer9] [encoding=ec] +\definefontsynonym [cmss9] [aess9] [encoding=ec] +\definefontsynonym [cmti12] [aeti12] [encoding=ec] + +\setupbodyfont[cmr] + +\endinput diff --git a/tex/context/base/font-ber.tex b/tex/context/base/font-ber.tex index e748305bd..3ad42a96e 100644 --- a/tex/context/base/font-ber.tex +++ b/tex/context/base/font-ber.tex @@ -37,12 +37,12 @@ \definefontsynonym [AntykwaTorunska-Italic] [zatri8t] [encoding=ec] \definefontsynonym [AntykwaTorunska-Bold] [zatb8t] [encoding=ec] -\definefontsynonym [Palatino-Roman] [uplr8r] [encoding=ec] -\definefontsynonym [Palatino-Italic] [uplri8r] [encoding=ec] -\definefontsynonym [Palatino-Slanted] [uplro8r] [encoding=ec] -\definefontsynonym [Palatino-Bold] [uplb8r] [encoding=ec] -\definefontsynonym [Palatino-BoldItalic] [uplbi8r] [encoding=ec] -\definefontsynonym [Palatino-BoldSlanted] [uplbo8r] [encoding=ec] +\definefontsynonym [Palatino-Roman] [uplr8t] [encoding=ec] +\definefontsynonym [Palatino-Italic] [uplri8t] [encoding=ec] +\definefontsynonym [Palatino-Slanted] [uplro8t] [encoding=ec] +\definefontsynonym [Palatino-Bold] [uplb8t] [encoding=ec] +\definefontsynonym [Palatino-BoldItalic] [uplbi8t] [encoding=ec] +\definefontsynonym [Palatino-BoldSlanted] [uplbo8t] [encoding=ec] \definefontsynonym [AvantGarde] [pag] \definefontsynonym [BookmanLight] [pbk] diff --git a/tex/context/base/font-chi.tex b/tex/context/base/font-chi.tex index 9c2d8d5ce..b8e332927 100644 --- a/tex/context/base/font-chi.tex +++ b/tex/context/base/font-chi.tex @@ -5,34 +5,36 @@ %D subtitle=Chinese, %D author=Hans Hagen, %D date=\currentdate, -%D suggestions=Wang Lei, +%D suggestions=Wang Lei, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. \writestatus{loading}{Context Font Macros / Chinese} -%D Still to be implemented: +% much will to typo-chi.tex + +%D Still to be implemented: %D %D \startopsomming -%D \som columns left right touch +%D \som columns left right touch %D \som distance = (hsize-n*bodyfontsize)/(n-1) -%D \som char grids -%D \som char tables -%D \som all kind of rotated combinations +%D \som char grids +%D \som char tables +%D \som all kind of rotated combinations %D \som hanging puctuation %D \som a few more encodings -%D \som rotation list +%D \som rotation list %D \stopopsomming %M \stelkorpsin[chi] -%M +%M %M \def\WangLei% %M {\purechinese{\uchar{205}{245}\uchar{192}{218}}} -\useencoding[chi] +\useencoding[chi] %D When \WangLei\ sent me a mail asking if \CONTEXT\ was able %D to support Chinese, I wasn't sure if the answer could be @@ -55,7 +57,7 @@ %D character set. I wrote some macros that could process the %D small \type {Hello World} file \WangLei\ had send me, and %D after some bug fixes real Chinese came out. I started to -%D like the look and fel of Chinese glyphs, so on we went. +%D like the look and fel of Chinese glyphs, so on we went. %D %D The first comments concerned spacing. The mix of English %D and Chinese demands some rather deliberate handling of @@ -66,8 +68,8 @@ %D labels and texts, and implementing these was rather %D straightforward. But, there were still some issues to deal %D with: conversion of numbers, date handling and index -%D sorting. -%D +%D sorting. +%D %D I consider(ed) writing Chinese support to be a nice puzzle, %D since I have to act on chinese \CONTEXT\ code, where I only %D understand the \CONTEXT\ part. The drawings \WangLei\ made @@ -75,42 +77,42 @@ %D these modules from scratch, although I fall back on some %D basic encoding and font modules, I consider them to be %D rather clean. This cannot be said of all \CONTEXT\ font -%D modules \type {-)}. +%D modules \type {-)}. \unprotect -%D Because Chinese glyphs have more height than the average -%D Latin glyph, and at the same time don't have much depth, -%D we adapt the scale. +%D Because Chinese glyphs have more height than the average +%D Latin glyph, and at the same time don't have much depth, +%D we adapt the scale. %D -%D Before and after the glyph we have to deal with Chinese -%D spacing. Special attention is given to punctuation. +%D Before and after the glyph we have to deal with Chinese +%D spacing. Special attention is given to punctuation. %D -%D \starttypen +%D \starttypen %D [some short nice chinese text with () and english] -%D \stoptypen +%D \stoptypen %D -%D We insert a bit of stretch and introduce a signal to -%D keep track of previous characters. +%D We insert a bit of stretch and introduce a signal to +%D keep track of previous characters. %D \macros %D {chineseunicodescale, chineseinterglyphskip, %D chineseunicodeheight, chineseunicodedepth, chinesespace} %D -%D There are a few variables, that can be (re|)|set -%D depending on the current font. They default to: +%D There are a few variables, that can be (re|)|set +%D depending on the current font. They default to: -\def\chineseunicodescale {1.00} % not smaller than .85 +\def\chineseunicodescale {1.00} % not smaller than .85 \def\chineseunicodeheight {1.00} \def\chineseunicodedepth {1.00} -\def\chineseinterglyphskip{0pt plus .05em minus .01em} +\def\chineseinterglyphskip{0pt plus .05em minus .01em} \def\chinesesurroundskip {.25em plus .15em minus .05em} -%D We define a few signals. (Another examples of using -%D such signals can be found in the module \type {m-units}.) +%D We define a few signals. (Another examples of using +%D such signals can be found in the module \type {m-units}.) -\newsignal\chineseLsignal % left boundary character -\newsignal\chineseRsignal % right boundary character +\newsignal\chineseLsignal % left boundary character +\newsignal\chineseRsignal % right boundary character \newsignal\chineseSsignal % any other character (symbol) \chardef\chineseBstatus=0 % 0=unknown 1=left 2=right 3=chinese 4=nospace @@ -119,7 +121,7 @@ \sfcode`(=2000 % a temporary hack -\def\chinesenobreak% +\def\chinesenobreak% {\relax \iftracechinese \nobreak @@ -137,7 +139,7 @@ \def\insertchineseglyph% {\iftracechinese\tracedchineseglyph\else\insertunicodeglyph\fi} -\newif\ifverticalchinese +\newif\ifverticalchinese \def\handlechineseunicodeglyph% {\ifinpagebody @@ -148,16 +150,16 @@ \horizontalchineseunicodeglyph \fi\fi} -% This is a previous, very encoding specific, attempt. The -% current implementation is more versatile. +% This is a previous, very encoding specific, attempt. The +% current implementation is more versatile. % -% \starttypen +% \starttypen % \def\chineseleftglyph {\chardef\chineseSstatus=1 } % \def\chineserightglyph {\chardef\chineseSstatus=2 } % \def\chinesecenterglyph {\chardef\chineseSstatus=3 } % % \def\analyzechineseunicodeglyph% -% {% left +% {% left % \ifnum\unicodeposition=161174 \chineseleftglyph \else % \ifnum\unicodeposition=161176 \chineseleftglyph \else % \ifnum\unicodeposition=161178 \chineseleftglyph \else @@ -206,10 +208,10 @@ % \chardef\chineseSstatus=0 % \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi % \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi} -% \stoptypen +% \stoptypen % % chinese classes: left=1|right=2|center=3 - + \def\analyzechineseunicodeglyph% {\chardef\chineseSstatus=0\getvalue{uc\the\unicodeposition}\relax} @@ -252,15 +254,19 @@ \fi \fi\fi\fi \fi\fi\fi} - -\def\horizontalchineseunicodeglyph + +\def\horizontalchineseunicodeglyph% {\relax + \ifhmode\else\dontleavehmode\fi % added + \setunicodescale\chineseunicodescale + \setunicodestrut\chineseunicodeheight\chineseunicodedepth \ifprocessingverbatim - \insertunicodeglyph + \iftracechinese + \ruledhbox{\insertunicodeglyph}% + \else + \insertunicodeglyph + \fi \else - \ifhmode\else\dontleavehmode\fi % added - \setunicodescale\chineseunicodescale - \setunicodestrut\chineseunicodeheight\chineseunicodedepth \analyzechineseunicodeglyph \analyzechineseunicodeenviroment \ifcase\chineseSstatus\relax @@ -271,7 +277,7 @@ \chineseunskip \chinesenobreak % left \or - \ifcorrectchineseboundarychars\else\chineseunskip\fi + \ifcorrectchineseboundarychars\else\chineseunskip\fi \hskip\chineseinterglyphskip % right \or \chineseunskip @@ -305,7 +311,7 @@ \hskip\chineseSsignal \fi \or % left - \ifcorrectchineseboundarychars + \ifcorrectchineseboundarychars \let\unicodecharcommand\chineseleftcharcommand \fi \chineseunskip @@ -313,7 +319,7 @@ \chinesenobreak \hskip\chineseLsignal \or % right - \ifcorrectchineseboundarychars + \ifcorrectchineseboundarychars \let\unicodecharcommand\chineserightcharcommand \fi \chineseunskip @@ -321,7 +327,7 @@ \insertchineseglyph \hskip\chineseRsignal \else % center - \chineseunskip + \chineseunskip \chinesenobreak \insertchineseglyph \hskip\chineseinterglyphskip @@ -332,8 +338,8 @@ \def\verticalchineseunicodeglyph% {\relax - \ifprocessingverbatim - \insertunicodeglyph + \ifprocessingverbatim % to do + \horizontalchineseunicodeglyph \else \setunicodescale\chineseunicodescale \setunicodestrut\chineseunicodeheight\chineseunicodedepth @@ -349,25 +355,27 @@ \hss}% \ht\scratchbox=\unicodeheight\ht\strutbox \dp\scratchbox=\unicodedepth \dp\strutbox - \nointerlineskip - \ifcase\prevchineseSstatus\relax - \ifnum\chineseSstatus=2\nobreak\else\allowbreak\fi - \or % left - \nobreak - \or % right - \ifnum\chineseSstatus=2\nobreak\else\allowbreak\fi + \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -) + \nointerlineskip \fi - \global\chardef\prevchineseSstatus=\chineseSstatus % pagebody ... - \box\scratchbox + \ifcase\prevchineseSstatus\relax + \ifnum\chineseSstatus=2 \par\nobreak\else\allowbreak\fi + \or % left + \par\nobreak + \or % right + \ifnum\chineseSstatus=2 \par\nobreak\else\allowbreak\fi + \fi + \global\chardef\prevchineseSstatus=\chineseSstatus % pagebody ... + \box\scratchbox\par \aftergroup\ignorespaces % watch this \fi} %D \macros %D {setupchinese,startvertical,nochinese} %D -%D The previous macros implement horizontal as well as +%D The previous macros implement horizontal as well as %D vertical typesetting. Vertical typesetting is implemented -%D on top of the multi||column routines. +%D on top of the multi||column routines. \def\setupchinese% {\dodoubleargument\getparameters[\??vt]} @@ -379,14 +387,21 @@ {\bgroup \def\maxnofcolumns{25}% \verticalchinesetrue - \global\chardef\prevchineseSstatus=0 + \global\chardef\prevchineseSstatus=0 \let\nochinese=\nochineseinvertical + \doif{\@@vtn}{\v!passend} + {\dimen0=\textwidth + \advance\dimen0 by \@@vtafstand + \dimen2=\bodyfontsize + \advance\dimen2 by \@@vtafstand + \divide\dimen0 by \number\dimen2 + \edef\@@vtn{\number\dimen0}}% \startkolommen [\c!richting=\@@vtrichting, \c!balanceren=\@@vtbalanceren, \c!afstand=\@@vtafstand, \c!n=\@@vtn, - #1]} + #1]} \def\stopvertical% {\stopkolommen @@ -395,10 +410,10 @@ \setupchinese [\c!richting=\v!links, \c!balanceren=\v!nee, - \c!n=12, + \c!n=\v!passend, \c!afstand=1.5\bodyfontsize] -%D We can set up vertical typesetting with \type +%D We can set up vertical typesetting with \type %D {\setupchinese}. %D \macros @@ -423,14 +438,14 @@ %D \macros %D {correctchineseboundarychars} %D -%D Careful reading of the previous macro learns that we -%D treat left and right glyphs differently. When we say +%D Careful reading of the previous macro learns that we +%D treat left and right glyphs differently. When we say %D -%D \starttypen +%D \starttypen %D \correctchineseboundarycharstrue %D \stoptypen %D -%D For the moment correction in on by default. +%D For the moment correction in on by default. \correctchineseboundarycharstrue @@ -444,7 +459,7 @@ % \def\chineserightcharcommand#1% % {\setbox\scratchbox=\hbox{#1}% -% \scratchdimen=.5em +% \scratchdimen=.5em % \ifdim\wd\scratchbox>\scratchdimen % \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen % {\box\scratchbox\hss}% @@ -455,9 +470,9 @@ % \def\chineseleftcharcommand#1% % {\setbox\scratchbox=\hbox{#1}% -% \scratchdimen=.5em +% \scratchdimen=.5em % \ifdim\wd\scratchbox>\scratchdimen -% \ifnum\chineseBstatus<4 +% \ifnum\chineseBstatus<4 % \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax % \fi % \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen @@ -466,40 +481,40 @@ % \box\scratchbox % \fi} -%D The long list of numbers in the previous macro identify the -%D characters where special care is needed for breaking lines. -%D A linebreak is not permitted before: -%D +%D The long list of numbers in the previous macro identify the +%D characters where special care is needed for breaking lines. +%D A linebreak is not permitted before: +%D %D \def\DoIt #1 #2 % %D {\hbox{\hbox to 2em{\uchar{#1}{#2}\hss}#1 #2}\par} -%D -%D \startkolommen[n=5] -%D \DoIt 161 162 \DoIt 161 163 \DoIt 161 164 \DoIt 161 167 \DoIt 161 173 -%D \DoIt 161 175 \DoIt 161 177 \DoIt 161 179 \DoIt 161 181 \DoIt 161 183 +%D +%D \startkolommen[n=5] +%D \DoIt 161 162 \DoIt 161 163 \DoIt 161 164 \DoIt 161 167 \DoIt 161 173 +%D \DoIt 161 175 \DoIt 161 177 \DoIt 161 179 \DoIt 161 181 \DoIt 161 183 %D \DoIt 161 185 \DoIt 161 187 \DoIt 161 189 \DoIt 161 191 \DoIt 161 227 -%D \DoIt 161 228 \DoIt 161 229 \DoIt 163 161 \DoIt 163 162 \DoIt 163 167 -%D \DoIt 163 169 \DoIt 163 172 \DoIt 163 174 \DoIt 163 186 \DoIt 163 187 +%D \DoIt 161 228 \DoIt 161 229 \DoIt 163 161 \DoIt 163 162 \DoIt 163 167 +%D \DoIt 163 169 \DoIt 163 172 \DoIt 163 174 \DoIt 163 186 \DoIt 163 187 %D \DoIt 163 190 \DoIt 163 191 \DoIt 163 221 \DoIt 163 253 %D \stopkolommen -%D -%D A linebreak is not permitted after the following glyphs: -%D +%D +%D A linebreak is not permitted after the following glyphs: +%D %D \startkolommen[n=5] -%D \DoIt 161 174 \DoIt 161 176 \DoIt 161 178 \DoIt 161 180 \DoIt 161 182 -%D \DoIt 161 184 \DoIt 161 186 \DoIt 161 188 \DoIt 161 190 \DoIt 163 168 +%D \DoIt 161 174 \DoIt 161 176 \DoIt 161 178 \DoIt 161 180 \DoIt 161 182 +%D \DoIt 161 184 \DoIt 161 186 \DoIt 161 188 \DoIt 161 190 \DoIt 163 168 %D \DoIt 163 219 \DoIt 163 224 \DoIt 163 251 %D \stopkolommen -%D \macros +%D \macros %D {tracechinesetrue, showchinesetracelegend} %D -%D When we say \type {\tracechinesetrue}, we get some -%D insight in the way \CONTEXT\ handles the Chinese glyphs. -%D The symbols and color used represent: -%D +%D When we say \type {\tracechinesetrue}, we get some +%D insight in the way \CONTEXT\ handles the Chinese glyphs. +%D The symbols and color used represent: +%D %D \showchinesetracelegend -\newif\iftracechinese +\newif\iftracechinese \def\showchinesetracelegend% {\definetabulate[\s!dummy][|c|l|l|l|]% @@ -509,7 +524,7 @@ \NC l \NC left boundary character \NC \color[red]{previous} \NC u l r c n \NC\NR \NC r \NC right boundary character \NC \color[blue]{next} \NC u l r s \NC\NR \NC c \NC chinese character \NC \NC \NC\NR - \NC s \NC following space \NC \NC \NC\NR + \NC s \NC following space \NC \NC \NC\NR \NC n \NC no preceding space \NC \NC \NC\NR \HL \stopdummy} @@ -537,59 +552,59 @@ {\ifcase\chineseAstatus\relax u\or l\or r\or s\fi}% \hss}}}} -%D The following example shows how tracing works. -%D +%D The following example shows how tracing works. +%D %D \start \tracechinesetrue %D ÔÚÕâÒ»ŽÎžüÐÂÖÐÎÒÃÇœ«œéÉܶÔÖÐÎĵÄÖ§³Ö¡£µ±±ŸÎĵÄÖÐÎÄÒëÕßÍõÀÚ %D ѯÎÊÎÒ \nochinese{\CONTEXT} ÊÇ·ñÄÜŽŠÀíººÓïʱ£¬ËûÒÑŸ­³¢ÊÔ¹ý %D ÔËÐÐÏÖÓеĺꌯ£¬µ«ÊÇûÓеõœœá¹û¡£ÕâÒâζ×ŶÔÖÐÎĵÄÖ§³Ö»¹Ã» %D ÓÐʵÏÖ¡£ -%D +%D %D ÔÚÕâÒ»(ŽÎžüÐÂ)ÖÐÎÒÃÇ (œ«œé) ÉܶÔÖÐÎĵÄÖ§³Ö¡£µ±±ŸÎĵÄÖÐÎÄÒë, %D ÕßÍõÀÚѯÎÊÎÒ\nochinese{\CONTEXT}ÊÇ·ñÄÜŽŠÀíººÓïʱ£¬ËûÒÑŸ­³¢ %D ÊÔ¹ýÔËÐÐÏÖÓеĺꌯ£¬µ«ÊÇûÓеõœœá¹û¡£ÕâÒâζ×ŶÔÖÐÎĵÄÖ§³Ö %D »¹Ã»ÓÐʵÏÖ¡£. %D \stop -%D Because fonts are defined each time a \UNICODE\ is -%D encountered |<|which is less inefficient than one would -%D imagine, because \TEX\ is optimized quite well in this -%D repect|>| we can define macros like this to take care of -%D font switches. When available, one can add definitions -%D for italic, slanted, bold fonts and combinations of these. +%D Because fonts are defined each time a \UNICODE\ is +%D encountered |<|which is less inefficient than one would +%D imagine, because \TEX\ is optimized quite well in this +%D repect|>| we can define macros like this to take care of +%D font switches. When available, one can add definitions +%D for italic, slanted, bold fonts and combinations of these. -%D \macros +%D \macros %D {chinesenumber} %D -%D The chinese numbering systems rather straightforward. First -%D there are the digits: -%D +%D The chinese numbering systems rather straightforward. First +%D there are the digits: +%D %D \starttabulatie[|c|c|c|c|c|c|c|c|c|c|] %D \NC 0 \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC 6 \NC 7 \NC 8 \NC 9 \NC\NR -%D \NC \chinesenumber{0} \NC \chinesenumber{1} \NC \chinesenumber{2} -%D \NC \chinesenumber{3} \NC \chinesenumber{4} \NC \chinesenumber{5} -%D \NC \chinesenumber{6} \NC \chinesenumber{7} \NC \chinesenumber{8} +%D \NC \chinesenumber{0} \NC \chinesenumber{1} \NC \chinesenumber{2} +%D \NC \chinesenumber{3} \NC \chinesenumber{4} \NC \chinesenumber{5} +%D \NC \chinesenumber{6} \NC \chinesenumber{7} \NC \chinesenumber{8} %D \NC \chinesenumber{9} \NC\NR %D \stoptabulatie -%D -%D Apart from these numbers, we have dedicated representations +%D +%D Apart from these numbers, we have dedicated representations %D of some powers of~$10$. -%D +%D %D \starttabulatie[|c|c|c|c|c|] -%D \NC 10 \NC 100 \NC 1000 \NC 10000 \NC 100000000 \NC\NR -%D \NC \chinesenumber{10} \NC \chinesenumber{100} -%D \NC \chinesenumber{1000} \NC \chinesenumber{10000} +%D \NC 10 \NC 100 \NC 1000 \NC 10000 \NC 100000000 \NC\NR +%D \NC \chinesenumber{10} \NC \chinesenumber{100} +%D \NC \chinesenumber{1000} \NC \chinesenumber{10000} %D \NC \chinesenumber{100000000} \NC\NR %D \stoptabulatie -%D +%D %D The number~12 is a combination of $1\times10+2$, or: %D \chinesenumber {12}, while~22 becomes \chinesenumber {22}. -%D The numbers below 20 are treated a bit different, just like -%D numbers with series of $0$'s. So $2\times10$ comes out as -%D two glyphs, but $1\times10$ as one, because in the latter -%D case the~$1$ is redundant. The same is true for the powers -%D of~10. -%D +%D The numbers below 20 are treated a bit different, just like +%D numbers with series of $0$'s. So $2\times10$ comes out as +%D two glyphs, but $1\times10$ as one, because in the latter +%D case the~$1$ is redundant. The same is true for the powers +%D of~10. +%D %D \starttabulatie[|r|r|r|r|r|r|] %D \NC 1 \NC \chinesenumber {1} \NC %D 9 \NC \chinesenumber {9} \NC @@ -604,23 +619,23 @@ %D 9999 \NC \chinesenumber {9999} \NC %D 65536 \NC \chinesenumber {65536} \NC\NR %D \stoptabulatie -%D +%D %D The implementation is rather simple. For internal purposes, %D we let zero expand to~0. The digits $0-9$ and numbers $10$, -%D $100$, $1000$, $10000$ and $100000000$ are hard coded. +%D $100$, $1000$, $10000$ and $100000000$ are hard coded. -% This was the first implementation, before \WangLei\ asked -% me to look into Big Five encoding, so, like everthing in -% \TEX, things become a bit more complicated, but also more -% versatile. +% This was the first implementation, before \WangLei\ asked +% me to look into Big Five encoding, so, like everthing in +% \TEX, things become a bit more complicated, but also more +% versatile. % -% \starttypen +% \starttypen % \def\chinesedigit#1% % {\ifnum #1=100000000 \uchar{210}{218}% 100000000 % \else\ifnum #1=10000 \uchar{205}{242}% 10000 % \else\ifnum #1=1000 \uchar{199}{167}% 1000 % \else\ifnum #1=100 \uchar{176}{217}% 100 -% \else\ifnum #1=10 \uchar{202}{174}% 10 +% \else\ifnum #1=10 \uchar{202}{174}% 10 % \else\ifcase#1 \uchar{193}{227}% 0 % \or \uchar{210}{187}% 1 % \or \uchar{182}{254}% 2 @@ -632,110 +647,163 @@ % \or \uchar{176}{203}% 8 % \or \uchar{190}{197}% 9 % \fi\fi\fi\fi\fi\fi} -% \stoptypen +% \stoptypen +%D We will implement four methods, the one described earlier, +%D a derived one with capitalized characters, an extended +%D version of the first method, and a rather Arabic method. +%D +%D \starttabulate[|l|l|] +%D \HL +%D \NC \bf command \NC \bf number 39 \NC\NR +%D \HL +%D \NC \type{\normalchinesenumber} \NC \normalchinesenumber {39} \NC\NR +%D \NC \type{\capitalizedchinesenumber} \NC \capitalizedchinesenumber{39} \NC\NR +%D \NC \type{\arabicchinesenumber} \NC \arabicchinesenumber {39} \NC\NR +%D \NC \type{\extendedchinesenumber} \NC \extendedchinesenumber {39} \NC\NR +%D \HL +%D \stoptabulate +%D %D We use a dirty trick to enable Chinese Capital Digits. In -%D the encoding vectors, we define these by appending a suffix -%D \type {*} to the digit. For the moment this method works ok. -%D With \type {\capstyle} one can switch to those capitalized -%D digits. +%D the encoding vectors, we define these by appending a suffix +%D \type {*} to the digit, which in the following macro is +%D appended or not (by passing \type {\empty}). -\def\enablechinesecapdigits% - {\def\chinesedigitsuffix{*}} +\def\chinesedigit#1#2% #2: suffix, here * or \empty + {\udigit{\chineseencoding}{\number#1#2}} -\def\disablechinesecapdigits% - {\let\chinesedigitsuffix\empty} +% Normal Chinese Number -\disablechinesecapdigits +\def\normalchinesenumber#1% + {\expandafter\dochinesenumber\number#1\relax\empty} -\let\capstyle\enablechinesecapdigits - -\def\chinesedigit#1% - {\udigit{\chineseencoding}{\number#1\chinesedigitsuffix}} - -\def\chinesenumber#1% - {\expandafter\dochinesenumber\number#1\relax} - -\def\dochinesenumber#1#2\relax +\def\dochinesenumber#1#2\relax#3% {\ifnum#1#2<10 % 1-10 - \chinesedigit{#1}% + \chinesedigit{#1}#3% \else\ifnum#1#2<20 % 11-99 - \chinesedigit{10}% - \dodochinesenumberA#2\relax + \chinesedigit{10}#3% + \dodochinesenumberA#2\relax#3% \else - \dodochinesenumber#1#2\relax + \dodochinesenumber#1#2\relax#3% \fi\fi} -\def\dodochinesenumber#1#2\relax +\def\dodochinesenumber#1#2\relax#3% {\ifnum#1=0 - \chinesedigit{0}% - \dododochinesenumber0#2\relax + \chinesedigit{0}#3% + \dododochinesenumber0#2\relax#3% \else\ifnum#1#2<10 % 1-10 - \chinesedigit{#1#2}% - \dodochinesenumberA#2\relax + \chinesedigit{#1#2}#3% + \dodochinesenumberA#2\relax#3% \else\ifnum#1#2<100 % 11-99 - \dodochinesenumber#1\relax - \chinesedigit{10}% - \dodochinesenumberA#2\relax + \dodochinesenumber#1\relax#3% + \chinesedigit{10}#3% + \dodochinesenumberA#2\relax#3% \else\ifnum#1#2<1000 % 100-999 - \dodochinesenumber#1\relax - \chinesedigit{100}% - \dodochinesenumberA#2\relax + \dodochinesenumber#1\relax#3% + \chinesedigit{100}#3% + \dodochinesenumberA#2\relax#3% \else\ifnum#1#2<10000 % 1000-9999 - \dodochinesenumber#1\relax - \chinesedigit{1000}% - \dodochinesenumberA#2\relax + \dodochinesenumber#1\relax#3% + \chinesedigit{1000}#3% + \dodochinesenumberA#2\relax#3% \else\ifnum#1#2<100000 % 10000-99999 - \dodochinesenumber#1\relax - \chinesedigit{10000}% - \dodochinesenumberA#2\relax + \dodochinesenumber#1\relax#3% + \chinesedigit{10000}#3% + \dodochinesenumberA#2\relax#3% \else\ifnum#1#2<1000000 % 100000-999999 - \dodochinesenumberB#1#2\relax + \dodochinesenumberB#1#2\relax#3% \else\ifnum#1#2<10000000 % 1000000-9999999 - \dodochinesenumberC#1#2\relax + \dodochinesenumberC#1#2\relax#3% \else\ifnum#1#2<100000000 % 10000000-99999999 - \dodochinesenumberD#1#2\relax + \dodochinesenumberD#1#2\relax#3% \else\ifnum#1#2<1000000000 % 10000000-99999999 - \dochinesenumber#1\relax - \chinesedigit{100000000}% - \dododochinesenumber#2\relax + \dochinesenumber#1\relax#3% + \chinesedigit{100000000}#3% + \dododochinesenumber#2\relax#3% \else - \dodochinesenumberE#1#2\relax + \dodochinesenumberE#1#2\relax#3% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} -\def\dododochinesenumber#1#2\relax +\def\dododochinesenumber#1#2\relax#3% {\ifnum#1=0 - \ifnum0#2>0 \dododochinesenumber#2\relax \fi + \ifnum0#2>0 \dododochinesenumber#2\relax#3\fi \else - \dodochinesenumber#1#2\relax + \dodochinesenumber#1#2\relax#3% \fi} -\def\dodochinesenumberA#1\relax - {\ifcase0#1 \else\dodochinesenumber#1\relax\fi} +\def\dodochinesenumberA#1\relax#2% + {\ifcase0#1 \else\dodochinesenumber#1\relax#2\fi} -\def\dodochinesenumberB#1#2#3\relax - {\dochinesenumber#1#2\relax - \chinesedigit{10000}% - \dododochinesenumber#3\relax} +\def\dodochinesenumberB#1#2#3\relax#4% + {\dochinesenumber#1#2\relax#4% + \chinesedigit{10000}#4% + \dododochinesenumber#3\relax#4} -\def\dodochinesenumberC#1#2#3#4\relax - {\dochinesenumber#1#2#3\relax - \chinesedigit{10000}% - \dododochinesenumber#4\relax} +\def\dodochinesenumberC#1#2#3#4\relax#5% + {\dochinesenumber#1#2#3\relax#5% + \chinesedigit{10000}#5% + \dododochinesenumber#4\relax#5} -\def\dodochinesenumberD#1#2#3#4#5\relax - {\dochinesenumber#1#2#3#4\relax - \chinesedigit{10000}% - \dododochinesenumber#5\relax} +\def\dodochinesenumberD#1#2#3#4#5\relax#6% + {\dochinesenumber#1#2#3#4\relax#6% + \chinesedigit{10000}#6% + \dododochinesenumber#5\relax#6} -\def\dodochinesenumberE#1#2#3\relax - {\dochinesenumber#1#2\relax - \chinesedigit{100000000}% - \dododochinesenumber#3\relax} +\def\dodochinesenumberE#1#2#3\relax#4% + {\dochinesenumber#1#2\relax#4% + \chinesedigit{100000000}#4% + \dododochinesenumber#3\relax#4} -%D The next table demonstates the correctness of the -%D conversion macro. -%D +% Capitalized Chinese Number + +\def\capitalizedchinesenumber#1% + {\expandafter\dochinesenumber\number#1\relax*} + +% Extended Chinese Number + +\def\extendedchinesenumber#1% + {\expandafter\doextendedchinesenumber\number#1\relax} + +\def\doextendedchinesenumber#1#2\relax% + {\ifnum #1#2<20 % 0-19 + \dochinesenumber#1#2\relax\empty + \else\ifnum#1#2<30 % 20-29 + \chinesedigit{20}\empty + \ifcase#2\else\chinesedigit{2#2}\fi + \else\ifnum#1#2<40 % 30-39 + \chinesedigit{30}\empty + \ifcase#2\else\chinesedigit{3#2}\fi + \else + \dochinesenumber#1#2\relax\empty + \fi\fi\fi} + +% Arabic Chinese Number + +\def\arabicchinesenumber#1% + {\expandafter\doarabicchinesenumber\number#1@\relax} + +\def\doarabicchinesenumber#1#2\relax% + {\if#1@\else + \chinesedigit{#1}\empty + \doarabicchinesenumber#2\relax + \fi} + +% The short call: + +\def\chinesenumber{\normalchinesenumber} + +% \dorecurse{40} +% {\hbox +% {\processingverbatimtrue +% \hbox to 1cm{\hss\recurselevel}\quad +% \hbox to 3cm{\hss\strut\normalchinesenumber {\recurselevel}}\quad +% \hbox to 3cm{\hss\strut\capitalizedchinesenumber{\recurselevel}}\quad +% \hbox to 3cm{\hss\strut\arabicchinesenumber {\recurselevel}}\quad +% \hbox to 3cm{\hss\strut\extendedchinesenumber {\recurselevel}}\crlf}} + +%D The next table demonstates the correctness of the +%D conversion macro. +%D %D \startbuffer %D \starttabel[|l|l|l|l|l|l|] %D \HL @@ -779,72 +847,77 @@ %D that deal with numbers |<|those familiar with \TEX\ macro %D programming will notice that the macro if fully %D expandable|>| in many cases Chinese documents use western -%D digits. So, in practice, the change that the next example -%D shows up, is minimal. -%D +%D digits. So, in practice, the change that the next example +%D shows up, is minimal. +%D %D \starttabulatie[|r|r|c|] -%D \NC 2546 \NC \chinesenumber {2546} \NC \NC\NR -%D \NC 9258 \NC \chinesenumber {9258} \NC $+$ \NC\NR -%D \HL +%D \NC 2546 \NC \chinesenumber {2546} \NC \NC\NR +%D \NC 9258 \NC \chinesenumber {9258} \NC $+$ \NC\NR +%D \HL %D \NC 11804 \NC \chinesenumber {11804} \NC \NC\NR %D \stoptabulatie -%D +%D %D While in arabic arithmics addition leads to more digits, in %D Chinese the number of glyphs can (temporary) decrease. %D Given that the number of people dealing with Chinese is %D considerably larger than the number of latin speaking %D people, a successor of \TEX\ definitely must provide a -%D \type {\chinesenumeral} primitive. - -\defineconversion[c] [\chinesenumber] -\defineconversion[chinese][\chinesenumber] +%D \type {\chinesenumeral} primitive. + +\defineconversion [c] [\normalchinesenumber] +\defineconversion [chinese] [\normalchinesenumber] +\defineconversion [nc] [\normalchinesenumber] +\defineconversion [normalchinese] [\normalchinesenumber] +\defineconversion [cc] [\capitalizedchinesenumber] +\defineconversion [capitalizedchinese] [\capitalizedchinesenumber] +\defineconversion [ec] [\extendedchinesenumber] +\defineconversion [extendedchinese] [\extendedchinesenumber] +\defineconversion [ac] [\arabicchinesenumber] +\defineconversion [arabicchinese] [\arabicchinesenumber] %D \macros %D {SimChi, TraChi} %D %D These components enable us to construct dedicated Chinese -%D font switches, like: +%D font switches, like: \setupunicodefont [chinese] - [ \c!schaal=\chineseunicodescale, - \c!hoogte=\chineseunicodeheight, - \c!diepte=\chineseunicodedepth, + [ \c!schaal=\chineseunicodescale, + \c!hoogte=\chineseunicodeheight, + \c!diepte=\chineseunicodedepth, \c!conversie=\chinesenumber, - \c!commandos=\setchineseencoding, % needed for digits + \c!commandos=\setchineseencoding, % needed for digits \c!commando=\handlechineseunicodeglyph] -\defineunicodefont [SimChi] [SimplifiedChinese] [chinese] -\defineunicodefont [TraChi] [TraditionalChinese] [chinese] - -%D For the moment, this encoding is implemented rather ugly. The -%D trick is to move the encoding value from the current font -%D definition to the \type {\chineseencoding} macro. +%D For the moment, this encoding is implemented rather ugly. The +%D trick is to move the encoding value from the current font +%D definition to the \type {\chineseencoding} macro. \let\chineseencoding\empty -\def\setchineseencoding% normally SomeChineseRegular +\def\setchineseencoding% normally SomeChineseRegular {\getfontfileparameters\unicodestyle \ifx\currentfontfileencoding\undefined \else \let\chineseencoding\currentfontfileencoding \fi} -%D We could have said: -%D +%D We could have said: +%D %D \starttypen -%D \defineunicodefont -%D [SimChi] +%D \defineunicodefont +%D [SimChi] %D [SimplifiedChinese] -%D [ \c!schaal=\chineseunicodescale, -%D \c!hoogte=\chineseunicodeheight, -%D \c!diepte=\chineseunicodedepth, +%D [ \c!schaal=\chineseunicodescale, +%D \c!hoogte=\chineseunicodeheight, +%D \c!diepte=\chineseunicodedepth, %D \c!conversie=\chinesenumber, -%D \c!commandos=\setchineseencoding, % needed for digits +%D \c!commandos=\setchineseencoding, % needed for digits %D \c!commando=\handlechineseunicodeglyph] %D \stoptypen -%D -%D However, the former definitions is more general. Next we -%D map a few fonts: +%D +%D However, the former definitions is more general. Next we +%D map a few fonts: \definefontsynonym [SimplifiedChineseRegular] [gbsong] [encoding=gbk] \definefontsynonym [SimplifiedChineseSlanted] [gbsongsl] [encoding=gbk] @@ -853,44 +926,118 @@ \definefontsynonym [SimplifiedChineseBoldSlanted] [gbheisl] [encoding=gbk] \definefontsynonym [SimplifiedChineseBoldItalic] [gbheisl] [encoding=gbk] -% Yet to be defined: - -\definefontsynonym [TraditionalChineseRegular] [b5ming] [encoding=big5] -\definefontsynonym [TraditionalChineseSlanted] [b5mingsl] [encoding=big5] -\definefontsynonym [TraditionalChineseItalic] [b5mingsl] [encoding=big5] +\definefontsynonym [TraditionalChineseRegular] [b5song] [encoding=big5] +\definefontsynonym [TraditionalChineseSlanted] [b5songsl] [encoding=big5] +\definefontsynonym [TraditionalChineseItalic] [b5songsl] [encoding=big5] \definefontsynonym [TraditionalChineseBold] [b5hei] [encoding=big5] \definefontsynonym [TraditionalChineseBoldSlanted] [b5heisl] [encoding=big5] \definefontsynonym [TraditionalChineseBoldItalic] [b5heisl] [encoding=big5] -%D We default to these so called Simplified Chinese fonts. +\defineunicodefont [SimChi] [SimplifiedChinese] [chinese] +\defineunicodefont [TraChi] [TraditionalChinese] [chinese] + +%D We default to these so called Simplified Chinese fonts. \SimChi +%D In addition to these fonts, we (pre|)|define some commonly +%D used fonts: + +\definefontsynonym [SimSongTiRegular] [gbsong] [encoding=gbk] +\definefontsynonym [SimSongTiSlanted] [gbsongsl] [encoding=gbk] +\definefontsynonym [SimSongTiBold] [gbsong] [encoding=gbk] +\definefontsynonym [SimSongTiBoldSlanted] [gbsongsl] [encoding=gbk] + +\definefontsynonym [TraSongTiRegular] [b5song] [encoding=big5] +\definefontsynonym [TraSongTiSlanted] [b5songsl] [encoding=big5] +\definefontsynonym [TraSongTiBold] [b5song] [encoding=big5] +\definefontsynonym [TraSongTiBoldSlanted] [b5songsl] [encoding=big5] + +\definefontsynonym [SimHeiTiRegular] [gbhei] [encoding=gbk] +\definefontsynonym [SimHeiTiSlanted] [gbheisl] [encoding=gbk] +\definefontsynonym [SimHeiTiBold] [gbhei] [encoding=gbk] +\definefontsynonym [SimHeiTiBoldSlanted] [gbheisl] [encoding=gbk] + +\definefontsynonym [TraHeiTiRegular] [b5hei] [encoding=big5] +\definefontsynonym [TraHeiTiSlanted] [b5heisl] [encoding=big5] +\definefontsynonym [TraHeiTiBold] [b5hei] [encoding=big5] +\definefontsynonym [TraHeiTiBoldSlanted] [b5heisl] [encoding=big5] + +\definefontsynonym [SimKaiTiRegular] [gbkai] [encoding=gbk] +\definefontsynonym [SimKaiTiSlanted] [gbkaisl] [encoding=gbk] +\definefontsynonym [SimKaiTiBold] [gbkai] [encoding=gbk] +\definefontsynonym [SimKaiTiBoldSlanted] [gbkaisl] [encoding=gbk] + +\definefontsynonym [TraKaiTiRegular] [b5kai] [encoding=big5] +\definefontsynonym [TraKaiTiSlanted] [b5kaisl] [encoding=big5] +\definefontsynonym [TraKaiTiBold] [b5kai] [encoding=big5] +\definefontsynonym [TraKaiTiBoldSlanted] [b5kaisl] [encoding=big5] + +\definefontsynonym [SimFangSongRegular] [gbfs] [encoding=gbk] +\definefontsynonym [SimFangSongSlanted] [gbfssl] [encoding=gbk] +\definefontsynonym [SimFangSongBold] [gbfs] [encoding=gbk] +\definefontsynonym [SimFangSongBoldSlanted] [gbfssl] [encoding=gbk] + +\definefontsynonym [TraFangSongRegular] [b5fs] [encoding=big5] +\definefontsynonym [TraFangSongSlanted] [b5fssl] [encoding=big5] +\definefontsynonym [TraFangSongBold] [b5fs] [encoding=big5] +\definefontsynonym [TraFangSongBoldSlanted] [b5fssl] [encoding=big5] + +\definefontsynonym [SimLiShuRegular] [gbfs] [encoding=gbk] +\definefontsynonym [SimLiShuSlanted] [gbfssl] [encoding=gbk] +\definefontsynonym [SimLiShuBold] [gbfs] [encoding=gbk] +\definefontsynonym [SimLiShuBoldSlanted] [gbfssl] [encoding=gbk] + +\definefontsynonym [TraLiShuRegular] [b5fs] [encoding=big5] +\definefontsynonym [TraLiShuSlanted] [b5fssl] [encoding=big5] +\definefontsynonym [TraLiShuBold] [b5fs] [encoding=big5] +\definefontsynonym [TraLiShuBoldSlanted] [b5fssl] [encoding=big5] + +%D The following definitions provide us the commands to switch +%D to these fonts. + +\defineunicodefont [SimSongTi] [SimplifiedChinese] [chinese] +\defineunicodefont [TraSongTi] [TraditionalChinese] [chinese] + +\defineunicodefont [SimHeiTi] [SimplifiedChinese] [chinese] +\defineunicodefont [TraHeiTi] [TraditionalChinese] [chinese] + +\defineunicodefont [SimKaiTi] [SimplifiedChinese] [chinese] +\defineunicodefont [TraKaiTi] [TraditionalChinese] [chinese] + +\defineunicodefont [SimFangSong] [SimplifiedChinese] [chinese] +\defineunicodefont [TraFangSong] [TraditionalChinese] [chinese] + +\defineunicodefont [SimLiShu] [SimplifiedChinese] [chinese] +\defineunicodefont [TraLiShu] [TraditionalChinese] [chinese] + +% \definealternativestyle [ChineseTitleFont] [\bfd\SimKaiTi] [] + %D \macros %D {purechinese} -%D -%D Use this macro to suppress spacing around Chinese text. +%D +%D Use this macro to suppress spacing around Chinese text. -\def\purechinese#1% evt geen rek +\def\purechinese#1% evt geen rek {\hskip\chineseSsignal\relax #1\unskip\unskip\unskip \hskip\chineseSsignal\relax} %D \macros %D {stillchinese} -%D -%D Use the next macro when you want the next item to be put +%D +%D Use the next macro when you want the next item to be put %D tight to the previous chinese character. \def\stillchinese% {\hskip\chineseSsignal\relax} -%D \macros +%D \macros %D {nochinese} %D -%D When we want to be sure of non||Chinese inline text, -%D we can package the for instance english text in \type -%D {\nochinese}. +%D When we want to be sure of non||Chinese inline text, +%D we can package the for instance english text in \type +%D {\nochinese}. \def\nochinese#1% {\unskip\unskip\unskip @@ -901,41 +1048,79 @@ \hskip\chinesesurroundskip \ignorespaces} -%D Now it's time for some real Chinese. This example -%D also shows that font switching is supported. -%D +%D \macros +%D {chisize} +%D +%D Chinese font sizes are specified in a different way, +%D using positive and negative numbers: + +\def\chisize#1% + {\ifnum#11<0 % a trick to catch -0 + \ifcase#1\space36\or24\or18\or15\or12\or9\or\else6.5\fi + \else + \ifcase#1\space42\or26\or22\or16\or14\or10.5\or7.5\or5.5\else5\fi + \fi pt} + +%D So: +%D +%D \startbuffer +%D [\chisize{-1}] [\chisize{7}] [\chisize{+4}] +%D \stopbuffer +%D +%D \typebuffer +%D +%D gives: +%D +%D \getbuffer +%D +%D The full range of sizes is: +%D +%D \starttabulatie[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|] +%D \NC 8 \NC 7 \NC -6 \NC 6 \NC +%D -5 \NC 5 \NC -4 \NC 4 \NC +%D -3 \NC 3 \NC -2 \NC 2 \NC +%D -1 \NC 1 \NC -0 \NC 0 \NC\NR +%D \NC\chisize {8}\NC\chisize{7}\NC\chisize{-6}\NC\chisize{6}\NC +%D \chisize{-5}\NC\chisize{5}\NC\chisize{-4}\NC\chisize{4}\NC +%D \chisize{-3}\NC\chisize{3}\NC\chisize{-2}\NC\chisize{2}\NC +%D \chisize{-1}\NC\chisize{1}\NC\chisize{-0}\NC\chisize{0}\NC\NR +%D \stoptabulatie + +%D Now it's time for some real Chinese. This example +%D also shows that font switching is supported. +%D %D \startsmaller -%D \regelmidden{\tfd Ë®µ÷žèÍ·} +%D \regelmidden{\tfd Ë®µ÷žèÍ·} %D \blanko -%D \regelmidden{\tfb ±û³œÖÐÇ»¶ÒûŽïµ©£¬Žó×í×÷ŽËƪ£¬Œæ»³×ÓÓÉ¡£} +%D \regelmidden{\tfb ±û³œÖÐÇ»¶ÒûŽïµ©£¬Žó×í×÷ŽËƪ£¬Œæ»³×ÓÓÉ¡£} %D \blanko -%D \regelmidden{\tfb ËÕéø} +%D \regelmidden{\tfb ËÕéø} %D \blanko %D Ã÷ÔÂŒžÊ±ÓУ¿°ÑŸÆÎÊÇàÌì¡£²»ÖªÌìÉϹ¬ãÚ£¬œñÏŠÊǺÎÄꣿÎÒÓû³Ë·ç¹éÈ¥ -%D £¬ÓÖ¿ÖÇíÂ¥ÓñÓžßŽŠ²»Ê€º®¡£ÆðÎèŪÇåÓ°£¬ºÎËÆÔÚÈˌ䣿 +%D £¬ÓÖ¿ÖÇíÂ¥ÓñÓžßŽŠ²»Ê€º®¡£ÆðÎèŪÇåÓ°£¬ºÎËÆÔÚÈˌ䣿 %D \blanko %D תÖìžó£¬µÍ»§£¬ÕÕÎÞÃß¡£²»ÓŠÓкޣ¬ºÎÊÂÆ«Ïò±ðʱԲ£¿ÈËÓб¯»¶ÀëºÏ£¬ %D ÔÂÓÐÒõÇçԲȱ£¬ŽËʹÅÄÑÈ«¡£µ«ÔžÈ˳€ŸÃ£¬Ç§Àﹲ濟ꡣ %D \stopsmaller -%D -%D The english translation is: -%D +%D +%D The english translation is: +%D %D \startsmaller -%D \regelmidden{\tfd Tune: Prelude to the Melody of Water} -%D \blanko +%D \regelmidden{\tfd Tune: Prelude to the Melody of Water} +%D \blanko %D \regelmidden{\tfb On the night of the Mid||Autumn Festival of %D 1076, I drank happily till dawn and wrote this in my cups -%D while thinking of Zi||you.} -%D \blanko -%D \regelmidden{\tfb Su Shi} +%D while thinking of Zi||you.} +%D \blanko +%D \regelmidden{\tfb Su Shi} %D \blanko %D How long will the bright moon appear? Wine||cup in hand, I %D ask the sky. I do not know waht time of year it would be %D tonight in the palace on high. Riding the wind, there I %D would fly, yet I fear the crystal palace would be far too %D high and cold for me. I rise and dance, with my shadow I -%D play. On high as on earth, would it be as gay? -%D \blanko +%D play. On high as on earth, would it be as gay? +%D \blanko %D The moon goes round the mansion red though gauze||draped %D windows soft to shed her light upon the sleepless bed. %D Against man she should have no spite. Why then when people @@ -944,7 +1129,7 @@ %D may wax or wane. There has been nothing perfect since the %D olden days. So let us wish that man will live long as he %D can! Though miles apart, we'll share the beauty she -%D displays. +%D displays. %D \stopsmaller %D This package is written in the city of Hasselt, a pretty @@ -955,6 +1140,10 @@ %D be the same, since now I can at least pretend to know the %D glyphs all around the place. The numbers should pose me no %D problems, but I fear I will never manage to recognize those -%D scribles they draw on their pads when thay take your order. +%D scribles they draw on their pads when thay take your order. + +%D To make our lives more easy, we put it here (too): + +\setuptyping[\c!tab=\v!nee] \protect \endinput diff --git a/tex/context/base/font-fil.tex b/tex/context/base/font-fil.tex index 9daebf9fc..7c0b656e6 100644 --- a/tex/context/base/font-fil.tex +++ b/tex/context/base/font-fil.tex @@ -55,6 +55,11 @@ \definefontsynonym [Times-Bold] [tib] [encoding=texnansi] \definefontsynonym [Times-BoldItalic] [tibi] [encoding=texnansi] +\definefontsynonym [Times-MathRoman] [tir] [encoding=texnansi] +\definefontsynonym [Times-MathExtension] [mtex] +\definefontsynonym [Times-MathItalic] [mtmi] +\definefontsynonym [Times-MathSymbol] [mtsy] + \definefontsynonym [LucidaBlackletter] [lbl] [encoding=texnansi] \definefontsynonym [LucidaBright] [lbr] [encoding=texnansi] \definefontsynonym [LucidaBright-Demi] [lbd] [encoding=texnansi] diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex index 258c60125..e00701367 100644 --- a/tex/context/base/font-ini.tex +++ b/tex/context/base/font-ini.tex @@ -71,6 +71,34 @@ 10: neznamy font -- \stopmessages +\startmessages italian library: fonts + title: font del corpo + 1: codifica -- + 2: variante -- caricata + 3: variante sconosciuta -- + 4: corpo del testo -- non definito + 5: stile -- non definito + 6: -- caricato + 7: formato sconosciuto -- + 8: stile -- definito + 9: mappatura -- caricata + 10: file di font sconosciuto -- +\stopmessages + +\startmessages norwegian library: fonts + title: hovedfont + 1: koding -- + 2: variant -- er lest inn + 3: ukjent variant -- + 4: hovedfont -- er ikke definert + 5: stil -- er ikke definert + 6: -- er lest inn + 7: ukjent format -- + 8: stil -- definert + 9: avbildning -- er lest inn + 10: ukjent fontfil -- +\stopmessages + %D This module is one of the oldest modules of \CONTEXT. The %D macros below evolved out of the \PLAIN\ \TEX\ macros and %D therefore use a similar naming scheme (\type{\rm}, @@ -535,16 +563,16 @@ %D families for {\ss sans serif} and \type{teletype} we use the %D more general \type{\tffam}, which stands for typeface. -\newfam\bsfam % 8 (ConTeXt) BoldSlanted -\newfam\bifam % 9 (ConTeXt) BoldItalic -\newfam\scfam % A (ConTeXt) SmallCaps -\newfam\tffam % B (ConTeXt) TypeFace +\chardef\bsfam=8 % \newfam\bsfam % 8 (ConTeXt) BoldSlanted +\chardef\bifam=9 % \newfam\bifam % 9 (ConTeXt) BoldItalic +\chardef\scfam=10 % \newfam\scfam % A (ConTeXt) SmallCaps +\chardef\tffam=11 % \newfam\tffam % B (ConTeXt) TypeFace %D Because Taco needs a few more math families, we reuse %D family~7 for all those typefaces that have no related %D family, and therefore are grouped into one. -\let\nnfam\ttfam % 7 (ReUsed) NoName +\chardef\nnfam=7 % \let\nnfam\ttfam % 7 (ReUsed) NoName %D Normally \type{\mrfam} equals \type{\tffam}, but a more %D distinctive alternatives are possible, for instance the @@ -555,13 +583,21 @@ %D needed for the \AMS\ Symbol Fonts and Extended Lucida %D Bright. -\newfam\mafam % C (ConTeXt) Math A Fam (AmsTeX A) -\newfam\mbfam % D (ConTeXt) Math B Fam (AmsTeX B) -\newfam\mcfam % E (ConTeXt) Math C Fam +\chardef\mafam=12 % \newfam\mafam % C (ConTeXt) Math A Fam (AmsTeX A) +\chardef\mbfam=13 % \newfam\mbfam % D (ConTeXt) Math B Fam (AmsTeX B) +\chardef\mcfam=14 % \newfam\mcfam % E (ConTeXt) Math C Fam +\chardef\mdfam=15 % \newfam\mdfam % F (ConTeXt) Math D Fam (MathTime) %D Because there are 16~families and because \type{\ttfam} -%D is reused, at the moment we have one families left:~F. -%D +%D is reused, at the moment we have no so many families +%D left. By default, we map any newly defined family on the +%D last one (F). + +\def\newfam#1{\chardef#1=15 } + +%D This hack is also needed because in \ETEX\ we are going +%D to reuse the \type {\newfam} allocation counter. + %D To ease the support of font packages, we als define %D shortcuts to these familynames. This is necessary because %D the family names are in fact \type{\chardef}'s, which means @@ -572,7 +608,7 @@ \def\hexnumber#1% {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or - 8\or 9\or A\or B\or C\or D\or E\or F\fi} + 8\or 9\or A\or B\or C\or D\or E\or F\else 0\fi} \edef\hexmrfam {\hexnumber\mrfam} \edef\hexbsfam {\hexnumber\bsfam} \edef\hexmifam {\hexnumber\mifam} \edef\hexbifam {\hexnumber\bifam} @@ -581,8 +617,7 @@ \edef\hexitfam {\hexnumber\itfam} \edef\hexmafam {\hexnumber\mafam} \edef\hexslfam {\hexnumber\slfam} \edef\hexmbfam {\hexnumber\mbfam} \edef\hexbffam {\hexnumber\bffam} \edef\hexmcfam {\hexnumber\mcfam} - -\edef\hexnnfam {\hexnumber\nnfam} +\edef\hexnnfam {\hexnumber\nnfam} \edef\hexmdfam {\hexnumber\mdfam} %D \macros %D {lchexnumber,uchexnumber,lchexnumbers} @@ -593,7 +628,7 @@ \def\lchexnumber#1% {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or - 8\or 9\or a\or b\or c\or d\or e\or f\fi} + 8\or 9\or a\or b\or c\or d\or e\or f\else 0\fi} \let\uchexnumber=\hexnumber @@ -705,73 +740,135 @@ %D These macros enable the use of definitions like \type{sa %D \magfactor3} which saves us both (mis|)|calculations and %D potential mistypings. -%D -%D Because \type{sa} is not a \TEX\ supported alternative, we -%D have to test for it ourselves. In doing so, we need an -%D auxiliary \DIMENSION. We cannot use \type{\scratchdimen} -%D because font loading can happen at any moment due to -%D postponed loading. We could instead have used dirty grouping -%D tricks, but this one works too. +%D +%D Because \type {sa} (scaled at) and \type {mo} (mapped on) +%D are not low level \TEX\ supported alternatives, we have to +%D test for it ourselves. In doing so, we need an auxiliary +%D \DIMENSION. We cannot use \type{\scratchdimen} because font +%D loading can happen at any moment due to postponed loading. +%D We could instead have used dirty grouping tricks, but this +%D one works too. + +%%% \newdimen\scaledfont +%%% +%%% REPLACED +%%% +%%% % \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! +%%% % {\edef\fontscale{#2}% +%%% % \ifx\fontscale\empty +%%% % \expandafter\font\csname#4#5\endcsname=#1\relax +%%% % \else +%%% % \scaledfont=#4\relax +%%% % \expandafter\font\csname#4#5\endcsname=#1 at \fontscale\scaledfont\relax +%%% % \fi} +%%% +%%% \def\splitfontdefinition#1 #2 #3 #4\end% +%%% {\def\somefontname{#1}% +%%% \doifelse{#2}{*} +%%% {\let\somefontspec=\empty} +%%% {\def\somefontspec{ #2 #3}}} +%%% +%%% % \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! +%%% % {\edef\fontscale{#2}% +%%% % \expandafter\splitfontdefinition#1 * * \end +%%% % \ifx\fontscale\empty \else +%%% % \scaledfont=#4\relax +%%% % \def\somefontspec{ at \fontscale\scaledfont}% +%%% % \fi +%%% % \expandafter\font\csname#4#5\endcsname= +%%% % \truefilename{\somefontname}\somefontspec\relax} +%%% +%%% %D We also accept \type{sa a}||\type{sa d} as specification. +%%% +%%% \def\checkfontscale#1#2\end% should be optimized +%%% {\doifnumberelse{#1}{} +%%% {\doifdefinedelse{\??ft\s!default#1} +%%% {\edef\fontscale{\getvalue{\??ft\s!default#1}}} +%%% {\edef\fontscale{1}}}} +%%% +%%% % \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! +%%% % {\edef\fontscale{#2}% +%%% % \expandafter\splitfontdefinition#1 * * \end +%%% % \ifx\fontscale\empty \else +%%% % \expandafter\checkfontscale#2 \end % #2 can be "a " (space!) +%%% % \scaledfont=#4\relax +%%% % \def\somefontspec{ at \fontscale\scaledfont}% +%%% % \fi +%%% % \expandafter\font\csname#4#5\endcsname= +%%% % \truefilename{\somefontname}\somefontspec\relax} +%%% +%%% \def\defaultfontfile{cmtt10} +%%% \edef\nullfontname {\fontname\nullfont} +%%% \edef\dummyfontname {font\strippedcsname\\} +%%% +%%% \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! +%%% {\edef\fontscale{#2}% +%%% \expandafter\splitfontdefinition#1 * * \end +%%% \ifx\fontscale\empty \else +%%% \expandafter\checkfontscale#2 \end % #2 can be "a " (space!) +%%% \scaledfont=#4\relax +%%% \def\somefontspec{ at \fontscale\scaledfont}% +%%% \fi +%%% \edef\fontfile{\truefontname\somefontname}% +%%% \ifx\fontfile\s!unknown +%%% \let\fontfile\defaultfontfile +%%% \else +%%% \edef\fontdata{\truefontdata\somefontname}% +%%% \ifx\fontdata\empty \else +%%% %\@EA\getparameters\@EA[\@EA\fontfile\@EA]\@EA[\fontdata]% +%%% \@EA\rawgetparameters\@EA[\@EA\fontfile\@EA]\@EA[\fontdata]% +%%% \fi +%%% \fi +%%% % faster +%%% %\expandafter\font\csname#4#5\endcsname\fontfile\somefontspec\relax +%%% % nicer +%%% \edef\lastfontname{\fontfile\somefontspec}% +%%% \expandafter\font\csname#4#5\endcsname\lastfontname +%%% \expandafter\font\csname\dummyfontname\endcsname\lastfontname\relax} +%%% % safer but sometimes introducing newlines in the log +%%% %\batchmode +%%% %\font\lastloadedfont\fontfile\somefontspec\relax +%%% %\errorstopmode +%%% %\edef\lastfontname{\fontname\lastloadedfont}% +%%% %\ifx\lastfontname\nullfontname +%%% % \showmessage{\m!fonts}{10}{\fontfile}% +%%% % \expandafter\font\csname#4#5\endcsname=\defaultfontfile\somefontspec\relax +%%% %\else +%%% % \expandafter\let\csname#4#5\endcsname\lastloadedfont +%%% %\fi} \newdimen\scaledfont -% \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! -% {\edef\fontscale{#2}% -% \ifx\fontscale\empty -% \expandafter\font\csname#4#5\endcsname=#1\relax -% \else -% \scaledfont=#4\relax -% \expandafter\font\csname#4#5\endcsname=#1 at \fontscale\scaledfont\relax -% \fi} - -\def\splitfontdefinition#1 #2 #3 #4\end% - {\def\somefontname{#1}% - \doifelse{#2}{*} - {\let\somefontspec=\empty} - {\def\somefontspec{ #2 #3}}} - -% \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! -% {\edef\fontscale{#2}% -% \expandafter\splitfontdefinition#1 * * \end -% \ifx\fontscale\empty \else -% \scaledfont=#4\relax -% \def\somefontspec{ at \fontscale\scaledfont}% -% \fi -% \expandafter\font\csname#4#5\endcsname= -% \truefilename{\somefontname}\somefontspec\relax} +\def\parsefontspec[#1]% + {\edef\somefontspec{#1}% + \@EA\@EA\@EA\doparsefontspec\@EA\somefontspec\space\relax]} -%D We also accept \type{sa a}||\type{sa d} as specification. - -\def\checkfontscale#1#2\end% - {\doifnumberelse{#1}{} - {\doifdefinedelse{\??ft\s!default#1} - {\edef\fontscale{\getvalue{\??ft\s!default#1}}} - {\edef\fontscale{1}}}} - -% \def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! -% {\edef\fontscale{#2}% -% \expandafter\splitfontdefinition#1 * * \end -% \ifx\fontscale\empty \else -% \expandafter\checkfontscale#2 \end % #2 can be "a " (space!) -% \scaledfont=#4\relax -% \def\somefontspec{ at \fontscale\scaledfont}% -% \fi -% \expandafter\font\csname#4#5\endcsname= -% \truefilename{\somefontname}\somefontspec\relax} - -\def\defaultfontfile{cmtt10} -\edef\nullfontname {\fontname\nullfont} -\edef\dummyfontname {font\strippedcsname\\} - -\def\docalculatefont#1 sa #2sa#3*#4*#5*% The spaces are needed! - {\edef\fontscale{#2}% - \expandafter\splitfontdefinition#1 * * \end - \ifx\fontscale\empty \else - \expandafter\checkfontscale#2 \end % #2 can be "a " (space!) - \scaledfont=#4\relax +\def\doparsefontspec#1 #2#3]#4#5% + {\ifx#2\relax + \let\somefontname\somefontspec + \let\somefontspec\empty + \donoparsefontspec{#5}% + \else + \@EA\dodoparsefontspec\@EA[\somefontspec]{#4}{#5}% + \fi} + +\def\dodoparsefontspec[#1 #2#3#4]#5#6% [spec]{sa/mo size}{name} + {\edef\somefontname{#1}% + \edef\fontscale% + {\ifx#2s\ifx#3a#4\fi\else % sa = scaled at + \ifx#2m\ifx#3o#4\fi\fi\fi}% mo = mapped on + \ifx\fontscale\empty + \edef\somefontspec{ #2#3#4}% + \else + \expandafter\checkfontscale\fontscale\end + \scaledfont=#5\relax + \ifx#2m\setmappedfontsize\scaledfont\fi \def\somefontspec{ at \fontscale\scaledfont}% \fi - \edef\fontfile{\truefontname\somefontname}% + \donoparsefontspec{#6}} + +\def\donoparsefontspec#1% + {\edef\fontfile{\truefontname\somefontname}% \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \else @@ -781,23 +878,37 @@ \@EA\rawgetparameters\@EA[\@EA\fontfile\@EA]\@EA[\fontdata]% \fi \fi - % faster - %\expandafter\font\csname#4#5\endcsname\fontfile\somefontspec\relax - % nicer - \edef\lastfontname{\fontfile\somefontspec}% - \expandafter\font\csname#4#5\endcsname\lastfontname - \expandafter\font\csname\dummyfontname\endcsname\lastfontname\relax} - % safer but sometimes introducing newlines in the log - %\batchmode - %\font\lastloadedfont\fontfile\somefontspec\relax - %\errorstopmode - %\edef\lastfontname{\fontname\lastloadedfont}% - %\ifx\lastfontname\nullfontname - % \showmessage{\m!fonts}{10}{\fontfile}% - % \expandafter\font\csname#4#5\endcsname=\defaultfontfile\somefontspec\relax - %\else - % \expandafter\let\csname#4#5\endcsname\lastloadedfont - %\fi} + \edef\lastfontname{\fontfile\somefontspec}% not really needed + \expandafter\font\csname#1\endcsname\lastfontname + % the second \font definition prevents fuzzy font refs + % \expandafter\font\csname\dummyfontname\endcsname\lastfontname + % but somehow they changed tex so that it does not matter any more + \relax} + +\def\defaultfontfile{cmtt10} +\edef\nullfontname {\fontname\nullfont} +\edef\dummyfontname {font\strippedcsname\\} + +% safer but sometimes introducing newlines in the log +% +% \batchmode +% \font\lastloadedfont\fontfile\somefontspec\relax +% \errorstopmode +% \edef\lastfontname{\fontname\lastloadedfont}% +% \ifx\lastfontname\nullfontname +% \showmessage{\m!fonts}{10}{\fontfile}% +% \expandafter\font\csname#1\endcsname=\defaultfontfile\somefontspec\relax +% \else +% \expandafter\let\csname#1\endcsname\lastloadedfont +% \fi + +%D We also accept \type{sa a}||\type{sa d} as specification. + +\def\checkfontscale#1#2\end% should be optimized + {\doifnumberelse{#1}{} + {\doifdefinedelse{\??ft\s!default#1} + {\edef\fontscale{\getvalue{\??ft\s!default#1}}} + {\edef\fontscale{1}}}} %D The duplicate font definition, using the ever the same dummy %D font name, results in less fuzzy error messages. In the log @@ -878,9 +989,10 @@ %D one for local use: %D %D \starttypen -%D \definefont[Some][LucidaBright at 100pt] \Some some text -%D \definefont[More][LucidaBright scaled 3000] \More more text -%D \definefont[Last][LucidaBright sa 5.4] \Last last text +%D \definefont[Some][LucidaBright at 100pt] \Some some +%D \definefont[More][LucidaBright scaled 3000] \More more +%D \definefont[Nice][LucidaBright mp 2] \Nice nice +%D \definefont[Text][LucidaBright sa 5.4] \Text last %D \stoptypen %D %D The implementation one looks familiar: @@ -888,26 +1000,40 @@ \def\definefont% {\dodoubleargument\dodefinefont} -% \def\dodefinefont[#1][#2]% -% {\unexpanded\setvalue{#1}{\dododefinefont{#1}#2 sa sa*}} -% -% A more friendly version, which defaults to \type {sa 1} is: +%%% REPLACED +%%% +%%% \def\dodefinefont[#1][#2]% +%%% {\doifinstringelse{ }{#2} +%%% {\unexpanded\setvalue{#1}{\dododefinefont{#1}#2 sa sa*}} +%%% {\dodefinefont[#1][#2 sa 1]}} +%%% +%%% \def\dododefinefont#1#2sa #3sa#4*% +%%% {\edef\fontscale{#3}% +%%% \expandafter\splitfontdefinition#2 * * \end +%%% \ifx\fontscale\empty\else % new 2000/8/31 +%%% \expandafter\checkfontscale#3 \end +%%% \fi +%%% \expandafter\font\csname#1\endcsname=\truefontname\somefontname +%%% \ifx\fontscale\empty +%%% \somefontspec +%%% \else +%%% \space at \fontscale\bodyfontsize +%%% \fi +%%% \getvalue{#1}} \def\dodefinefont[#1][#2]% {\doifinstringelse{ }{#2} - {\unexpanded\setvalue{#1}{\dododefinefont{#1}#2 sa sa*}} + {\unexpanded\setvalue{#1}{\dododefinefont{#1}{#2}}} {\dodefinefont[#1][#2 sa 1]}} -\def\dododefinefont#1#2sa #3sa#4*% - {\edef\fontscale{#3}% - \expandafter\splitfontdefinition#2 * * \end - \expandafter\font\csname#1\endcsname=\truefontname\somefontname - \ifx\fontscale\empty - \somefontspec - \else - \space at \fontscale\bodyfontsize - \fi - \getvalue{#1}} +%D The * makes the switch local, so that we can redefine a +%D logical name and/or change the size in between. + +% \def\dododefinefont#1#2% +% {\parsefontspec[#2]{\bodyfontsize}{#1}\getvalue{#1}} + +\def\dododefinefont#1#2% + {\parsefontspec[#2]{\bodyfontsize}{*#1*}\getvalue{*#1*}} %D I considered checking for mistakenly use of \PLAIN's %D \type{\magstep}'s but although it would take only a few @@ -919,11 +1045,54 @@ %D \definebodyfont [12pt] [rm] [hyphenchar=45] %D \stoptypen +%%% REPLACED +%%% +%%% \beginTEX +%%% +%%% \def\dodoloadfont#1#2#3#4% +%%% {\edef\calculatedfont{\csname\??ft#1#2#3\endcsname\space}% +%%% \expandafter\docalculatefont\calculatedfont sa sa*#1*#2#3*% +%%% \@EA\hyphenchar\csname#1#2#3\endcsname= +%%% \@EA\ifx\csname\??ft#1#2\s!hyphenchar\endcsname\relax +%%% #4% +%%% \else +%%% \csname\??ft#1#2\s!hyphenchar\endcsname +%%% \fi\relax +%%% \csname#1#2#3\endcsname} +%%% +%%% \endTEX +%%% +%%% \beginETEX \ifcsname +%%% +%%% \def\dodoloadfont#1#2#3#4% +%%% {\edef\calculatedfont{\csname\??ft#1#2#3\endcsname\space}% +%%% \expandafter\docalculatefont\calculatedfont sa sa*#1*#2#3*% +%%% \@EA\hyphenchar\csname#1#2#3\endcsname= +%%% \ifcsname\??ft#1#2\s!hyphenchar\endcsname +%%% \csname\??ft#1#2\s!hyphenchar\endcsname +%%% \else +%%% #4% +%%% \fi\relax +%%% \csname#1#2#3\endcsname} +%%% +%%% \endETEX + +%D The loading macro is used in two macros. One of them takes +%D care of fixed width teletype fonts. + +\def\doloadfont#1#2#3% + {%\debuggerinfo{\m!fonts}{loaded #1#2#3}% + \dodoloadfont{#1}{#2}{#3}{45}} + +\def\doloadttfont#1#2#3% + {%\debuggerinfo{\m!fonts}{loaded fixed #1#2#3}% + \dodoloadfont{#1}{#2}{#3}{-1}} + \beginTEX \def\dodoloadfont#1#2#3#4% - {\edef\calculatedfont{\csname\??ft#1#2#3\endcsname\space}% - \expandafter\docalculatefont\calculatedfont sa sa*#1*#2#3*% + {\edef\calculatedfont{[\csname\??ft#1#2#3\endcsname]}% + \@EA\parsefontspec\calculatedfont{#1}{#1#2#3}% \@EA\hyphenchar\csname#1#2#3\endcsname= \@EA\ifx\csname\??ft#1#2\s!hyphenchar\endcsname\relax #4% @@ -937,8 +1106,8 @@ \beginETEX \ifcsname \def\dodoloadfont#1#2#3#4% - {\edef\calculatedfont{\csname\??ft#1#2#3\endcsname\space}% - \expandafter\docalculatefont\calculatedfont sa sa*#1*#2#3*% + {\edef\calculatedfont{[\csname\??ft#1#2#3\endcsname]}% + \@EA\parsefontspec\calculatedfont{#1}{#1#2#3}% \@EA\hyphenchar\csname#1#2#3\endcsname= \ifcsname\??ft#1#2\s!hyphenchar\endcsname \csname\??ft#1#2\s!hyphenchar\endcsname @@ -949,16 +1118,58 @@ \endETEX -%D The loading macro is used in two macros. One of them takes -%D care of fixed width teletype fonts. +%D \macros +%D {mapfontsize} +%D +%D For special purposes, like in math, you may want to use +%D slightly different sizes than the ones given. This happens +%D for instance with the Math Times fonts. Mapped font sizes +%D can be specified by using the \type {mo} key instead of +%D \type {sa} in font definitions. +%D +%D \startbuffer +%D \mapfontsize[10pt][11pt] +%D \mapfontsize[11pt][12pt] +%D \mapfontsize[12pt][13pt] +%D +%D \definefont[test][Serif]\test TEST \par +%D \definefont[test][Serif sa 5]\test TEST \par +%D \definefont[test][Serif mo 5]\test TEST \par +%D \definefont[test][Serif sa d]\test TEST \par +%D \definefont[test][Serif at 60pt]\test TEST \par +%D \definefont[test][Serif scaled 6000]\test TEST \par +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startopelkaar +%D \haalbuffer +%D \stopopelkaar -\def\doloadfont#1#2#3% - {%\debuggerinfo{\m!fonts}{loaded #1#2#3}% - \dodoloadfont{#1}{#2}{#3}{45}} +\def\mapfontsize% + {\dodoubleargument\domapfontsize} -\def\doloadttfont#1#2#3% - {%\debuggerinfo{\m!fonts}{loaded fixed #1#2#3}% - \dodoloadfont{#1}{#2}{#3}{-1}} +\def\domapfontsize[#1][#2]% + {\scratchdimen#1\relax % \relax is really needed here + \setvalue{\??ft*\the\scratchdimen}{#2}} + +\beginTEX + +\def\setmappedfontsize#1% + {\expandafter\ifx\csname\??ft*\the#1\endcsname\relax\else + #1=\csname\??ft*\the#1\endcsname + \fi} + +\endTEX + +\beginETEX \ifcsname + +\def\setmappedfontsize#1% + {\ifcsname\??ft*\the#1\endcsname + #1=\csname\??ft*\the#1\endcsname + \fi} + +\endETEX %D \macros %D {getfontname} @@ -1340,7 +1551,6 @@ %D These macros show that quite some definitions take place. %D Fonts are not loaded yet! This means that at format %D generation time, no font files are preloaded. -%D % %D We could have use \type{\unexpanded\setvalue} instead of % %D the \type{\donottest} prefixes. However, this would lead to @@ -1479,7 +1689,7 @@ %D All things related to fonts are grouped into files with %D names like \type{font-cmr}. These files are loaded by: -\def\resetfontdefinitionfile#1% +\def\resetfontdefinitionfile[#1]% {\letbeundefined{\c!file\f!fontprefix#1}} \def\doreadfontdefinitionfile#1% @@ -2140,7 +2350,6 @@ \def\dosettypeface#1#2% {\doifdefinedelse{@\normalizedbodyfontsize#1#2@} % the definition bound one -% {\edef\characterencoding{\getvalue{@\normalizedbodyfontsize#1#2@}}} {\enablecoding[\getvalue{@\normalizedbodyfontsize#1#2@}]} {\enablecoding[\s!default]}% \edef\fontalternative{#2}% @@ -2153,6 +2362,8 @@ {\expandafter\fam\getvalue{\c!nn\s!fam}}% \getvalue{#1#2}% \ifcase\currentxfontsize\or\tx\or\txx\fi + \doifdefined{\purefontname\font\s!handling} % the file bound one + {\enablehandling[\getvalue{\purefontname\font\s!handling}]}% \doifdefined{\purefontname\font\s!encoding} % the file bound one {\enablecoding[\getvalue{\purefontname\font\s!encoding}]}% \doifdefinedelse{\purefontname\font\s!mapping} % the file bound one @@ -2723,8 +2934,90 @@ % \fi % \font\temp=\truefontname{#1} at \bodyfontsize \temp#2\relax}} -\def\getglyph#1#2% - {{\definefont[\s!dummy][#1 sa \currentfontscale]\dummy#2}} +% \def\getglyph#1#2% +% {{\definefont[\s!dummy][#1 sa \currentfontscale]\dummy#2}} + +\def\fontstringA% + {\ifx\fontstyle\c!rm \s!Serif \else + \ifx\fontstyle\c!ss \s!Sans \else + \ifx\fontstyle\c!tt \s!Mono \else + \s!Serif \fi\fi\fi} + +\def\fontstringB% + {\ifx\fontstyle\c!rm \s!Regular \else + \ifx\fontstyle\c!ss \s!Support \else + \ifx\fontstyle\c!tt \s!Type \else + \s!Serif \fi\fi\fi} + +\def\fontstringC% + {\ifnum\fam=\bffam \s!Bold \else + \ifnum\fam=\slfam \s!Slanted \else + \ifnum\fam=\itfam \s!Italic \else + \ifnum\fam=\bsfam \s!BoldSlanted \else + \ifnum\fam=\bifam \s!BoldItalic \s!Regular \fi\fi\fi\fi\fi} + +\beginETEX \ifcsname + +\def\glyphfontfile#1% + {#1% + \ifcsname\??ff#1\fontstringA\fontstringC\endcsname + \fontstringA\fontstringC + \else\ifcsname\??ff#1\fontstringB\fontstringC\endcsname + \fontstringB\fontstringC + \else\ifcsname\??ff#1\fontstringA\endcsname + \fontstringA + \else\ifcsname\??ff#1\fontstringB\endcsname + \fontstringB + \else\ifcsname\??ff#1\fontstringC\endcsname + \fontstringC + \fi\fi\fi\fi\fi} + +\endETEX + +\beginTEX \ifcsname + +\def\glyphfontfile#1% + {#1% + \expandafter\ifx\csname\??ff#1\fontstringA\fontstringC\endcsname\relax + \expandafter\ifx\csname\??ff#1\fontstringB\fontstringC\endcsname\relax + \expandafter\ifx\csname\??ff#1\fontstringA\endcsname\relax + \expandafter\ifx\csname\??ff#1\fontstringB\endcsname\relax + \expandafter\ifx\csname\??ff#1\fontstringC\endcsname\relax + \else \fontstringC \fi + \else \fontstringB \fi + \else \fontstringA \fi + \else \fontstringB\fontstringC \fi + \else \fontstringA\fontstringC \fi} + +\endTEX + +\def\getglyph#1#2% + {{\definefont[\s!dummy][\glyphfontfile{#1} sa \currentfontscale]\dummy#2}} + +%D The last implementation of \type {\getglyph} permits +%D definitions like: +%D +%D \starttypen +%D \definefontsynonym [EuroSans] [eurose] +%D \definefontsynonym [EuroSansBold] [euroseb] +%D \definefontsynonym [EuroSansItalic] [eurosei] +%D \definefontsynonym [EuroSansSlanted] [eurosei] +%D \definefontsynonym [EuroSansBoldItalic] [eurosebi] +%D \definefontsynonym [EuroSansBoldSlanted] [eurosebi] +%D +%D \definesymbol [euro] [\getglyph{Euro}{\char160}] +%D +%D \def\euro{\symbol[euro]} +%D \stoptypen +%D +%D These definitions guarantee that the next calls work okay: +%D +%D \starttypen +%D \ss \tf\euro \bf\euro \sla\euro \itd\euro \bs\euro \bic\euro +%D \stoptypen +%D +%D The shape as well as the size is adapted to the current +%D environment. %D Fonts can only be used when loaded. In \CONTEXT\ we %D postpone the loading of fonts, even when we load \PLAIN. @@ -2774,7 +3067,7 @@ %D %D We are going to redefine \type{\ss} but for those wo still %D want to have access to the german \SS, we save it's value in -%D \type{\SS}. Ok, I should have used \type{\sf} insead of +%D \type{\SS}. Ok, I should have used \type{\sf} instead of %D \type{\ss} in the first place. \ifx\undefined\SS \let\SS=\ss \fi diff --git a/tex/context/base/font-uni.tex b/tex/context/base/font-uni.tex index 800a45235..2c0e2a690 100644 --- a/tex/context/base/font-uni.tex +++ b/tex/context/base/font-uni.tex @@ -37,6 +37,14 @@ 21: Verwenden von (pdf)eTeX ist sicherer \stopmessages +\startmessages italian library: fonts + 21: l'uso di (pdf)eTeX è più sicuro +\stopmessages + +\startmessages norwegian library: fonts + 21: å bruke (pdf)eTeX er tryggere +\stopmessages + \unprotect %D \macros @@ -391,7 +399,7 @@ \definefontsynonym[#2\s!Italic] [#2\s!Regular]% \definefontsynonym[#2\s!BoldSlanted][#2\s!Slanted]% \definefontsynonym[#2\s!BoldItalic] [#2\s!Italic]}% - \setvalue{#1}{\enableunicodefont{#1}}}} + \unexpanded\setvalue{#1}{\enableunicodefont{#1}}}} \def\setupunicodefont% {\dodoubleempty\dosetupunicodefont} diff --git a/tex/context/base/java-fld.tex b/tex/context/base/java-fld.tex index d349392e8..0ce30f8fc 100644 --- a/tex/context/base/java-fld.tex +++ b/tex/context/base/java-fld.tex @@ -11,6 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% will be simplified, since we now parse functions + % nu nog alles geladen, moet dus anders \startJSpreamble {Sanitize_TeX_Input} used later @@ -125,7 +127,9 @@ event.value = Sanitized_TeX_String(event.value) ; \stopJScode -\startJSpreamble {Do_With_Field} used now +%\startJSpreamble {Do_With_Field} used now + +\startJSpreamble {Field} used now var visible_field = new Array() ; % no garbage collection ! var visible_fields = 0 ; @@ -188,19 +192,22 @@ function Flip_Fields ( Name ) { v.hidden = !v.hidden ; v.value = "On" } } } -\stopJSpreamble +function Forget_Changes () + { this.dirty = false } -\startJScode{Hide_When_Down} Hide_When_Down() \stopJScode -\startJScode{Hide_Field} Hide_Field(JS_S_1) \stopJScode -\startJScode{Vide_Field} Vide_Field(JS_S_1) \stopJScode -\startJScode{Toggle_Hide} Toggle_Hide(JS_S_1) \stopJScode -\startJScode{Field_On} Field_On(JS_S_1) \stopJScode -\startJScode{Field_Off} Field_Off(JS_S_1) \stopJScode -\startJScode{Toggle_Value} Toggle_Value(JS_S_1) \stopJScode -\startJScode{Toggle_Read} Toggle_Read(JS_S_1) \stopJScode -\startJScode{Flip_Fields} Flip_Fields(JS_S_1) \stopJScode +\stopJSpreamble -\startJScode{Forget_Changes} this.dirty = false \stopJScode +%\startJScode{Hide_When_Down} Hide_When_Down() \stopJScode +%\startJScode{Hide_Field} Hide_Field(JS_S_1) \stopJScode +%\startJScode{Vide_Field} Vide_Field(JS_S_1) \stopJScode +%\startJScode{Toggle_Hide} Toggle_Hide(JS_S_1) \stopJScode +%\startJScode{Field_On} Field_On(JS_S_1) \stopJScode +%\startJScode{Field_Off} Field_Off(JS_S_1) \stopJScode +%\startJScode{Toggle_Value} Toggle_Value(JS_S_1) \stopJScode +%\startJScode{Toggle_Read} Toggle_Read(JS_S_1) \stopJScode +%\startJScode{Flip_Fields} Flip_Fields(JS_S_1) \stopJScode +% +%\startJScode{Forget_Changes} this.dirty = false \stopJScode \definereference[ForgetChanges][JS(Forget_Changes)] @@ -219,7 +226,7 @@ function Flip_Fields ( Name ) % { v = this.getField(FieldSet+":"+1) } % if (v) % { v.value = "On" } -% break } +% break } % i++ } % else % { break } } } @@ -229,8 +236,58 @@ function Flip_Fields ( Name ) % \startJScode {Walk_Field} uses {Walk_Field} % Walk_Field (JS_S_1) ; % \stopJScode +% +% \startJSpreamble {Set_Field} used later +% +% function Set_Field ( FieldSet, FieldName ) +% { var i = 1 ; +% while (true) +% { v = this.getField(FieldSet+":"+i) ; +% if (!v) +% { break } +% else if (i==FieldName) +% { v.value = "On" } +% else +% { v.value = "Off" } +% i++ } } +% +% \stopJSpreamble +% +% \startJScode {Set_Field} uses {Set_Field} +% Set_Field (JS_S_1,JS_S_2) ; +% \stopJScode -\startJSpreamble {Walk_Field} used later +\startJSpreamble {FieldStack} used later + +function Reset_Fields ( FieldSet ) + { var i = 1 ; + while (true) + { v = this.getField(FieldSet+":"+i) ; + if (!v) + { break } + else + { v.value = "Off" } + i++ } } + +function Set_Fields ( FieldSet ) + { var i = 1 ; + while (true) + { v = this.getField(FieldSet+":"+i) ; + if (!v) + { break } + else + { v.value = "On" } + i++ } } + +function Set_Field ( FieldSet, FieldName ) + { Reset_Fields(FieldSet) ; + v = this.getField(FieldSet+":"+FieldName) ; + if (v) { v.value = "On" } } + +function Reset_Field ( FieldSet, FieldName ) + { Set_Fields(FieldSet) ; + v = this.getField(FieldSet+":"+FieldName) ; + if (v) { v.value = "Off" } } function Walk_Field ( FieldSet ) { var i = 1 ; @@ -252,28 +309,4 @@ function Walk_Field ( FieldSet ) \stopJSpreamble -\startJScode {Walk_Field} uses {Walk_Field} - Walk_Field (JS_S_1) ; -\stopJScode - -\startJSpreamble {Set_Field} used later - -function Set_Field ( FieldSet, FieldName ) - { var i = 1 ; - while (true) - { v = this.getField(FieldSet+":"+i) ; - if (!v) - { break } - else if (i==FieldName) - { v.value = "On" } - else - { v.value = "Off" } - i++ } } - -\stopJSpreamble - -\startJScode {Set_Field} uses {Set_Field} - Set_Field (JS_S_1,JS_S_2) ; -\stopJScode - \endinput diff --git a/tex/context/base/java-ini.tex b/tex/context/base/java-ini.tex index d3c4aff0b..301834a01 100644 --- a/tex/context/base/java-ini.tex +++ b/tex/context/base/java-ini.tex @@ -57,6 +57,18 @@ 2: neznama preambule -- \stopmessages +\startmessages italian library: javascript + title: javascript + 1: caricamento dello script set -- + 2: preambolo sconosciuto -- +\stopmessages + +\startmessages norwegian library: javascript + title: javascript + 1: leser inn scriptsett -- + 2: ukjent 'preamble' -- +\stopmessages + %D \TEX\ is not the right tool to check the \JAVA\ code; the %D most we can do is reporting some passed variables: @@ -643,8 +655,8 @@ %D \stoptypen %D %D The not so complicated implementation of this macro is: - -\def\douseJSscripts#1% + +\def\dodouseJSscripts#1% {\doifelse{#1}{\v!reset} {\let\allJSpreambles=\empty} {\doifundefined{\c!file\f!javascriptprefix#1} @@ -658,8 +670,12 @@ \stopreadingfile}% \egroup}}} -\def\useJSscripts[#1]% - {\processcommalist[#1]\douseJSscripts} +\def\douseJSscripts[#1][#2]% + {\processcommalist[#1]\dodouseJSscripts + \processcommalist[#2]\useJSpreamblenow} + +\def\useJSscripts% + {\dodoubleempty\douseJSscripts} \protect diff --git a/tex/context/base/lang-alt.tex b/tex/context/base/lang-alt.tex index e721219ae..815fa570c 100644 --- a/tex/context/base/lang-alt.tex +++ b/tex/context/base/lang-alt.tex @@ -11,13 +11,19 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\writestatus{loading}{Altaic Languages} + +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + % Uigur, Uzbek % Azeri/Azerbaijani, Chuvash, Turkish, Turkmen % Kazakh, Kazar, Kireghiz, Noghay, Talar % Buryat, Kalmuck, Khalkha -\writestatus{loading}{Altaic Languages} - \unprotect \installlanguage diff --git a/tex/context/base/lang-ana.tex b/tex/context/base/lang-ana.tex index 19fecb0c9..8f14082c4 100644 --- a/tex/context/base/lang-ana.tex +++ b/tex/context/base/lang-ana.tex @@ -13,6 +13,12 @@ \writestatus{loading}{Anatolian Languages} +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + \unprotect \protect diff --git a/tex/context/base/lang-art.tex b/tex/context/base/lang-art.tex index 87d243a62..0c1c775b2 100644 --- a/tex/context/base/lang-art.tex +++ b/tex/context/base/lang-art.tex @@ -11,10 +11,16 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% Esperanto - \writestatus{loading}{Artificial Languages} +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + +% Esperanto + \unprotect \protect diff --git a/tex/context/base/lang-bal.tex b/tex/context/base/lang-bal.tex index 7ef8e8e49..4c5907320 100644 --- a/tex/context/base/lang-bal.tex +++ b/tex/context/base/lang-bal.tex @@ -11,10 +11,16 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% Lettish/Latvian, Lithuanian - \writestatus{loading}{Baltic Languages} +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + +% Lettish/Latvian, Lithuanian + \unprotect \protect diff --git a/tex/context/base/lang-cel.tex b/tex/context/base/lang-cel.tex index b4eae8b52..d22705804 100644 --- a/tex/context/base/lang-cel.tex +++ b/tex/context/base/lang-cel.tex @@ -11,10 +11,16 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% Breton, Welsh, Irish, Manx, Scottish Gaelic - \writestatus{loading}{Celtic Languages} +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + +% Breton, Welsh, Irish, Manx, Scottish Gaelic + \unprotect \protect diff --git a/tex/context/base/lang-ger.tex b/tex/context/base/lang-ger.tex index e539bdc70..006265a55 100644 --- a/tex/context/base/lang-ger.tex +++ b/tex/context/base/lang-ger.tex @@ -11,11 +11,23 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\writestatus{loading}{Germanic Languages} + +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. +%D +%D \starttabulate[|lB|l|] +%D \NC Norwegian \NC Hans Fredrik Nordhaug \NC \NR +%D \NC Danish \NC Arne Jorgensen \NC \NR % check the o +%D \NC Afrikaans \NC \NC \NR +%D \stoptabulate + % Danish, Faeroese, Icelandic, Norwegian, Swedish, German, Yiddish % Afrikaans, Dutch, English, Flemush, Frisian, Plattdeutsch -\writestatus{loading}{Germanic Languages} - \unprotect \installlanguage @@ -63,16 +75,15 @@ \installlanguage [\s!da] [\c!spatiering=\v!opelkaar, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!datum={\v!jaar,\ ,\v!maand,\ ,\v!dag}, - \c!status=\v!stop] + \c!leftsentence={\hbox{--\hskip.5em}}, + \c!rightsentence={\hbox{\hskip.5em--}}, + \c!leftsubsentence={--}, + \c!rightsubsentence={--}, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsinglesixquote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoublesixquote, + \c!datum={\v!dag,{.},\ ,\v!maand,\ ,\v!jaar}] \installlanguage [\s!sv] @@ -113,7 +124,7 @@ \c!rightquote=\upperrightsingleninequote, \c!leftquotation=\upperleftdoublesixquote, \c!rightquotation=\upperrightdoubleninequote, - \c!datum={\v!jaar,\ ,\v!maand,\ ,\v!dag}, + \c!datum={\v!dag,{.},\ ,\v!maand,\ ,\v!jaar}, \c!status=\v!stop] %D Hey look, some experiment: @@ -145,6 +156,7 @@ %D For compatibility reasons we also define: \installlanguage [du] [\s!de] % old times context +\installlanguage [sp] [\s!es] % old times context \installlanguage [usenglish] [\s!us] \installlanguage [ukenglish] [\s!uk] @@ -155,109 +167,145 @@ \installlanguage [swedish] [\s!sv] \installlanguage [afrikaans] [\s!af] \installlanguage [norwegian] [\s!no] - -%D The next section is dedicated to Tobias Burnus. - -\startlanguagespecifics[\s!de] - - \installcompoundcharacter "a {\moveaccent{-.1ex}\"a\midworddiscretionary} - \installcompoundcharacter "e {\moveaccent{-.1ex}\"e\midworddiscretionary} - \installcompoundcharacter "i {\moveaccent{-.1ex}\"\i\midworddiscretionary} - \installcompoundcharacter "o {\moveaccent{-.1ex}\"o\midworddiscretionary} - \installcompoundcharacter "u {\moveaccent{-.1ex}\"u\midworddiscretionary} - \installcompoundcharacter "s {\SS} - \installcompoundcharacter "z {\SS} - - \installcompoundcharacter "A {\smashaccent\"A} - \installcompoundcharacter "E {\smashaccent\"E} - \installcompoundcharacter "I {\smashaccent\"I} - \installcompoundcharacter "O {\smashaccent\"O} - \installcompoundcharacter "U {\smashaccent\"U} - \installcompoundcharacter "Z {SZ} - \installcompoundcharacter "S {SS} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!de] - - \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} - \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} - \installcompoundcharacter "ll {\discretionary{ll-}{l}{ll}} - \installcompoundcharacter "mm {\discretionary{mm-}{m}{mm}} - \installcompoundcharacter "nn {\discretionary{nn-}{n}{nn}} - \installcompoundcharacter "pp {\discretionary{pp-}{p}{pp}} - \installcompoundcharacter "rr {\discretionary{rr-}{r}{rr}} - \installcompoundcharacter "tt {\discretionary{tt-}{t}{tt}} - - \installcompoundcharacter "CK {\discretionary {K-}{K}{CK}} - \installcompoundcharacter "FF {\discretionary{FF-}{F}{FF}} - \installcompoundcharacter "LL {\discretionary{LL-}{L}{LL}} - \installcompoundcharacter "MM {\discretionary{MM-}{M}{MM}} - \installcompoundcharacter "NN {\discretionary{NN-}{N}{NN}} - \installcompoundcharacter "PP {\discretionary{PP-}{P}{PP}} - \installcompoundcharacter "RR {\discretionary{RR-}{R}{RR}} - \installcompoundcharacter "TT {\discretionary{TT-}{T}{TT}} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!de] - - \installcompoundcharacter "` {\handlequotation\c!leftquotation} - \installcompoundcharacter "' {\handlequotation\c!rightquotation} - \installcompoundcharacter ". {\kern.1em\ignorespaces} - - \def\setupDElanguage% - {\setuplanguage - [\s!de] - [\c!leftsentence=\leftguillemot, - \c!rightsentence=\rightguillemot, - \c!leftsubsentence=\leftsubguillemot, - \c!rightsubsentence=\rightsubguillemot]} - - \installcompoundcharacter "< {{\setupDElanguage|<|}} - \installcompoundcharacter "> {{\setupDElanguage|>|}} - -\stoplanguagespecifics - -%D An experimental hack: - -\startencoding[pdfdoc] - \startlanguagespecifics[\s!de]% hm, a % is needed - \defineactivecharacter " {\"} % no {\simplifiedcompoundcharacter"} - \stoplanguagespecifics -\stopencoding - -\startencoding[ec] - \startlanguagespecifics[\s!de]% - \installcompoundcharacter "a {\"a} - \installcompoundcharacter "e {\"e} - \installcompoundcharacter "i {\"\i} - \installcompoundcharacter "o {\"o} - \installcompoundcharacter "u {\"u} - \installcompoundcharacter "A {\"A} - \installcompoundcharacter "E {\"E} - \installcompoundcharacter "I {\"I} - \installcompoundcharacter "O {\"O} - \installcompoundcharacter "U {\"U} - \stoplanguagespecifics -\stopencoding - -\startencoding[texnansi] - \startlanguagespecifics[\s!de]% - \installcompoundcharacter "a {\"a} - \installcompoundcharacter "e {\"e} - \installcompoundcharacter "i {\"\i} - \installcompoundcharacter "o {\"o} - \installcompoundcharacter "u {\"u} - \installcompoundcharacter "A {\"A} - \installcompoundcharacter "E {\"E} - \installcompoundcharacter "I {\"I} - \installcompoundcharacter "O {\"O} - \installcompoundcharacter "U {\"U} - \stoplanguagespecifics -\stopencoding - -%D This hack should be perfected. +\installlanguage [norsk] [\s!no] % bonus switch + +% GERMAN +% +% %D The next section is dedicated to Tobias Burnus. +% +% \startlanguagespecifics[\s!de] +% +% \installcompoundcharacter "a {\moveaccent{-.1ex}\"a\midworddiscretionary} +% \installcompoundcharacter "e {\moveaccent{-.1ex}\"e\midworddiscretionary} +% \installcompoundcharacter "i {\moveaccent{-.1ex}\"\i\midworddiscretionary} +% \installcompoundcharacter "o {\moveaccent{-.1ex}\"o\midworddiscretionary} +% \installcompoundcharacter "u {\moveaccent{-.1ex}\"u\midworddiscretionary} +% \installcompoundcharacter "s {\SS} +% \installcompoundcharacter "z {\SS} +% +% \installcompoundcharacter "A {\smashaccent\"A} +% \installcompoundcharacter "E {\smashaccent\"E} +% \installcompoundcharacter "I {\smashaccent\"I} +% \installcompoundcharacter "O {\smashaccent\"O} +% \installcompoundcharacter "U {\smashaccent\"U} +% \installcompoundcharacter "Z {SZ} +% \installcompoundcharacter "S {SS} +% +% \stoplanguagespecifics +% +% \startlanguagespecifics[\s!de] +% +% \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} +% \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} +% \installcompoundcharacter "ll {\discretionary{ll-}{l}{ll}} +% \installcompoundcharacter "mm {\discretionary{mm-}{m}{mm}} +% \installcompoundcharacter "nn {\discretionary{nn-}{n}{nn}} +% \installcompoundcharacter "pp {\discretionary{pp-}{p}{pp}} +% \installcompoundcharacter "rr {\discretionary{rr-}{r}{rr}} +% \installcompoundcharacter "tt {\discretionary{tt-}{t}{tt}} +% +% \installcompoundcharacter "CK {\discretionary {K-}{K}{CK}} +% \installcompoundcharacter "FF {\discretionary{FF-}{F}{FF}} +% \installcompoundcharacter "LL {\discretionary{LL-}{L}{LL}} +% \installcompoundcharacter "MM {\discretionary{MM-}{M}{MM}} +% \installcompoundcharacter "NN {\discretionary{NN-}{N}{NN}} +% \installcompoundcharacter "PP {\discretionary{PP-}{P}{PP}} +% \installcompoundcharacter "RR {\discretionary{RR-}{R}{RR}} +% \installcompoundcharacter "TT {\discretionary{TT-}{T}{TT}} +% +% \stoplanguagespecifics +% +% \startlanguagespecifics[\s!de] +% +% \installcompoundcharacter "` {\handlequotation\c!leftquotation} +% \installcompoundcharacter "' {\handlequotation\c!rightquotation} +% \installcompoundcharacter ". {\kern.1em\ignorespaces} +% +% \def\setupDElanguage% +% {\setuplanguage +% [\s!de] +% [\c!leftsentence=\leftguillemot, +% \c!rightsentence=\rightguillemot, +% \c!leftsubsentence=\leftsubguillemot, +% \c!rightsubsentence=\rightsubguillemot]} +% +% \installcompoundcharacter "< {{\setupDElanguage|<|}} +% \installcompoundcharacter "> {{\setupDElanguage|>|}} +% +% \stoplanguagespecifics +% +% %D An experimental hack: +% +% \startencoding[pdfdoc] +% \startlanguagespecifics[\s!de]% hm, a % is needed +% \defineactivecharacter " {\"} % no {\simplifiedcompoundcharacter"} +% \stoplanguagespecifics +% \stopencoding +% +% \startencoding[ec] +% \startlanguagespecifics[\s!de]% +% \installcompoundcharacter "a {\"a} +% \installcompoundcharacter "e {\"e} +% \installcompoundcharacter "i {\"\i} +% \installcompoundcharacter "o {\"o} +% \installcompoundcharacter "u {\"u} +% \installcompoundcharacter "A {\"A} +% \installcompoundcharacter "E {\"E} +% \installcompoundcharacter "I {\"I} +% \installcompoundcharacter "O {\"O} +% \installcompoundcharacter "U {\"U} +% \stoplanguagespecifics +% \stopencoding +% +% \startencoding[texnansi] +% \startlanguagespecifics[\s!de]% +% \installcompoundcharacter "a {\"a} +% \installcompoundcharacter "e {\"e} +% \installcompoundcharacter "i {\"\i} +% \installcompoundcharacter "o {\"o} +% \installcompoundcharacter "u {\"u} +% \installcompoundcharacter "A {\"A} +% \installcompoundcharacter "E {\"E} +% \installcompoundcharacter "I {\"I} +% \installcompoundcharacter "O {\"O} +% \installcompoundcharacter "U {\"U} +% \stoplanguagespecifics +% \stopencoding +% +% %D This hack should be perfected. + +%% NORWEGIAN +% +% These three letters (in this order) are the +% last in the norwegian alphabet (and hence should +% come after z in the latin alphabet). +% I'm not sure about the syntax for +% \definesortkey so I left some of it open ... +% +% \startlanguagespecifics[\s!no] +% +% \definesortkey {\ae}{z}{b}{\ae} +% \definesortkey {\AE}{z}{b}{\AE} +% \definesortkey {\o}{z} {c}{\o} +% \definesortkey {\O}{z} {c}{\O} +% \definesortkey {\aa}{z}{d}{\aa} +% \definesortkey {\AA}{z}{d}{\AA} +% +% \stoplanguagespecifics +% +% Active characters - just for texnansi encoding now. +% Will the other encodings be the same? +% +% \startencoding[texnansi] +% \startlanguagespecifics[\s!no]% +% \defineactivecharacter æ {\ae{}} +% \defineactivecharacter Æ {\AE{}} +% \defineactivecharacter ø {\o{}} +% \defineactivecharacter Ø {\O{}} +% \defineactivecharacter å {\aa{}} +% \defineactivecharacter Å {\AA{}} +% \stoplanguagespecifics +% \stopencoding \setupheadtext [\s!en] [\v!inhoud=Contents] \setupheadtext [\s!nl] [\v!inhoud=Inhoud] @@ -270,34 +318,34 @@ \setupheadtext [\s!en] [\v!tabellen=Tables] \setupheadtext [\s!nl] [\v!tabellen=Tabellen] \setupheadtext [\s!de] [\v!tabellen=Tabellen] -\setupheadtext [\s!da] [\v!tabellen=Tablen] +\setupheadtext [\s!da] [\v!tabellen=Tabeller] \setupheadtext [\s!sv] [\v!tabellen=Tabellen] \setupheadtext [\s!af] [\v!tabellen=Tabelle] -\setupheadtext [\s!no] [\v!tabellen=Tabellen] +\setupheadtext [\s!no] [\v!tabellen=Tabeller] \setupheadtext [\s!en] [\v!figuren=Figures] \setupheadtext [\s!nl] [\v!figuren=Figuren] \setupheadtext [\s!de] [\v!figuren=Abbildungen] -\setupheadtext [\s!da] [\v!figuren=Figuren] +\setupheadtext [\s!da] [\v!figuren=Figurer] \setupheadtext [\s!sv] [\v!figuren=Figuren] \setupheadtext [\s!af] [\v!figuren=Figure] -\setupheadtext [\s!no] [\v!figuren=Avbildningen] +\setupheadtext [\s!no] [\v!figuren=Figurer] \setupheadtext [\s!en] [\v!grafieken=Graphics] \setupheadtext [\s!nl] [\v!grafieken=Grafieken] \setupheadtext [\s!de] [\v!grafieken=Graphiken] -\setupheadtext [\s!da] [\v!grafieken=Grafiken] +\setupheadtext [\s!da] [\v!grafieken=Grafik] \setupheadtext [\s!sv] [\v!grafieken=Grafiskt] \setupheadtext [\s!af] [\v!grafieken=Grafieke] -\setupheadtext [\s!no] [\v!grafieken=Grafikken] +\setupheadtext [\s!no] [\v!grafieken=Grafikk] \setupheadtext [\s!en] [\v!intermezzos=Intermezzos] \setupheadtext [\s!nl] [\v!intermezzos=Intermezzo's] \setupheadtext [\s!de] [\v!intermezzos=Intermezzi] -\setupheadtext [\s!da] [\v!intermezzos=Intermezzos] +\setupheadtext [\s!da] [\v!intermezzos=Intermezzoer] \setupheadtext [\s!sv] [\v!intermezzos=Intermezzot] \setupheadtext [\s!af] [\v!intermezzos=Intermezzos] -\setupheadtext [\s!no] [\v!intermezzos=Intermezzos] +\setupheadtext [\s!no] [\v!intermezzos=Intermesso] \setupheadtext [\s!en] [\v!index=Index] \setupheadtext [\s!nl] [\v!index=Index] @@ -310,26 +358,26 @@ \setupheadtext [\s!en] [\v!afkortingen=Abbreviations] \setupheadtext [\s!nl] [\v!afkortingen=Afkortingen] \setupheadtext [\s!de] [\v!afkortingen=Abk\"urzungen] -\setupheadtext [\s!da] [\v!afkortingen=Abbreviations] +\setupheadtext [\s!da] [\v!afkortingen=Forkortelser] \setupheadtext [\s!sv] [\v!afkortingen=F\"orkortningen] \setupheadtext [\s!af] [\v!afkortingen=Afkortings] -\setupheadtext [\s!no] [\v!afkortingen=Forkortelsen] +\setupheadtext [\s!no] [\v!afkortingen=Forkortelser] \setupheadtext [\s!en] [\v!logos=Logos] \setupheadtext [\s!nl] [\v!logos=Logo's] \setupheadtext [\s!de] [\v!logos=Logos] -\setupheadtext [\s!da] [\v!logos=Logos] +\setupheadtext [\s!da] [\v!logos=Logoer] \setupheadtext [\s!sv] [\v!logos=Logo] \setupheadtext [\s!af] [\v!logos=Logos] -\setupheadtext [\s!no] [\v!logos=Logos] +\setupheadtext [\s!no] [\v!logos=Logoer] \setupheadtext [\s!en] [\v!eenheden=Units] \setupheadtext [\s!nl] [\v!eenheden=Eenheden] \setupheadtext [\s!de] [\v!eenheden=Einheiten] -\setupheadtext [\s!da] [\v!eenheden=Enheden] +\setupheadtext [\s!da] [\v!eenheden=Enheder] \setupheadtext [\s!sv] [\v!eenheden=Enheten] \setupheadtext [\s!af] [\v!eenheden=Eenhede] -\setupheadtext [\s!no] [\v!eenheden=Enheten] +\setupheadtext [\s!no] [\v!eenheden=Enheter] \setuplabeltext [\s!en] [\v!tabel=Table ] \setuplabeltext [\s!nl] [\v!tabel=Tabel ] @@ -345,7 +393,7 @@ \setuplabeltext [\s!da] [\v!figuur=Figur ] \setuplabeltext [\s!sv] [\v!figuur=Figur ] \setuplabeltext [\s!af] [\v!figuur=Figuur ] -\setuplabeltext [\s!no] [\v!figuur=Avbildning ] +\setuplabeltext [\s!no] [\v!figuur=Figur ] \setuplabeltext [\s!en] [\v!intermezzo=Intermezzo ] \setuplabeltext [\s!nl] [\v!intermezzo=Intermezzo ] @@ -353,7 +401,7 @@ \setuplabeltext [\s!da] [\v!intermezzo=Intermezzo ] \setuplabeltext [\s!sv] [\v!intermezzo=Intermezzo ] \setuplabeltext [\s!af] [\v!intermezzo=Intermezzo ] -\setuplabeltext [\s!no] [\v!intermezzo=Intermezzo ] +\setuplabeltext [\s!no] [\v!intermezzo=Intermesso ] \setuplabeltext [\s!en] [\v!grafiek=Graphic ] \setuplabeltext [\s!nl] [\v!grafiek=Grafiek ] @@ -406,7 +454,7 @@ \setuplabeltext [\s!en] [\v!bijlage=] \setuplabeltext [\s!nl] [\v!bijlage=] \setuplabeltext [\s!de] [\v!bijlage=] -\setuplabeltext [\s!da] [\v!bijlage=] +\setuplabeltext [\s!da] [\v!bijlage=] % [\v!bijlage=bilag] \setuplabeltext [\s!sv] [\v!bijlage=] \setuplabeltext [\s!af] [\v!bijlage=] % [\v!bijlage=bylae] \setuplabeltext [\s!no] [\v!bijlage=] @@ -422,7 +470,7 @@ \setuplabeltext [\s!en] [\v!regel=line ] \setuplabeltext [\s!nl] [\v!regel=regel ] \setuplabeltext [\s!de] [\v!regel=Zeile ] -\setuplabeltext [\s!da] [\v!regel=linie ] +\setuplabeltext [\s!da] [\v!regel=linie ] % or linje \setuplabeltext [\s!sv] [\v!regel=rad ] \setuplabeltext [\s!af] [\v!regel=re\"el ] \setuplabeltext [\s!no] [\v!regel=linje ] @@ -430,10 +478,10 @@ \setuplabeltext [\s!en] [\v!regels=lines ] \setuplabeltext [\s!nl] [\v!regels=regels ] \setuplabeltext [\s!de] [\v!regels=Zeilen ] -\setuplabeltext [\s!da] [\v!regels=linien ] +\setuplabeltext [\s!da] [\v!regels=linier ] % or linjer \setuplabeltext [\s!sv] [\v!regels=raden ] \setuplabeltext [\s!af] [\v!regels=re\"els ] -\setuplabeltext [\s!no] [\v!regels=linjen ] +\setuplabeltext [\s!no] [\v!regels=linjer ] \setuplabeltext [\s!en] [\v!january=January] \setuplabeltext [\s!en] [\v!february=February] @@ -514,7 +562,7 @@ \setuplabeltext [\s!af] [\v!december=desember] \setuplabeltext [\s!no] [\v!january=januar] -\setuplabeltext [\s!no] [\v!february=februae] +\setuplabeltext [\s!no] [\v!february=februar] \setuplabeltext [\s!no] [\v!march=mars] \setuplabeltext [\s!no] [\v!april=april] \setuplabeltext [\s!no] [\v!may=mai] @@ -600,7 +648,19 @@ \setuplabeltext [\s!de] [\v!oppagina=auf Seite ] \setuplabeltext [\s!de] [\v!hierboven=siehe oben] \setuplabeltext [\s!de] [\v!hieronder=siehe unten] -\setuplabeltext [\s!de] [\v!zie=sieh ] +\setuplabeltext [\s!de] [\v!zie=siehe ] + +\setuplabeltext [\s!da] [\v!pagina=Side ] +\setuplabeltext [\s!da] [\v!oppagina=p\aa\ side ] +\setuplabeltext [\s!da] [\v!hierboven=se foroven] +\setuplabeltext [\s!da] [\v!hieronder=se forneden] +\setuplabeltext [\s!da] [\v!zie=se ] + +\setuplabeltext [\s!no] [\v!pagina=Side ] +\setuplabeltext [\s!no] [\v!oppagina=p\aa\ side ] +\setuplabeltext [\s!no] [\v!hierboven=se foroven] +\setuplabeltext [\s!no] [\v!hieronder=se forneden] +\setuplabeltext [\s!no] [\v!zie=se ] %D ... and to be completed! diff --git a/tex/context/base/lang-grk.tex b/tex/context/base/lang-grk.tex index 4ecfdd95c..4cda4f3c1 100644 --- a/tex/context/base/lang-grk.tex +++ b/tex/context/base/lang-grk.tex @@ -11,10 +11,16 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% Modern Greek - \writestatus{loading}{Greek Languages} +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + +% Modern Greek + \unprotect \protect diff --git a/tex/context/base/lang-ind.tex b/tex/context/base/lang-ind.tex index f00e6ab19..1a92b355e 100644 --- a/tex/context/base/lang-ind.tex +++ b/tex/context/base/lang-ind.tex @@ -11,10 +11,16 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% 34 languages - \writestatus{loading}{Indo-Iranian Languages} +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + +% 34 languages + \unprotect \protect diff --git a/tex/context/base/lang-ini.tex b/tex/context/base/lang-ini.tex index 53b4f6e88..6ae98221a 100644 --- a/tex/context/base/lang-ini.tex +++ b/tex/context/base/lang-ini.tex @@ -78,6 +78,34 @@ 10: vzory --nacteny \stopmessages +\startmessages italian library: linguals + title: lingua + 1: schemi -- per -- caricati (n=--) + 2: niente schemi -- per -- (n=--) + 3: sillabazione -- per -- caricata (n=--) + 4: niente sillabazione -- per -- (n=--) + 5: schemi per -- non caricati + 6: lingua -- non definita + 7: opzioni specifiche per la lingua [--] introducono un salto -- + 8: opzioni specifiche per la lingua [--] aggiunte trasparentemente + 9: lingua -- attiva + 10: schemi -- caricati +\stopmessages + +\startmessages norwegian library: linguals + title: språk + 1: orddelingsmønster -- for -- er lest inn (n=--) + 2: ingen orddelingsmønster -- for -- (n=--) + 3: orddelingsdefinisjon -- for -- er lest inn (n=--) + 4: ingen orddelingsdefinisjon -- for -- (n=--) + 5: orddelingsmønster for -- er ikke lest inn + 6: språk -- er udefinert + 7: språk spesifikk opsjon [--] introduserer et -- hopp + 8: språk spesifikk opsjon [--] problemfritt tilføyd + 9: språk -- er aktivt + 10: orddelingsmønster -- er lest inn +\stopmessages + % dutch : \lccode`\'=`\' % english : \lccode`\'=0 % german : \lccode`\'=`\' @@ -618,7 +646,7 @@ %D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR %D \HL %D \NC \s!fr \NC french \NC italic \NC\FR -%D \NC \s!sp \NC spanish \NC italic \NC\MR +%D \NC \s!es \NC spanish \NC italic \NC\MR %D \NC \s!it \NC italian \NC italic \NC\MR %D \NC \s!la \NC latin \NC italic \NC\MR %D \NC \s!pt \NC portuguese \NC italic \NC\LR diff --git a/tex/context/base/lang-ita.tex b/tex/context/base/lang-ita.tex index af1f93d94..3be8fc5c2 100644 --- a/tex/context/base/lang-ita.tex +++ b/tex/context/base/lang-ita.tex @@ -3,7 +3,7 @@ %D version=1997.09.03, %D title=\CONTEXT\ Language Macros, %D subtitle=Italic Languages, -%D author=Hans Hagen / Tobias Burnus, +%D author=Hans Hagen / Tobias Burnus, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C @@ -11,11 +11,22 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\writestatus{loading}{Italic Languages} + +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. +%D +%D \starttabulate[|lB|l|] +%D \NC Italian \NC Giuseppe Bilotta \NC \NR +%D \NC Rumanian \NC Dan Seracu \NC \NR +%D \stoptabulate + % Latin, Italian, Rhaeto-Romanic, Rumanian, Sardian % Catalan, French, Ladino, Portuguese, Proven\c{c}al, Spanish -\writestatus{loading}{Italic Languages} - \unprotect \installlanguage @@ -33,7 +44,7 @@ \c!status=\v!stop] \installlanguage - [\s!sp] + [\s!es] [\c!spatiering=\v!opelkaar, \c!leftsentence=---, \c!rightsentence=---, @@ -49,14 +60,14 @@ \installlanguage [\s!it] [\c!spatiering=\v!opelkaar, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, + \c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\leftsubguillemot, + \c!rightsubsentence=\rightsubguillemot, \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\lowerrightsingleninequote, + \c!rightquote=\upperrightsingleninequote, \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\lowerrightdoubleninequote, + \c!rightquotation=\upperrightdoubleninequote, \c!datum={\v!dag,\ ,\v!maand,\ ,\v!jaar}, \c!status=\v!stop] @@ -88,149 +99,186 @@ \c!datum={\v!jaar,\ ,\v!maand,\ ,\v!dag}, \c!status=\v!stop] +\installlanguage + [\s!ro] + [\c!spatiering=\v!opelkaar, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\leftguillemot, + \c!rightquote=\rightguillemot, + \c!leftquotation=\lowerrightdoubleninequote, + \c!rightquotation=\upperleftdoublesixquote, + \c!datum={\v!dag,\ ,\v!maand,\ ,\v!jaar}, + \c!status=\v!stop] + %D For compatibility reasons we also define: -\installlanguage [fa] [\s!fr] +\installlanguage [fa] [\s!fr] % for dutchies only \installlanguage [french] [\s!fr] -\installlanguage [spanish] [\s!sp] +\installlanguage [spanish] [\s!es] \installlanguage [italian] [\s!it] \installlanguage [latin] [\s!la] \installlanguage [portuguese] [\s!pt] +\installlanguage [romanian] [\s!ro] %D Labels and header texts. \setupheadtext [\s!fr] [\v!inhoud=Table des mati\`eres] -\setupheadtext [\s!sp] [\v!inhoud=\'Indice] +\setupheadtext [\s!es] [\v!inhoud=\'Indice] \setupheadtext [\s!it] [\v!inhoud=Indice] \setupheadtext [\s!la] [\v!inhoud=Quod in libro continetur] %Argumentum \setupheadtext [\s!pt] [\v!inhoud=Conte\'ud] +\setupheadtext [\s!ro] [\v!inhoud=Cuprins] \setupheadtext [\s!fr] [\v!tabellen=Tables] -\setupheadtext [\s!sp] [\v!tabellen=Tablas] +\setupheadtext [\s!es] [\v!tabellen=Tablas] \setupheadtext [\s!it] [\v!tabellen=Tabelle] \setupheadtext [\s!la] [\v!tabellen=Tabulae] \setupheadtext [\s!pt] [\v!tabellen=Tabelas] +\setupheadtext [\s!ro] [\v!tabellen=Tabele] \setupheadtext [\s!fr] [\v!figuren=Figures] -\setupheadtext [\s!sp] [\v!figuren=Ilustraci\'ons] -\setupheadtext [\s!it] [\v!figuren=Illustrazioni] +\setupheadtext [\s!es] [\v!figuren=Ilustraci\'ons] +\setupheadtext [\s!it] [\v!figuren=Figure] \setupheadtext [\s!la] [\v!figuren=Imagines] \setupheadtext [\s!pt] [\v!figuren=Figuras] +\setupheadtext [\s!ro] [\v!figuren=Figuri] \setupheadtext [\s!fr] [\v!grafieken=Graphiques] -\setupheadtext [\s!sp] [\v!grafieken=Gr\'aficos] -\setupheadtext [\s!it] [\v!grafieken=Grafice] +\setupheadtext [\s!es] [\v!grafieken=Gr\'aficos] +\setupheadtext [\s!it] [\v!grafieken=Grafici] \setupheadtext [\s!la] [\v!grafieken=Typi] \setupheadtext [\s!pt] [\v!grafieken=Gr\'aficos] +\setupheadtext [\s!ro] [\v!grafieken=Grafice] \setupheadtext [\s!fr] [\v!intermezzos=Interm\`edes] -\setupheadtext [\s!sp] [\v!intermezzos=intermedios] +\setupheadtext [\s!es] [\v!intermezzos=intermedios] \setupheadtext [\s!it] [\v!intermezzos=Intermezzi] \setupheadtext [\s!la] [\v!intermezzos=Intermissa] \setupheadtext [\s!pt] [\v!intermezzos=Intermezzi] +\setupheadtext [\s!ro] [\v!intermezzos=Intermzzo] \setupheadtext [\s!fr] [\v!index=Index] -\setupheadtext [\s!sp] [\v!index=\'Indice] +\setupheadtext [\s!es] [\v!index=\'Indice] \setupheadtext [\s!it] [\v!index=Indice] \setupheadtext [\s!la] [\v!index=Indices] \setupheadtext [\s!pt] [\v!index=\'Indice] +\setupheadtext [\s!ro] [\v!index=Index] \setupheadtext [\s!fr] [\v!afkortingen=Abr\'eviations] -\setupheadtext [\s!sp] [\v!afkortingen=Abreviaci\'ons] +\setupheadtext [\s!es] [\v!afkortingen=Abreviaci\'ons] \setupheadtext [\s!it] [\v!afkortingen=Abbreviazioni] \setupheadtext [\s!la] [\v!afkortingen=Notae] \setupheadtext [\s!pt] [\v!afkortingen=Abreviaturas] +\setupheadtext [\s!ro] [\v!afkortingen=Abrevieri] \setupheadtext [\s!fr] [\v!logos=Logos] -\setupheadtext [\s!sp] [\v!logos=Logotipos] +\setupheadtext [\s!es] [\v!logos=Logotipos] \setupheadtext [\s!it] [\v!logos=Logotipi] \setupheadtext [\s!la] [\v!logos=Typi negotiales] \setupheadtext [\s!pt] [\v!logos=Logotipos] +\setupheadtext [\s!ro] [\v!logos=Logo-uri] \setupheadtext [\s!fr] [\v!eenheden=Unit\'es] -\setupheadtext [\s!sp] [\v!eenheden=Unidads] +\setupheadtext [\s!es] [\v!eenheden=Unidads] \setupheadtext [\s!it] [\v!eenheden=Unit\`a] \setupheadtext [\s!la] [\v!eenheden=Modi] \setupheadtext [\s!pt] [\v!eenheden=Unidades] +\setupheadtext [\s!ro] [\v!eenheden=Unit\u{a}\c{t}i] \setuplabeltext [\s!fr] [\v!tabel=Table ] -\setuplabeltext [\s!sp] [\v!tabel=Tablas ] +\setuplabeltext [\s!es] [\v!tabel=Tablas ] \setuplabeltext [\s!it] [\v!tabel=Tabella ] \setuplabeltext [\s!la] [\v!tabel=Tabula ] \setuplabeltext [\s!pt] [\v!tabel=Tabela ] +\setuplabeltext [\s!ro] [\v!tabel=Tabelul ] \setuplabeltext [\s!fr] [\v!figuur=Figure ] -\setuplabeltext [\s!sp] [\v!figuur=Ilustraci\'on ] -\setuplabeltext [\s!it] [\v!figuur=Illustrazione ] +\setuplabeltext [\s!es] [\v!figuur=Ilustraci\'on ] +\setuplabeltext [\s!it] [\v!figuur=Fig. ] \setuplabeltext [\s!la] [\v!figuur=Imago ] \setuplabeltext [\s!pt] [\v!figuur=Figura ] +\setuplabeltext [\s!ro] [\v!figuur=Figura ] \setuplabeltext [\s!fr] [\v!intermezzo=Interm\`ede ] -\setuplabeltext [\s!sp] [\v!intermezzo=intermedio ] +\setuplabeltext [\s!es] [\v!intermezzo=intermedio ] \setuplabeltext [\s!it] [\v!intermezzo=Intermezzo ] \setuplabeltext [\s!la] [\v!intermezzo=Intermissum ] \setuplabeltext [\s!pt] [\v!intermezzo=Intermezzo ] +\setuplabeltext [\s!ro] [\v!intermezzo=Intermezzo ] \setuplabeltext [\s!fr] [\v!grafiek=Illustration ] -\setuplabeltext [\s!sp] [\v!grafiek=Gr\'afico ] -\setuplabeltext [\s!it] [\v!grafiek=Grafica ] +\setuplabeltext [\s!es] [\v!grafiek=Gr\'afico ] +\setuplabeltext [\s!it] [\v!grafiek=Grafico ] \setuplabeltext [\s!la] [\v!grafiek=Typus ] \setuplabeltext [\s!pt] [\v!grafiek=Gr\'afico ] +\setuplabeltext [\s!ro] [\v!grafiek=Graficul ] \setuplabeltext [\s!fr] [\v!hoofdstuk=] -\setuplabeltext [\s!sp] [\v!hoofdstuk=] +\setuplabeltext [\s!es] [\v!hoofdstuk=] \setuplabeltext [\s!it] [\v!hoofdstuk=] \setuplabeltext [\s!la] [\v!hoofdstuk=] \setuplabeltext [\s!pt] [\v!hoofdstuk=] +\setuplabeltext [\s!ro] [\v!hoofdstuk=] \setuplabeltext [\s!fr] [\v!paragraaf=] -\setuplabeltext [\s!sp] [\v!paragraaf=] +\setuplabeltext [\s!es] [\v!paragraaf=] \setuplabeltext [\s!it] [\v!paragraaf=] \setuplabeltext [\s!la] [\v!paragraaf=] \setuplabeltext [\s!pt] [\v!paragraaf=] +\setuplabeltext [\s!ro] [\v!paragraaf=] \setuplabeltext [\s!fr] [\v!sub\v!paragraaf=] -\setuplabeltext [\s!sp] [\v!sub\v!paragraaf=] +\setuplabeltext [\s!es] [\v!sub\v!paragraaf=] \setuplabeltext [\s!it] [\v!sub\v!paragraaf=] \setuplabeltext [\s!la] [\v!sub\v!paragraaf=] \setuplabeltext [\s!pt] [\v!sub\v!paragraaf=] +\setuplabeltext [\s!ro] [\v!sub\v!paragraaf=] \setuplabeltext [\s!fr] [\v!sub\v!sub\v!paragraaf=] -\setuplabeltext [\s!sp] [\v!sub\v!sub\v!paragraaf=] +\setuplabeltext [\s!es] [\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!it] [\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!la] [\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!pt] [\v!sub\v!sub\v!paragraaf=] +\setuplabeltext [\s!ro] [\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!fr] [\v!sub\v!sub\v!sub\v!paragraaf=] -\setuplabeltext [\s!sp] [\v!sub\v!sub\v!sub\v!paragraaf=] +\setuplabeltext [\s!es] [\v!sub\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!it] [\v!sub\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!la] [\v!sub\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!pt] [\v!sub\v!sub\v!sub\v!paragraaf=] +\setuplabeltext [\s!ro] [\v!sub\v!sub\v!sub\v!paragraaf=] \setuplabeltext [\s!fr] [\v!bijlage=] -\setuplabeltext [\s!sp] [\v!bijlage=] +\setuplabeltext [\s!es] [\v!bijlage=] \setuplabeltext [\s!it] [\v!bijlage=] \setuplabeltext [\s!la] [\v!bijlage=] \setuplabeltext [\s!pt] [\v!bijlage=] +\setuplabeltext [\s!ro] [\v!bijlage=] \setuplabeltext [\s!fr] [\v!deel=Section ] -\setuplabeltext [\s!sp] [\v!deel=Parte ] +\setuplabeltext [\s!es] [\v!deel=Parte ] \setuplabeltext [\s!it] [\v!deel=Parte ] \setuplabeltext [\s!la] [\v!deel=Pars ] \setuplabeltext [\s!pt] [\v!deel=Parte ] +\setuplabeltext [\s!ro] [\v!deel=Partea ] \setuplabeltext [\s!fr] [\v!regel=ligne ] -\setuplabeltext [\s!sp] [\v!regel=l\'\i nea ] +\setuplabeltext [\s!es] [\v!regel=l\'\i nea ] \setuplabeltext [\s!it] [\v!regel=riga ] \setuplabeltext [\s!la] [\v!regel=versus ] \setuplabeltext [\s!pt] [\v!regel=linha ] +\setuplabeltext [\s!ro] [\v!regel=linia ] \setuplabeltext [\s!fr] [\v!regels=lignes ] -\setuplabeltext [\s!sp] [\v!regels=l\'\i neas ] -\setuplabeltext [\s!it] [\v!regels=rige ] +\setuplabeltext [\s!es] [\v!regels=l\'\i neas ] +\setuplabeltext [\s!it] [\v!regels=righe ] \setuplabeltext [\s!la] [\v!regels=versus ] \setuplabeltext [\s!pt] [\v!regels=linhas ] +\setuplabeltext [\s!ro] [\v!regels=liniile ] \setuplabeltext [\s!fr] [\v!january=janvier] \setuplabeltext [\s!fr] [\v!february=f\'evrier] @@ -245,18 +293,18 @@ \setuplabeltext [\s!fr] [\v!november=novembre] \setuplabeltext [\s!fr] [\v!december=d\'ecembre] -\setuplabeltext [\s!sp] [\v!january=jenero] -\setuplabeltext [\s!sp] [\v!february=febrero] -\setuplabeltext [\s!sp] [\v!march=marzo] -\setuplabeltext [\s!sp] [\v!april=abril] -\setuplabeltext [\s!sp] [\v!may=mayo] -\setuplabeltext [\s!sp] [\v!june=junio] -\setuplabeltext [\s!sp] [\v!july=julio] -\setuplabeltext [\s!sp] [\v!august=agosto] -\setuplabeltext [\s!sp] [\v!september=septimbre] -\setuplabeltext [\s!sp] [\v!october=octubre] -\setuplabeltext [\s!sp] [\v!november=noviembre] -\setuplabeltext [\s!sp] [\v!december=deciembre] +\setuplabeltext [\s!es] [\v!january=jenero] +\setuplabeltext [\s!es] [\v!february=febrero] +\setuplabeltext [\s!es] [\v!march=marzo] +\setuplabeltext [\s!es] [\v!april=abril] +\setuplabeltext [\s!es] [\v!may=mayo] +\setuplabeltext [\s!es] [\v!june=junio] +\setuplabeltext [\s!es] [\v!july=julio] +\setuplabeltext [\s!es] [\v!august=agosto] +\setuplabeltext [\s!es] [\v!september=septimbre] +\setuplabeltext [\s!es] [\v!october=octubre] +\setuplabeltext [\s!es] [\v!november=noviembre] +\setuplabeltext [\s!es] [\v!december=deciembre] \setuplabeltext [\s!it] [\v!january=gennaio] \setuplabeltext [\s!it] [\v!february=febbraio] @@ -297,6 +345,19 @@ \setuplabeltext [\s!pt] [\v!november=novembro] \setuplabeltext [\s!pt] [\v!december=dezembro] +\setuplabeltext [\s!ro] [\v!january=ianuarie] +\setuplabeltext [\s!ro] [\v!february=februarie] +\setuplabeltext [\s!ro] [\v!march=martie] +\setuplabeltext [\s!ro] [\v!april=aprilie] +\setuplabeltext [\s!ro] [\v!may=mai] +\setuplabeltext [\s!ro] [\v!june=iunie] +\setuplabeltext [\s!ro] [\v!july=iulie] +\setuplabeltext [\s!ro] [\v!august=august] +\setuplabeltext [\s!ro] [\v!september=septembrie] +\setuplabeltext [\s!ro] [\v!october=octombrie] +\setuplabeltext [\s!ro] [\v!november=noiembrie] +\setuplabeltext [\s!ro] [\v!december=decembrie] + \setuplabeltext [\s!fr] [\v!sunday=dimanche] \setuplabeltext [\s!fr] [\v!monday=lundi] \setuplabeltext [\s!fr] [\v!tuesday=mardi] @@ -305,13 +366,13 @@ \setuplabeltext [\s!fr] [\v!friday=vendredi] \setuplabeltext [\s!fr] [\v!saturday=samedi] -\setuplabeltext [\s!sp] [\v!sunday=domingo] -\setuplabeltext [\s!sp] [\v!monday=lunes] -\setuplabeltext [\s!sp] [\v!tuesday=martes] -\setuplabeltext [\s!sp] [\v!wednesday=mi\'ercoles] -\setuplabeltext [\s!sp] [\v!thursday=jueves] -\setuplabeltext [\s!sp] [\v!friday=viernes] -\setuplabeltext [\s!sp] [\v!saturday=s\'abado] +\setuplabeltext [\s!es] [\v!sunday=domingo] +\setuplabeltext [\s!es] [\v!monday=lunes] +\setuplabeltext [\s!es] [\v!tuesday=martes] +\setuplabeltext [\s!es] [\v!wednesday=mi\'ercoles] +\setuplabeltext [\s!es] [\v!thursday=jueves] +\setuplabeltext [\s!es] [\v!friday=viernes] +\setuplabeltext [\s!es] [\v!saturday=s\'abado] \setuplabeltext [\s!it] [\v!sunday=domenica] \setuplabeltext [\s!it] [\v!monday=luned\`\i] @@ -337,11 +398,35 @@ \setuplabeltext [\s!pt] [\v!friday=sexta-feira] \setuplabeltext [\s!pt] [\v!saturday=s\'abado] +\setuplabeltext [\s!ro] [\v!sunday=duminic\u{a}] +\setuplabeltext [\s!ro] [\v!monday=luni] +\setuplabeltext [\s!ro] [\v!tuesday=mar\c{t}i] +\setuplabeltext [\s!ro] [\v!wednesday=miercuri] +\setuplabeltext [\s!ro] [\v!thursday=joi] +\setuplabeltext [\s!ro] [\v!friday=vineri] +\setuplabeltext [\s!ro] [\v!saturday=s\^{a}mb\u{a}t\u{a}] + +% \startlanguagespecifics[\s!ro] +% +% \installcompoundcharacter "a {\u{a}} +% \installcompoundcharacter "i {\^{\i}} +% \installcompoundcharacter "s {\c{s}} +% \installcompoundcharacter "t {\c{t}} +% \installcompoundcharacter "A {\^{a}} +% \installcompoundcharacter "I {\^{I}} +% \installcompoundcharacter "S {\c{S}} +% \installcompoundcharacter "T {\c{T}} +% \installcompoundcharacter "` {\handlequotation\c!leftquotation} +% \installcompoundcharacter "' {\handlequotation\c!rightquotation} +% +% \stoplanguagespecifics + %D \ShowAllLanguageValues [\s!fr] [french] franse slag -%D \ShowAllLanguageValues [\s!sp] [spanish] spaans benauwd +%D \ShowAllLanguageValues [\s!es] [spanish] spaans benauwd %D \ShowAllLanguageValues [\s!it] [italian] italiaanse ... %D \ShowAllLanguageValues [\s!la] [latin] latijnse missen %D \ShowAllLanguageValues [\s!pt] [portuguese] portugese ... +%D \ShowAllLanguageValues [\s!ro] [romanian] romanian ... \protect diff --git a/tex/context/base/lang-lab.tex b/tex/context/base/lang-lab.tex index 714188dab..eb42fee76 100644 --- a/tex/context/base/lang-lab.tex +++ b/tex/context/base/lang-lab.tex @@ -136,6 +136,7 @@ {#4}}} \newif\iflabeltextdone % needs to be reset elsewhere +\newif\iftracinglabels % shows missing labels \unexpanded\def\dogetupsometextprefix#1#2#3% {\global\labeltextdonetrue @@ -143,7 +144,7 @@ {\dodogetupsometextprefix{\defaultlanguage{#1}}{#2}{#3} {\dodogetupsometextprefix{\s!en}{#2}{#3} {\dodogetupsometextprefix{\s!nl}{#2}{#3} - {{\tttf[#2:~#3/#1]~}}}}}} + {\iftracinglabels{\tttf[#2:~#3/#1]~}\fi}}}}} %D \macros %D {presetheadtext,presetlabeltext} diff --git a/tex/context/base/lang-sla.tex b/tex/context/base/lang-sla.tex index 8df66aa90..cd9fbef84 100644 --- a/tex/context/base/lang-sla.tex +++ b/tex/context/base/lang-sla.tex @@ -11,8 +11,17 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Thanks to Grzegorz Sapijaszko for fine||tuning the Polish -%D section and Zeljko Vrba for the Croation translations. +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. +%D +%D \starttabulate[|lB|l|] +%D \NC Czech \NC Tom Hidec, Petr Sojka \NC \NR +%D \NC Polish \NC Grzegorz Sapijaszko \NC \NR +%D \NC Croatian \NC Zeljko Vrba \NC \NR +%D \stoptabulate % Belarussian, Russian, Ukrainian, Bulgarian, Macedonian, % Serbo-Croatian, Slovenian, Czech, Kushubian, @@ -85,79 +94,79 @@ \installlanguage [croatian] [\s!hr] % specifics - -\startlanguagespecifics[\s!pl] - - \installcompoundcharacter /a {\k a} - \installcompoundcharacter /c {\'c} - \installcompoundcharacter /e {\k e} - \installcompoundcharacter /l {\l} - \installcompoundcharacter /n {\'n} - \installcompoundcharacter /o {\'o} - \installcompoundcharacter /s {\'s} - \installcompoundcharacter /x {\'z} - \installcompoundcharacter /z {\.z} - \installcompoundcharacter /A {\k A} - \installcompoundcharacter /C {\'C} - \installcompoundcharacter /E {\k E} - \installcompoundcharacter /L {\L} - \installcompoundcharacter /N {\'N} - \installcompoundcharacter /O {\'O} - \installcompoundcharacter /S {\'S} - \installcompoundcharacter /X {\'Z} - \installcompoundcharacter /Z {\.Z} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!pl] - - \installcompoundcharacter /, {\handlequotation\c!leftquotation} - \installcompoundcharacter /' {\handlequotation\c!rightquotation} - - \def\setupPLlanguage% - {\setuplanguage - [\s!pl] - [\c!leftsentence=\leftguillemot, - \c!rightsentence=\rightguillemot, - \c!leftsubsentence=\leftsubguillemot, - \c!rightsubsentence=\rightsubguillemot]} - - \installcompoundcharacter /< {{\setupPLlanguage|<|}} - \installcompoundcharacter /> {{\setupPLlanguage|>|}} - - \installcompoundcharacter /- {|-|} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!pl] - - \definesortkey {/a}{a}{a}{\k a} - \definesortkey {/A}{a}{a}{\k a} - \definesortkey {/c}{c}{a}{\'c} - \definesortkey {/C}{c}{a}{\'c} - \definesortkey {/e}{e}{a}{\k e} - \definesortkey {/E}{e}{a}{\k e} - \definesortkey {/l}{l}{a}{\l } - \definesortkey {/L}{l}{a}{\l } - \definesortkey {/n}{n}{a}{\'n} - \definesortkey {/N}{n}{a}{\'n} - \definesortkey {/o}{o}{a}{\'o} - \definesortkey {/O}{o}{a}{\'o} - \definesortkey {/s}{s}{a}{\'s} - \definesortkey {/S}{s}{a}{\'s} - \definesortkey {/x}{z}{a}{\'x} - \definesortkey {/X}{z}{a}{\'x} - \definesortkey {/z}{z}{b}{\.z} - \definesortkey {/Z}{z}{b}{\.z} - -\stoplanguagespecifics - -\startencoding[pdfdoc] - \startlanguagespecifics[pl]% hm - \defineactivecharacter / {\simplifiedcompoundcharacter/} - \stoplanguagespecifics -\stopencoding - +% +% \startlanguagespecifics[\s!pl] +% +% \installcompoundcharacter /a {\k a} +% \installcompoundcharacter /c {\'c} +% \installcompoundcharacter /e {\k e} +% \installcompoundcharacter /l {\l} +% \installcompoundcharacter /n {\'n} +% \installcompoundcharacter /o {\'o} +% \installcompoundcharacter /s {\'s} +% \installcompoundcharacter /x {\'z} +% \installcompoundcharacter /z {\.z} +% \installcompoundcharacter /A {\k A} +% \installcompoundcharacter /C {\'C} +% \installcompoundcharacter /E {\k E} +% \installcompoundcharacter /L {\L} +% \installcompoundcharacter /N {\'N} +% \installcompoundcharacter /O {\'O} +% \installcompoundcharacter /S {\'S} +% \installcompoundcharacter /X {\'Z} +% \installcompoundcharacter /Z {\.Z} +% +% \stoplanguagespecifics +% +% \startlanguagespecifics[\s!pl] +% +% \installcompoundcharacter /, {\handlequotation\c!leftquotation} +% \installcompoundcharacter /' {\handlequotation\c!rightquotation} +% +% \def\setupPLlanguage% +% {\setuplanguage +% [\s!pl] +% [\c!leftsentence=\leftguillemot, +% \c!rightsentence=\rightguillemot, +% \c!leftsubsentence=\leftsubguillemot, +% \c!rightsubsentence=\rightsubguillemot]} +% +% \installcompoundcharacter /< {{\setupPLlanguage|<|}} +% \installcompoundcharacter /> {{\setupPLlanguage|>|}} +% +% \installcompoundcharacter /- {|-|} +% +% \stoplanguagespecifics +% +% \startlanguagespecifics[\s!pl] +% +% \definesortkey {/a}{a}{a}{\k a} +% \definesortkey {/A}{a}{a}{\k a} +% \definesortkey {/c}{c}{a}{\'c} +% \definesortkey {/C}{c}{a}{\'c} +% \definesortkey {/e}{e}{a}{\k e} +% \definesortkey {/E}{e}{a}{\k e} +% \definesortkey {/l}{l}{a}{\l } +% \definesortkey {/L}{l}{a}{\l } +% \definesortkey {/n}{n}{a}{\'n} +% \definesortkey {/N}{n}{a}{\'n} +% \definesortkey {/o}{o}{a}{\'o} +% \definesortkey {/O}{o}{a}{\'o} +% \definesortkey {/s}{s}{a}{\'s} +% \definesortkey {/S}{s}{a}{\'s} +% \definesortkey {/x}{z}{a}{\'x} +% \definesortkey {/X}{z}{a}{\'x} +% \definesortkey {/z}{z}{b}{\.z} +% \definesortkey {/Z}{z}{b}{\.z} +% +% \stoplanguagespecifics +% +% \startencoding[pdfdoc] +% \startlanguagespecifics[pl]% hm +% \defineactivecharacter / {\simplifiedcompoundcharacter/} +% \stoplanguagespecifics +% \stopencoding +% % this can best be handled by \quotation and || % % \startlanguagespecifics[\s!hr] diff --git a/tex/context/base/lang-ura.tex b/tex/context/base/lang-ura.tex index 8ec95b5e3..f80bf6189 100644 --- a/tex/context/base/lang-ura.tex +++ b/tex/context/base/lang-ura.tex @@ -11,11 +11,17 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\writestatus{loading}{Uralic Languages} + +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. + % Cheremiss, Estonian, Finnish, Karelian, Laap, Mordvinian, % Permian tongues, Hungarianm Ostyak, Vogul, Samoyed -\writestatus{loading}{Uralic Languages} - \unprotect \installlanguage diff --git a/tex/context/base/lang-vn.tex b/tex/context/base/lang-vn.tex index 78866750e..d249bfff9 100644 --- a/tex/context/base/lang-vn.tex +++ b/tex/context/base/lang-vn.tex @@ -11,6 +11,18 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\writestatus{loading}{Vietnamese Language} + +%D The framework of this module is set up by Hans Hagen while +%D many of the first translations were done by Tobias. Later +%D on, corrections were made by users. If you have suggestions, +%D or feel that your name missing here, don't hesitate to send +%D us an email. +%D +%D \starttabulate[|lB|l|] +%D \NC Vietnamese \NC \THANH\ \NC \NR +%D \stoptabulate + \unprotect \definesystemconstant {vietnamese} \definesystemconstant {vn} diff --git a/tex/context/base/m-chart.tex b/tex/context/base/m-chart.tex index 7598da088..e4b84abc1 100644 --- a/tex/context/base/m-chart.tex +++ b/tex/context/base/m-chart.tex @@ -8,21 +8,21 @@ %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% to do: \localpushmacro/\localpopmacro (dosetflowchart etc) %D This is an experimental module. Pieces of code will be moved -%D to other modules. More features are possible but will be +%D to other modules. More features are possible but will be %D interfaces later. %D -%D When finished this module will be documented. The main macro -%D is a rather big one. I'm not sure if splitting it up is wise. - -% The 1pt offset is due to 'error' in pdftex form placement, -% version 14a+ will be ok. This needs checking. +%D When finished this module will be documented. The main macro +%D is still a rather big one and there is some redundant and +%D slow code that needs a clean up. % arrow, dash -% crossing +% crossing % \goto -> \normalgoto % class -> class:name (ref prefix) % c, automatisch geen overlap zoeken @@ -46,7 +46,9 @@ % y : y offset (clipping) % nx : minimaal aantal cellen horizontaal % ny : minimaal aantal cellen vertikaal - +% +% shape none en geen equivalent maken +% % kaderkleur achtergrondkleur % lijnkleur lijndikte % focus focuskaderkleur focusachtergrondkleur @@ -56,83 +58,159 @@ \unprotect -\def\setFLOWname#1#2% - {\bgroup +\definieersorteren [flowchart] [flowcharts] [\v!geen] % no access +\stelsorterenin [flowchart] [\c!status=\v!stop] % off by default + +\def\@FLOW@{@FLOW@} +\def\@FLOC@{@FLOC@} +\def\@FLOX@{@FLOX@} + +\def\@@FLOW{@@FLOW} +\def\@@FLOL{@@FLOL} +\def\@@FLOS{@@FLOS} +\def\@@FLOF{@@FLOF} +\def\@@FLOT{@@FLOT} +\def\@@FLOX{@@FLOX} + +\def\@@MPx {@@MPx} +\def\@@MPy {@@MPy} + +\def\FLOWbufferprefix{flw-} + +\def\setFLOWname#1#2% funny hack that makes sure that we get + {\bgroup % names that are acceptable for METAPOST \lccode`0=`a\lccode`1=`b\lccode`2=`c\lccode`3=`d\lccode`4=`e% \lccode`5=`f\lccode`6=`g\lccode`7=`h\lccode`8=`i\lccode`9=`j% \lccode` =`\_\lccode`-=`\_\lccode`_=`\_% \lowercase{\gdef#1{#2}}% \egroup} +% een gobble als default is sneller, en dan alleen setten als +% nodig + \def\resetFLOWcell% - {\global\let\FLOWname \empty + {% variables + \global\let\FLOWname \empty \global\let\FLOWalign \empty \global\let\FLOWshape \empty \global\let\FLOWlocation \empty - \global\let\FLOWtext \empty + \global\let\FLOWtext \empty \global\let\FLOWhelp \empty \global\let\FLOWdestination\empty \global\let\FLOWoverlay \empty \global\let\FLOWfocus \empty \global\let\tFLOWlabel \empty \global\let\bFLOWlabel \empty - \global\let\bcFLOWlabel \empty \global\let\lFLOWlabel \empty \global\let\rFLOWlabel \empty - \def\name ##1{\def\FLOWcell{##1}\setFLOWname\FLOWname{name_##1}\ignorespaces}% - \def\shape ##1{\gdef\FLOWshape{##1}\ignorespaces}% - \def\destination ##1{\gdef\FLOWdestination{##1}\ignorespaces}% - \def\location ##1{\setFLOWlocation##1\end\ignorespaces}% - \def\focus ##1{\gdef\FLOWfocus{##1}\ignorespaces}% - \def\overlay ##1{\gdef\FLOWoverlay{##1}\ignorespaces}% - \def\figure ##1{\defineoverlay - [dummy] - [{\externalfigure - [##1] - [\c!breedte=\overlaywidth, - \c!hoogte=\overlayheight]}]% - \overlay{dummy}}% - \def\dotext [##1]##2{\gdef\FLOWalign{##1}\gdef\FLOWtext{##2}}% - \def\text {\dosingleempty\dotext}% - \def\comment [##1]##2{\ignorespaces\dogobblesingleempty}% - \def\label [##1]##2{\setgvalue{##1FLOWlabel}{##2}\ignorespaces}% - \def\help ##1{\gdef\FLOWhelp{##1}\ignorespaces}% - \def\connection[##1]##2{\ignorespaces}% - \def\connect {\connection}% - \def\locate {\location}} + \global\let\bcFLOWlabel \empty + \global\let\tcFLOWlabel \empty + \global\let\lcFLOWlabel \empty + \global\let\rcFLOWlabel \empty + \global\let\tFLOWexit \empty + \global\let\bFLOWexit \empty + \global\let\lFLOWexit \empty + \global\let\rFLOWexit \empty + % commands + \let\name \doFLOWname + \let\shape \doFLOWshape + \let\destination\doFLOWdestination + \let\location \doFLOWlocation + \let\focus \doFLOWfocus + \let\overlay \doFLOWoverlay + \let\figure \doFLOWfigure + \let\text \doFLOWtext + \let\comment \doFLOWcomment + \let\label \doFLOWlabel + \let\help \doFLOWhelp + \let\connection \doFLOWconnection + \let\exit \doFLOWexit + % convenience commands + \let\locate \doFLOWlocate + \let\connect \doFLOWconnect} + +\def\doFLOWname#1% + {\def\FLOWcell{#1}\setFLOWname\FLOWname{name_#1}\ignorespaces} + +\def\doFLOWshape#1% + {\gdef\FLOWshape{#1}\ignorespaces} + +\def\doFLOWdestination#1% + {\gdef\FLOWdestination{#1}\ignorespaces} + +\def\doFLOWlocation#1% + {\setFLOWlocation#1\end\ignorespaces} + +\def\doFLOWfocus#1% + {\gdef\FLOWfocus{#1}\ignorespaces} + +\def\doFLOWoverlay#1% + {\gdef\FLOWoverlay{#1}\ignorespaces} + +\def\doFLOWfigure#1% + {\defineoverlay + [\s!dummy] + [{\externalfigure + [#1] + [\c!breedte=\overlaywidth, + \c!hoogte=\overlayheight]}]% + \overlay{\s!dummy}} + +\def\doFLOWtext% + {\dosingleempty\dodoFLOWtext} + +\def\dodoFLOWtext[#1]#2% + {\gdef\FLOWalign{#1}\gdef\FLOWtext{#2}} + +\def\doFLOWcomment[#1]#2% + {\ignorespaces\dogobblesingleempty} + +\def\doFLOWlabel[#1]#2% wordt dit gebruikt ? + {\setgvalue{#1FLOWlabel}{#2}\ignorespaces} + +\def\doFLOWhelp#1% + {\gdef\FLOWhelp{#1}\ignorespaces} + +\def\doFLOWconnection[#1]#2% + {\ignorespaces} + +\def\doFLOWconnect% + {\connection} + +\def\doFLOWlocate% + {\location} + +\def\doFLOWexit[#1]#2% + {\setgvalue{#1FLOWexit}{#2}\ignorespaces} \def\startFLOWchart% {\bgroup \let\stopFLOWchart\egroup - \obeylines % lelijk, buffers nog eens fatsoeneren + \obeylines % lelijk, buffers nog eens fatsoeneren \dodoubleempty\dostartFLOWchart} \def\dostartFLOWchart[#1][#2]% {\doglobal\increment\nofFLOWcharts - \setxvalue{FLOW-#1}% + \flowchart{#1}% + \setxvalue{\@FLOW@-#1}% {\noexpand\dosetFLOWchart[\nofFLOWcharts][#2]}% - \dostartbuffer[flw-\nofFLOWcharts][startFLOWchart][stopFLOWchart]} - -\def\setupFLOWcharts% - {\dodoubleargument\getparameters[@@FLOW]} - -\def\setupFLOWlines% - {\dodoubleargument\getparameters[@@FLOL]} + \dostartbuffer[\FLOWbufferprefix\nofFLOWcharts][startFLOWchart][stopFLOWchart]} -\def\setupFLOWshapes% - {\dodoubleargument\getparameters[@@FLOS]} - -\def\setupFLOWfocus% - {\dodoubleargument\getparameters[@@FLOF]} +\def\setupFLOWcharts{\dodoubleargument\getparameters[\@@FLOW]} +\def\setupFLOWlines {\dodoubleargument\getparameters[\@@FLOL]} +\def\setupFLOWshapes{\dodoubleargument\getparameters[\@@FLOS]} +\def\setupFLOWfocus {\dodoubleargument\getparameters[\@@FLOF]} +\def\setupFLOWsets {\dodoubleargument\getparameters[\@@FLOX]} \setupFLOWcharts [\c!optie=, + \c!korps=, \c!punt=, % private option \c!breedte=12\bodyfontsize, \c!hoogte=7\bodyfontsize, \c!maxbreedte=, \c!maxhoogte=, - \c!offset=0pt, % auto offset: .5\bodyfontsize, + \c!offset=\v!standaard, % == auto offset \c!dx=2\bodyfontsize, \c!dy=2\bodyfontsize, \c!nx=0, % 1, @@ -173,10 +251,10 @@ \c!lijndikte=\@@FLOSlijndikte, \c!offset=\@@FLOSoffset] -\definecolor[FLOWfocuscolor] [s=.2] -\definecolor[FLOWlinecolor] [s=.5] -\definecolor[FLOWframecolor] [s=.7] -\definecolor[FLOWbackgroundcolor] [s=.9] +\definecolor [FLOWfocuscolor] [s=.2] +\definecolor [FLOWlinecolor] [s=.5] +\definecolor [FLOWframecolor] [s=.7] +\definecolor [FLOWbackgroundcolor] [s=.9] \newcounter\includeFLOWx \newcounter\includeFLOWy @@ -188,17 +266,15 @@ {\pushmacro\includeFLOWx \pushmacro\includeFLOWy \getparameters[FLOWi][x=1,y=1,#2]% - \increment(\includeFLOWx,0\FLOWix)% - \decrement(\includeFLOWx,1)% - \increment(\includeFLOWy,0\FLOWiy)% - \decrement(\includeFLOWy,1)% + \increment(\includeFLOWx,0\FLOWix)\decrement\includeFLOWx + \increment(\includeFLOWy,0\FLOWiy)\decrement\includeFLOWy \def\dodoincludeFLOWchart##1% - {\doifdefined{FLOW-##1} + {\doifdefined{\@FLOW@-##1} {\pushmacro\dosetFLOWchart - \def\dosetFLOWchart[####1][####2]% + \gdef\dosetFLOWchart[####1][####2]% {\popmacro\dosetFLOWchart - \haalbuffer[flw-####1]}% - \getvalue{FLOW-##1}}}% + \haalbuffer[\FLOWbufferprefix####1]}% + \getvalue{\@FLOW@-##1}}}% \processcommalist[#1]\dodoincludeFLOWchart \popmacro\includeFLOWx \popmacro\includeFLOWy} @@ -216,7 +292,7 @@ left, right} \def\FLOWlines% - {up, down, left, right} + {up, down, left, right} \def\FLOWsetconnect#1% {\donefalse @@ -248,93 +324,44 @@ \newif\ifFLOWscaling \FLOWscalingtrue +\def\@@FLOW@@offset{\@@FLOWoffset} + \def\getFLOWchart% {\dodoubleempty\dogetFLOWchart} \def\dogetFLOWchart[#1][#2]% - {\doifundefinedelse{FLOW-#1} + {\doifundefinedelse{\@FLOW@-#1} {\writestatus{FLOW}{unknown chart #1}% \framed [\c!breedte=12\bodyfontsize,\c!hoogte=8\bodyfontsize] {\tttf [chart #1]}} {\dodogetFLOWchart[#1][#2]}} -\def\dodogetFLOWchart[#1][#2]% - {\bgroup -\forgetall -\offinterlineskip +\def\dodogetFLOWchart[#1][#2]% to be split a bit more + {\vbox\bgroup + \forgetall + \dontcomplain + \offinterlineskip \def\dosetFLOWchart[##1][##2]% {\def\currentFLOWnumber{##1}% - \getparameters[@@FLOW][##2]}% - \getvalue{FLOW-#1}% - \getparameters[@@FLOW][#2]% dubbelop ? + \getparameters[\@@FLOW][##2]}% + \getvalue{\@FLOW@-#1}% + \getparameters[\@@FLOW][#2]% dubbelop ? \doifsomething{\@@FLOWautofocus} - {\def\@@FLOWminx{100}\let\@@FLOWminy\@@FLOWminx - \def\@@FLOWmaxx {0}\let\@@FLOWmaxy\@@FLOWmaxx - \def\@@FLOWabsx {0}\let\@@FLOWabsy\@@FLOWabsx - \def\startFLOWcell% - {\resetFLOWcell}% - \def\dodolocation##1##2##3##4% - {\ifnum##1##2##4\relax - \!!counta=##1\advance\!!counta by ##31\relax - \edef##4{\ifnum\!!counta<1 1\else\the\!!counta\fi}% - \fi}% - \def\dolocation##1,##2\end% - {\ifnum##1>\@@FLOWabsx\def\@@FLOWabsx{##1}\fi - \ifnum##2>\@@FLOWabsy\def\@@FLOWabsy{##2}\fi - \ExpandBothAfter\doifinset{\FLOWcell}{\@@FLOWautofocus} - {\dodolocation{##1}<-\@@FLOWminx - \dodolocation{##1}>+\@@FLOWmaxx - \dodolocation{##2}<-\@@FLOWminy - \dodolocation{##2}>+\@@FLOWmaxy}}% - \def\stopFLOWcell% - {\expandafter\dolocation\FLOWlocation\end}% - \haalbuffer[flw-\currentFLOWnumber]% - %\message{AUTOSHAPE 1: (\@@FLOWminx,\@@FLOWminy)->(\@@FLOWmaxx,\@@FLOWmaxy)}% - \ifnum\@@FLOWabsx<\@@FLOWmaxx\let\@@FLOWmaxx\@@FLOWabsx\fi - \ifnum\@@FLOWabsy<\@@FLOWmaxy\let\@@FLOWmaxy\@@FLOWabsy\fi - %\message{AUTOSHAPE 2: (\@@FLOWminx,\@@FLOWminy)->(\@@FLOWmaxx,\@@FLOWmaxy)}% - \donetrue - \ifnum\@@FLOWminx=100 \donefalse\fi - \ifnum\@@FLOWminy=100 \donefalse\fi - \ifnum\@@FLOWmaxx=0 \donefalse\fi - \ifnum\@@FLOWmaxy=0 \donefalse\fi - \def\do##1##2##3##4% - {\ifdone - \let##1=##2% - \!!counta=##3% - \advance\!!counta 1\advance\!!counta -##2\relax - \ifnum\!!counta<1 \!!counta=1 \fi - \edef##4{\the\!!counta}% - \else - \def##1{1}\def##4{0}% {1}% - \fi}% - \do\@@FLOWx\@@FLOWminx\@@FLOWmaxx\@@FLOWnx - \do\@@FLOWy\@@FLOWminy\@@FLOWmaxy\@@FLOWny}% + {\checkFLOWautofocus}% %\message{AUTOSHAPE 3: (\@@FLOWx,\@@FLOWy)->(\@@FLOWnx,\@@FLOWny)}\wait \let\FLOWwidth \@@FLOWnx \let\FLOWheight\@@FLOWny - \def\getFLOWlocation##1,##2\end% - {\ifnum0##1>\FLOWwidth \edef\FLOWwidth {##1}\fi - \ifnum0##2>\FLOWheight\edef\FLOWheight{##2}\fi}% - \long\def\startFLOWcell##1\stopFLOWcell% - {\resetFLOWcell - \ignorespaces##1\unskip - \expandafter\getFLOWlocation\FLOWlocation\end - \ignorespaces}% - \haalbuffer[flw-\currentFLOWnumber]% - \ifcase\@@FLOWnx\relax - \let\@@FLOWnx\FLOWwidth - \fi - \ifcase\@@FLOWny\relax - \let\@@FLOWny\FLOWheight - \fi + \let\startFLOWcell\startFLOWcellA + \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]% + \ifcase\@@FLOWnx\relax \let\@@FLOWnx\FLOWwidth \fi + \ifcase\@@FLOWny\relax \let\@@FLOWny\FLOWheight \fi \doifnothing{\@@FLOWmaxbreedte\@@FLOWmaxhoogte}{\FLOWscalingfalse}% - \ifFLOWscaling + \ifFLOWscaling \doifnothing{\@@FLOWmaxbreedte}{\let\@@FLOWmaxbreedte\maxdimen}% \doifnothing{\@@FLOWmaxhoogte} {\let\@@FLOWmaxhoogte \maxdimen}% \scratchcounter=\bodyfontpoints - \doloop % NOG FONTSWITCH OM EX EN EM TE LATEN WERKEN + \doloop % NOG FONTSWITCH OM EX EN EM TE LATEN WERKEN {\ifnum\scratchcounter>1 % NU DIMENSIONS IN TERMS OF BODYFONTSIZE \bodyfontsize=\the\scratchcounter pt \dimen0=\@@FLOWmaxbreedte @@ -364,7 +391,9 @@ \expanded{\switchtobodyfont[\the\scratchcounter pt]}% \forgetall \offinterlineskip - \fi + \else\ifx\@@FLOWkorps\empty\else + \expanded{\switchtobodyfont[\@@FLOWkorps]}% \expanded ? + \fi\fi \global\let\FLOWcells\empty \dimen0=\@@FLOWbreedte \edef\FLOWshapewidth{\the\dimen0}% @@ -397,44 +426,47 @@ \scratchdimen=\@@FLOLstraal \edef\@@FLOLstraal{\the\scratchdimen}% \fi - \ifdim\@@FLOWoffset=\!!zeropoint - \edef\@@FLOWoffset{\the\scratchdimen}% - \else - \scratchdimen=\@@FLOWoffset - \edef\@@FLOWoffset{\the\scratchdimen}% - \fi + \processaction % magic 2.5 + [\@@FLOWoffset] + [ \v!geen=>\scratchdimen=-2.5\scratchdimen, + \v!overlay=>\scratchdimen=-2.5\scratchdimen, + \v!standaard=>\scratchdimen=\scratchdimen, + \s!unknown=>\scratchdimen=\@@FLOWoffset, + \s!default=>\scratchdimen=-2.5\scratchdimen]% + \edef\@@FLOW@@offset{\the\scratchdimen}% \forgetall \offinterlineskip \resetMPdrawing \doglobal\newcounter\FLOWcomment \startMPdrawing - input mp-chart.mp ; + input mp-char.mp ; grid_width := \FLOWgridwidth ; grid_height := \FLOWgridheight ; shape_width := \FLOWshapewidth ; shape_height := \FLOWshapeheight ; connection_line_width := \@@FLOLlijndikte ; - connection_smooth_size := \@@FLOLstraal ; % 2.5connection_line_width ; - connection_arrow_size := \@@FLOLstraal ; % 2.5connection_line_width ; - connection_dash_size := \@@FLOLstraal ; % 2.5connection_line_width ; - \stopMPdrawing -% \def\getFLOWlocation##1,##2\end% -% {\ifnum0##1>\FLOWwidth \edef\FLOWwidth {##1}\fi -% \ifnum0##2>\FLOWheight\edef\FLOWheight{##2}\fi}% -% \long\def\startFLOWcell##1\stopFLOWcell% -% {\resetFLOWcell -% \ignorespaces##1\unskip -% \expandafter\getFLOWlocation\FLOWlocation\end -% \ignorespaces}% -% \haalbuffer[flw-\currentFLOWnumber]% -% \ifnum\@@FLOWnx\@@FLOWny=11 % listig -% \let\@@FLOWnx\FLOWwidth -% \let\@@FLOWny\FLOWheight -% \fi - \startMPdrawing + connection_smooth_size := \@@FLOLstraal ; + connection_arrow_size := \@@FLOLstraal ; + connection_dash_size := \@@FLOLstraal ; +% \stopMPdrawing +% \def\getFLOWlocationX##1,##2\end% +% {\ifnum0##1>\FLOWwidth \edef\FLOWwidth {##1}\fi +% \ifnum0##2>\FLOWheight\edef\FLOWheight{##2}\fi}% +% \long\def\startFLOWcellX##1\stopFLOWcell% +% {\resetFLOWcell +% \ignorespaces##1\unskip +% \expandafter\getFLOWlocationX\FLOWlocation\end +% \ignorespaces}% +% \let\startFLOWcell\startFLOWcellX +% \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]% +% \ifnum\@@FLOWnx\@@FLOWny=11 % listig +% \let\@@FLOWnx\FLOWwidth +% \let\@@FLOWny\FLOWheight +% \fi +% \startMPdrawing begin_chart(0,\FLOWwidth,\FLOWheight); reverse_y := true ; - chart_offset := \@@FLOWoffset ; + chart_offset := \@@FLOW@@offset ; \stopMPdrawing \doifelsenothing{\@@FLOWachtergrondkleur} {\startMPdrawing @@ -448,7 +480,7 @@ show_con_points := true ; show_mid_points := true ; show_all_points := true ; - \stopMPdrawing} + \stopMPdrawing}% \processaction % private [\@@FLOWpunt] [ \v!ja=>\startMPdrawing @@ -459,86 +491,10 @@ \s!unknown=>\startMPdrawing show_\@@FLOWpunt_points := true ; \stopMPdrawing]% - \long\def\startFLOWcell##1\stopFLOWcell% - {\resetFLOWcell - \ignorespaces##1\unskip - \setxvalue{FLOW-loc-\FLOWname}{\FLOWlocation}% - \ifx\FLOWshape\empty - \global\let\FLOWshape\@@FLOSdefault - \fi - \doifnot{\FLOWshape}{\v!geen} - {\ExpandBothAfter\doifinsetelse{\FLOWshape}{\FLOWshapes} - {\edef\FLOWshapetag{shape_\FLOWshape}% - \@EA\setFLOWname\@EA\FLOWshapetag\@EA{\FLOWshapetag}} - {\doifnumberelse{\FLOWshape} - {\let\FLOWshapetag\FLOWshape} - {\let\FLOWshapetag\empty}}% - \ifx\FLOWshapetag\empty \else - \ExpandBothAfter\doifinsetelse{\FLOWshape}{\FLOWlines} - {\chardef\FLOWstate=0 } - {\ExpandBothAfter\doifcommonelse{\FLOWcell,\FLOWfocus}{\@@FLOWfocus} - {\chardef\FLOWstate=1 } - {\chardef\FLOWstate=2 }}% - \startMPdrawing - begin_sub_chart ; - \ifcase\FLOWstate - shape_line_color := \MPcolor{\@@FLOLkleur} ; - shape_fill_color := \MPcolor{\@@FLOLkleur} ; - shape_line_width := \@@FLOLlijndikte ; - \or - shape_line_color := \MPcolor{\@@FLOFkaderkleur} ; - shape_fill_color := \MPcolor{\@@FLOFachtergrondkleur} ; - shape_line_width := \@@FLOFlijndikte ; - \or - shape_line_color := \MPcolor{\@@FLOSkaderkleur} ; - shape_fill_color := \MPcolor{\@@FLOSachtergrondkleur} ; - shape_line_width := \@@FLOSlijndikte ; - \fi - \ifx\FLOWoverlay\empty - peepshape := false ; - \else - peepshape := true ; - \fi - new_shape(\FLOWlocation,\FLOWshapetag) ; - end_sub_chart ; - \stopMPdrawing - \fi}% - \ignorespaces}% - \haalbuffer[flw-\currentFLOWnumber]% - \long\def\startFLOWcell##1\stopFLOWcell% - {\resetFLOWcell - \def\connection[####1]####2% - {\doglobal\increment\FLOWcomment - \setFLOWname\otherFLOWname{name_####2}% - \doifdefinedelse{FLOW-loc-\FLOWname} - {\edef\FLOWfrom{\getvalue{FLOW-loc-\FLOWname}}} - {\edef\FLOWfrom{0,0}}% - \doifdefinedelse{FLOW-loc-\otherFLOWname} - {\edef\FLOWto {\getvalue{FLOW-loc-\otherFLOWname}}} - {\edef\FLOWto {0,0}}% - \FLOWsetconnect{####1}% - \ifx\cFLOWfrom\empty\else - \doifelse{\@@FLOLhoek}{\v!rond} - {\startMPdrawing smooth := true ; \stopMPdrawing} - {\startMPdrawing smooth := false ; \stopMPdrawing}% - \doifelse{\@@FLOLstreep}{\v!ja} - {\startMPdrawing dashline := true ; \stopMPdrawing} - {\startMPdrawing dashline := false ; \stopMPdrawing}% - \doifelse{\@@FLOLpijl}{\v!ja} - {\startMPdrawing arrowtip := true ; \stopMPdrawing} - {\startMPdrawing arrowtip := false ; \stopMPdrawing}% - \doifelse{\@@FLOLoffset}{\v!geen} - {\startMPdrawing touchshape := true ; \stopMPdrawing} - {\startMPdrawing touchshape := false ; \stopMPdrawing}% - \startMPdrawing - connection_line_color := \MPcolor{\@@FLOLkleur} ; - connection_line_width := \@@FLOLlijndikte ; - connect_\cFLOWfrom_\cFLOWto (\FLOWfrom,\zFLOWfrom) (\FLOWto,\zFLOWto) ; - \stopMPdrawing - \fi - \ignorespaces}% - \ignorespaces##1\unskip}% - \haalbuffer[flw-\currentFLOWnumber]% + \let\startFLOWcell\startFLOWcellB + \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]% + \let\startFLOWcell\startFLOWcellC + \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]% \startMPdrawing clip_chart(\@@FLOWx,\@@FLOWy,\@@FLOWnx,\@@FLOWny) ; end_chart ; @@ -548,213 +504,34 @@ \def\MPmessage##1% {\writestatus{MP charts}{##1}}% \def\MPposition##1##2##3% - {\setvalue{MPx##1}{##2}\setvalue{MPy##1}{##3}}% + {\setvalue{\@@MPx##1}{##2}\setvalue{\@@MPy##1}{##3}}% \def\MPclippath##1##2##3##4% {\def\clipMPllx{##1bp}\def\clipMPlly{##2bp}% \def\clipMPurx{##3bp}\def\clipMPury{##4bp}}% \def\MPareapath##1##2##3##4% {\def\areaMPllx{##1bp}\def\areaMPlly{##2bp}% \def\areaMPurx{##3bp}\def\areaMPury{##4bp}}% - \readfile{\MPdatafile}{}{}% + \getMPdata \doglobal\newcounter\FLOWcomment - \long\def\startFLOWcell##1\stopFLOWcell% - {\resetFLOWcell - \ignorespaces##1\unskip - \def\doprocessFLOWcell####1,####2\end % kan ook met area - {\!!counta=####1\relax - \!!countb=####2\relax - \!!countc=\@@FLOWx - \!!countd=\@@FLOWy - \advance\!!countc \@@FLOWnx - \advance\!!countd \@@FLOWny - \advance\!!countc -1 - \advance\!!countd -1 - \ifnum\!!counta<\@@FLOWx\relax - \donefalse - \else\ifnum\!!counta>\!!countc - \donefalse - \else\ifnum\!!countb<\@@FLOWy\relax - \donefalse - \else\ifnum\!!countb>\!!countd - \donefalse - \else - \donetrue - \doglobal\addtocommalist\FLOWcell\FLOWcells - \advance\!!counta by -\@@FLOWx\advance\!!counta by 1 - \advance\!!countb by -\@@FLOWy\advance\!!countb by 1 - \dimen0=\FLOWgridwidth\dimen0=\!!counta\dimen0 - \advance\dimen0 by -\FLOWgridwidth - \dimen4=\FLOWgridwidth\advance\dimen4 by -\FLOWshapewidth - \advance\dimen0 by .5\dimen4 - \dimen2=\FLOWgridheight\dimen2=\!!countb\dimen2 - \dimen4=\FLOWgridheight\advance\dimen4 by -\FLOWshapeheight - \advance\dimen2 by -.5\dimen4 - \setbox0=\hbox - {\ifx\FLOWalign\empty\else - \setupframed - [\c!uitlijnen=\v!normaal,\c!onder=\vfill,\c!boven=\vfill]% - \@EA\processallactionsinset\@EA - [\FLOWalign] - [t=>{\setupframed[\c!onder=\vfill,\c!boven=]}, - b=>{\setupframed[\c!onder=,\c!boven=\vfill]}, - l=>{\setupframed[\c!uitlijnen=\v!rechts]}, - r=>{\setupframed[\c!uitlijnen=\v!links]}, - m=>{\setupframed[\c!uitlijnen=\v!midden]}, - c=>{\setupframed[\c!uitlijnen=\v!midden]}]% - \fi - \doifelse{\FLOWshape}{\v!geen} - {\setupframed[\c!offset=\v!overlay]} - {\setupframed[\c!offset=.5\bodyfontsize]}% - \framed - [\c!kader=\v!uit,\c!breedte=\FLOWshapewidth,\c!hoogte=\FLOWshapeheight] - {\FLOWtext}}% - \showFLOWhelp0 - \ifx\FLOWdestination\empty\else - \setbox0=\hbox - {\setupinteraction[\c!kleur=,\c!contrastkleur=]% - \naarbox{\box0}[\FLOWdestination]}% - \fi - \edef\FLOWdx{\the\dimen0}% - \edef\FLOWdy{\the\dimen2}% - \def\positionFLOWzero% - {\setbox0=\hbox{\hskip\FLOWdx\lower\FLOWdy\box0}% - \smashbox0 - \box0} % - \positionFLOWzero - \dimen0=\FLOWshapewidth \dimen2=.5\dimen0 - \dimen4=\FLOWshapeheight\dimen6=.5\dimen4 - \boxoffset=.5\bodyfontsize - \setbox0=\hbox{\hskip\dimen2\raise\dimen4 - \hbox{\righttopbox{\strut\tFLOWlabel}}}% - \positionFLOWzero - \setbox0=\hbox{\hskip\dimen2 - \hbox{\rightbottombox{\strut\bFLOWlabel}}}% - \positionFLOWzero - \setbox0=\hbox{\raise\dimen6 - \hbox{\lefttopbox {\strut\lFLOWlabel}}}% - \positionFLOWzero - \setbox0=\hbox{\hskip\dimen0\raise\dimen6 - \hbox{\righttopbox{\strut\rFLOWlabel}}}% - \positionFLOWzero - \setbox0=\hbox{\hskip\dimen2 % for me only - \hbox{\bottombox{\strut\bcFLOWlabel}}}% - \positionFLOWzero - \fi\fi\fi\fi}% - \expandafter\doprocessFLOWcell\FLOWlocation\end - \def\connection[####1]####2% - {\doglobal\increment\FLOWcomment - \ignorespaces}% - \def\comment[####1]####2% - {\bgroup - \let\FLOW \middlebox - \let\FLOWb \bottombox - \let\FLOWbl\bottomleftbox - \let\FLOWbr\bottomrightbox - \let\FLOWt \topbox - \let\FLOWtl\topleftbox - \let\FLOWtr\toprightbox - \let\FLOWl \leftbox - \let\FLOWlt\lefttopbox - \let\FLOWlb\leftbottombox - \let\FLOWr \rightbox - \let\FLOWrt\righttopbox - \let\FLOWrb\rightbottombox - \let\FLOWc \middlebox - \ifcase0\getvalue{MPx\FLOWcomment}\getvalue{MPy\FLOWcomment}\relax - \else - \ifdim\getvalue{MPx\FLOWcomment}bp<\areaMPllx\relax\else - \ifdim\getvalue{MPx\FLOWcomment}bp>\areaMPurx\relax\else - \ifdim\getvalue{MPy\FLOWcomment}bp<\areaMPlly\relax\else - \ifdim\getvalue{MPy\FLOWcomment}bp>\areaMPury\relax\else - \dimen0=\getvalue{MPx\FLOWcomment}bp - \advance\dimen0 by -\@@FLOWoffset - \advance\dimen0 by -\clipMPllx - \dimen2=\clipMPury - \advance\dimen2 by -\@@FLOWoffset - \advance\dimen2 by -\getvalue{MPy\FLOWcomment}bp - \setbox0=\hbox{\strut####2}% - \boxoffset=.5\bodyfontsize - \setbox0=\hbox - {\hskip\dimen0\lower\dimen2\getvalue{FLOW####1}{\box0}}% - \wd0=\!!zeropoint\ht0=\!!zeropoint\dp0=\!!zeropoint - \box0 - \fi - \fi - \fi - \fi - \fi - \egroup - \ignorespaces}% - \ignorespaces##1\unskip - \ignorespaces}% + \let\startFLOWcell\startFLOWcellD \setbox2=\vbox to \ht0 {\forgetall%%%\offinterlineskip - \haalbuffer[flw-\currentFLOWnumber]\vss}% + \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]\vss}% \setbox2=\hbox - {\hskip\@@FLOWoffset\lower\@@FLOWoffset\box2}% + {\hskip\@@FLOW@@offset\lower\@@FLOW@@offset\box2}% \wd2=\wd0\ht2=\ht0\dp2=\dp0 - %%%%%%%% - \long\def\startFLOWcell##1\stopFLOWcell% - {\resetFLOWcell - \ignorespaces##1\unskip - \def\doprocessFLOWcell####1,####2\end % redundant - {\ifx\FLOWoverlay\empty \else - \!!counta=####1\relax - \!!countb=####2\relax - \!!countc=\@@FLOWx - \!!countd=\@@FLOWy - \advance\!!countc \@@FLOWnx - \advance\!!countd \@@FLOWny - \advance\!!countc -1 - \advance\!!countd -1 - \ifnum\!!counta<\@@FLOWx\relax - \donefalse - \else\ifnum\!!counta>\!!countc - \donefalse - \else\ifnum\!!countb<\@@FLOWy\relax - \donefalse - \else\ifnum\!!countb>\!!countd - \donefalse - \else - \donetrue - \fi\fi\fi\fi - \ifdone - \advance\!!counta by -\@@FLOWx\advance\!!counta by 1 - \advance\!!countb by -\@@FLOWy\advance\!!countb by 1 - \dimen0=\FLOWgridwidth\dimen0=\!!counta\dimen0 - \advance\dimen0 by -\FLOWgridwidth - \dimen4=\FLOWgridwidth\advance\dimen4 by -\FLOWshapewidth - \advance\dimen0 by .5\dimen4 - \dimen2=\FLOWgridheight\dimen2=\!!countb\dimen2 - \dimen4=\FLOWgridheight\advance\dimen4 by -\FLOWshapeheight - \advance\dimen2 by -.5\dimen4 - \edef\FLOWdx{\the\dimen0}% - \edef\FLOWdy{\the\dimen2}% - \setbox0=\hbox - {\framed - [\c!kader=\v!uit, - \c!achtergrond={\@@FLOWachtergrond,\FLOWoverlay}, - \c!achtergrondkleur=\@@FLOSachtergrondkleur, - \c!breedte=\FLOWshapewidth,\c!hoogte=\FLOWshapeheight] - {}}% - \setbox0=\hbox{\hskip\FLOWdx\lower\FLOWdy\box0}% - \smashbox0 - \box0 - \fi - \fi}% - \expandafter\doprocessFLOWcell\FLOWlocation\end}% + \let\startFLOWcell\startFLOWcellE \setbox4=\vbox to \ht0 {\forgetall%%%\offinterlineskip - \haalbuffer[flw-\currentFLOWnumber]\vss}% + \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]\vss}% \setbox4=\hbox - {\hskip\@@FLOWoffset\lower\@@FLOWoffset\box4}% + {\hskip\@@FLOW@@offset\lower\@@FLOW@@offset\box4}% \wd4=\wd0\ht4=\ht0\dp4=\dp0 - %%%%%%%% \doifelse{\@@FLOWoptie}{\v!test} {\setbox6=\vbox {\forgetall - \vskip\@@FLOWoffset - \hskip\@@FLOWoffset + \vskip\@@FLOW@@offset + \hskip\@@FLOW@@offset \rooster [\c!x=\@@FLOWx,\c!nx=\@@FLOWnx,\c!dx=\withoutpt\FLOWgridwidth, \c!y=\@@FLOWy,\c!ny=\@@FLOWny,\c!dy=\withoutpt\FLOWgridheight, @@ -763,11 +540,11 @@ \wd6=\wd0\ht6=\ht0\dp6=\dp0 \setbox8=\vbox {\forgetall\offinterlineskip - \vskip\@@FLOWoffset + \vskip\@@FLOW@@offset \dostepwiserecurse{\@@FLOWy}{\@@FLOWny}{1} {\vbox to \FLOWgridheight {\vfill - \hskip\@@FLOWoffset + \hskip\@@FLOW@@offset \hbox {\dostepwiserecurse{\@@FLOWx}{\@@FLOWnx}{1} {\hbox to \FLOWgridwidth @@ -780,13 +557,13 @@ \hfill}}} \vfill}}}% \wd8=\wd0\ht8=\ht0\dp8=\dp0 - \framed + \framed [\c!offset=\v!overlay,\c!kaderkleur=green] {\hbox{\box4\hskip-\wd0\box0\hskip-\wd2\box2\hskip-\wd6\box6\hskip-\wd8\box8}}} {\framed [\c!offset=\v!overlay, \c!kader=\@@FLOWkader, -\c!lijndikte=\@@FLOWlijndikte, + \c!lijndikte=\@@FLOWlijndikte, \c!kaderkleur=\@@FLOWkaderkleur, \c!achtergrond=\@@FLOWachtergrond, \c!achtergrondkleur=\@@FLOWachtergrondkleur] @@ -794,41 +571,408 @@ %\message{[\FLOWcells]}\wait \egroup} +% Pass A + +\long\def\startFLOWcellA#1\stopFLOWcell% + {\resetFLOWcell + \ignorespaces#1\unskip + \expandafter\getFLOWlocationA\FLOWlocation\end + \ignorespaces} + +\def\getFLOWlocationA#1,#2\end% + {\ifnum0#1>\FLOWwidth \edef\FLOWwidth {#1}\fi + \ifnum0#2>\FLOWheight\edef\FLOWheight{#2}\fi} + +% Pass B +% +% beware: the - after \@FLOC@ is needed since name can be +% empty and we don't want to redefine \@FLOC@ itself by +% mistake + +\long\def\startFLOWcellB#1\stopFLOWcell% + {\resetFLOWcell\ignorespaces#1\unskip% + \setxvalue{\@FLOC@-\FLOWname}{\FLOWlocation}% kost veel cs's + \ifx\FLOWshape\empty + \global\let\FLOWshape\@@FLOSdefault + \fi + \doifnot{\FLOWshape}{none} % {\v!geen} + {\ExpandBothAfter\doifinsetelse{\FLOWshape}{\FLOWshapes} + {\edef\FLOWshapetag{shape_\FLOWshape}% beter \expanded + \@EA\setFLOWname\@EA\FLOWshapetag\@EA{\FLOWshapetag}} + {\doifnumberelse{\FLOWshape} + {\let\FLOWshapetag\FLOWshape} + {\let\FLOWshapetag\empty}}% + \ifx\FLOWshapetag\empty \else + \ExpandBothAfter\doifinsetelse{\FLOWshape}{\FLOWlines} + {\chardef\FLOWstate=0 } + {\ExpandBothAfter\doifcommonelse{\FLOWcell,\FLOWfocus}{\@@FLOWfocus} + {\chardef\FLOWstate=1 } + {\chardef\FLOWstate=2 }}% + \startMPdrawing + begin_sub_chart ; + \ifcase\FLOWstate + shape_line_color := \MPcolor{\@@FLOLkleur} ; + shape_fill_color := \MPcolor{\@@FLOLkleur} ; + shape_line_width := \@@FLOLlijndikte ; + \or + shape_line_color := \MPcolor{\@@FLOFkaderkleur} ; + shape_fill_color := \MPcolor{\@@FLOFachtergrondkleur} ; + shape_line_width := \@@FLOFlijndikte ; + \or + shape_line_color := \MPcolor{\@@FLOSkaderkleur} ; + shape_fill_color := \MPcolor{\@@FLOSachtergrondkleur} ; + shape_line_width := \@@FLOSlijndikte ; + \fi + %\ifx\FLOWoverlay\empty + % peepshape := false ; + %\else + % peepshape := true ; + %\fi + peepshape := \ifx\FLOWoverlay\empty false \else true \fi ; + new_shape(\FLOWlocation,\FLOWshapetag) ; + end_sub_chart ; + \stopMPdrawing + \fi}% + \ignorespaces} + +% Pass C + +\long\def\startFLOWcellC#1\stopFLOWcell% + {\resetFLOWcell + \ignorespaces#1\unskip % makes sure that vars are set + \let\connection\doFLOWconnectionC + \ignorespaces#1\unskip} + +\def\FLOWorigin{0,0} + +\def\doFLOWconnectionC[#1]#2% + {\doglobal\increment\FLOWcomment + \setFLOWname\otherFLOWname{name_#2}% + \doifdefinedelse{\@FLOC@-\FLOWname} + {\edef\FLOWfrom{\getvalue{\@FLOC@-\FLOWname}}} + {\let \FLOWfrom \FLOWorigin}% + \ifx\FLOWfrom\FLOWorigin \else + \doifdefinedelse{\@FLOC@-\otherFLOWname} + {\edef\FLOWto {\getvalue{\@FLOC@-\otherFLOWname}}} + {\let \FLOWto \FLOWorigin}% + \ifx\FLOWto\FLOWorigin \else + \FLOWsetconnect{#1}% + \ifx\cFLOWfrom\empty \else + \doifelse{\@@FLOLhoek}{\v!rond} + {\startMPdrawing smooth := true ; \stopMPdrawing} + {\startMPdrawing smooth := false ; \stopMPdrawing}% + \doifelse{\@@FLOLstreep}{\v!ja} + {\startMPdrawing dashline := true ; \stopMPdrawing} + {\startMPdrawing dashline := false ; \stopMPdrawing}% + \doifelse{\@@FLOLpijl}{\v!ja} + {\startMPdrawing arrowtip := true ; \stopMPdrawing} + {\startMPdrawing arrowtip := false ; \stopMPdrawing}% + \doifelse{\@@FLOLoffset}{none} % {\v!geen} + {\startMPdrawing touchshape := true ; \stopMPdrawing} + {\startMPdrawing touchshape := false ; \stopMPdrawing}% + \startMPdrawing + connection_line_color := \MPcolor{\@@FLOLkleur} ; + connection_line_width := \@@FLOLlijndikte ; + connect_\cFLOWfrom_\cFLOWto (\FLOWfrom,\zFLOWfrom) (\FLOWto,\zFLOWto) ; + \stopMPdrawing + \fi + \fi + \fi + \ignorespaces} + +% Pass D + +\long\def\startFLOWcellD#1\stopFLOWcell% + {\resetFLOWcell + \ignorespaces#1\unskip % presets vars + \let\doprocessFLOWcell\doprocessFLOWcellD + \expandafter\doprocessFLOWcellD\FLOWlocation\end + \let\connection\doFLOWconnectionD + \let\comment\doFLOWcommentD + \ignorespaces#1\unskip\ignorespaces} + +\def\doFLOWconnectionD[#1]#2% + {\doglobal\increment\FLOWcomment + \ignorespaces} + +\def\doFLOWcommentD[#1]#2% + {\bgroup + \let\FLOW \middlebox + \let\FLOWb \bottombox + \let\FLOWbl\bottomleftbox + \let\FLOWbr\bottomrightbox + \let\FLOWt \topbox + \let\FLOWtl\topleftbox + \let\FLOWtr\toprightbox + \let\FLOWl \leftbox + \let\FLOWlt\lefttopbox + \let\FLOWlb\leftbottombox + \let\FLOWr \rightbox + \let\FLOWrt\righttopbox + \let\FLOWrb\rightbottombox + \let\FLOWc \middlebox +%\ifdefined{FLOW#1}% + \ifcase0\getvalue{\@@MPx\FLOWcomment}\getvalue{\@@MPy\FLOWcomment}\relax + \else + \ifdim\getvalue{\@@MPx\FLOWcomment}bp<\areaMPllx\relax\else + \ifdim\getvalue{\@@MPx\FLOWcomment}bp>\areaMPurx\relax\else + \ifdim\getvalue{\@@MPy\FLOWcomment}bp<\areaMPlly\relax\else + \ifdim\getvalue{\@@MPy\FLOWcomment}bp>\areaMPury\relax\else + \dimen0=\getvalue{\@@MPx\FLOWcomment}bp + \advance\dimen0 by -\@@FLOW@@offset + \advance\dimen0 by -\clipMPllx + \dimen2=\clipMPury + \advance\dimen2 by -\@@FLOW@@offset + \advance\dimen2 by -\getvalue{\@@MPy\FLOWcomment}bp + \setbox0=\hbox{\strut#2}% + \boxoffset=.5\bodyfontsize + \setbox0=\hbox + {\hskip\dimen0\lower\dimen2\getvalue{FLOW#1}{\box0}}% + \wd0=\!!zeropoint\ht0=\!!zeropoint\dp0=\!!zeropoint + \box0 + \fi + \fi + \fi + \fi + \fi +%\fi + \egroup + \ignorespaces} + +\def\doprocessFLOWcellD#1,#2\end % kan ook met area + {\!!counta=#1\relax + \!!countb=#2\relax + \!!countc=\@@FLOWx + \!!countd=\@@FLOWy + \advance\!!countc \@@FLOWnx + \advance\!!countd \@@FLOWny + \advance\!!countc -1 + \advance\!!countd -1 + \ifnum\!!counta<\@@FLOWx\relax \donefalse + \else\ifnum\!!counta>\!!countc \donefalse + \else\ifnum\!!countb<\@@FLOWy\relax \donefalse + \else\ifnum\!!countb>\!!countd \donefalse + \else \donetrue + \doglobal\addtocommalist\FLOWcell\FLOWcells + \advance\!!counta by -\@@FLOWx\advance\!!counta by 1 + \advance\!!countb by -\@@FLOWy\advance\!!countb by 1 + \dimen0=\FLOWgridwidth\dimen0=\!!counta\dimen0 + \advance\dimen0 by -\FLOWgridwidth + \dimen4=\FLOWgridwidth\advance\dimen4 by -\FLOWshapewidth + \advance\dimen0 by .5\dimen4 + \dimen2=\FLOWgridheight\dimen2=\!!countb\dimen2 + \dimen4=\FLOWgridheight\advance\dimen4 by -\FLOWshapeheight + \advance\dimen2 by -.5\dimen4 + \setbox0=\hbox + {\ifx\FLOWalign\empty\else + \setupframed + [\c!uitlijnen=\v!normaal,\c!onder=\vfill,\c!boven=\vfill]% + \@EA\processallactionsinset\@EA + [\FLOWalign] + [t=>{\setupframed[\c!onder=\vfill,\c!boven=]}, + b=>{\setupframed[\c!onder=,\c!boven=\vfill]}, + l=>{\setupframed[\c!uitlijnen=\v!rechts]}, + r=>{\setupframed[\c!uitlijnen=\v!links]}, + m=>{\setupframed[\c!uitlijnen=\v!midden]}, + c=>{\setupframed[\c!uitlijnen=\v!midden]}]% + \fi + \doifelse{\FLOWshape}{none} % {\v!geen} + {\setupframed[\c!offset=\v!overlay]} + {\setupframed[\c!offset=.5\bodyfontsize]}% + \framed + [\c!kader=\v!uit,\c!breedte=\FLOWshapewidth,\c!hoogte=\FLOWshapeheight] + {\FLOWtext}}% + \showFLOWhelp0 + \ifx\FLOWdestination\empty\else + \setbox0=\hbox + {\setupinteraction[\c!kleur=,\c!contrastkleur=]% + \naarbox{\box0}[\FLOWdestination]}% + \fi + \edef\FLOWdx{\the\dimen0}% + \edef\FLOWdy{\the\dimen2}% + \def\positionFLOWzero% assumes \FLOWdx and \FLOWdy are set + {\setbox0=\hbox{\hskip\FLOWdx\lower\FLOWdy\box0}% + \smashbox0\box0}% + \def\doFLOWtlabel##1##2##3% + {\scratchdimen=\ifcase##2 \!!zeropoint\else\@@FLOWdy\fi + \setbox0=\hbox{\hskip\dimen2\raise\scratchdimen + \hbox{\raise\dimen4\hbox{##1{\strut##3}}}}% + \positionFLOWzero}% + \def\doFLOWblabel##1##2##3% + {\scratchdimen=\ifcase##2 \!!zeropoint\else\@@FLOWdy\fi + \setbox0=\hbox{\hskip\dimen2\raise-\scratchdimen + \hbox{##1{\strut##3}}}% + \positionFLOWzero}% + \def\doFLOWllabel##1##2##3% + {\scratchdimen=\ifcase##2 \!!zeropoint\else\@@FLOWdx\fi + \setbox0=\hbox{\hskip-\scratchdimen\raise\dimen6 + \hbox{##1{\strut##3}}}% + \positionFLOWzero}% + \def\doFLOWrlabel##1##2##3% + {\scratchdimen=\ifcase##2 \!!zeropoint\else\@@FLOWdx\fi + \setbox0=\hbox{\hskip\dimen0\hskip\scratchdimen + \hbox{\raise\dimen6\hbox{##1{\strut##3}}}}% + \positionFLOWzero}% + \positionFLOWzero + \dimen0=\FLOWshapewidth \dimen2=.5\dimen0 + \dimen4=\FLOWshapeheight\dimen6=.5\dimen4 + \boxoffset=.5\bodyfontsize + \doFLOWtlabel \righttopbox0\tFLOWlabel + \doFLOWblabel\rightbottombox0\bFLOWlabel + \doFLOWllabel \lefttopbox0\lFLOWlabel + \doFLOWrlabel \righttopbox0\rFLOWlabel + \doFLOWtlabel \topbox0\tcFLOWlabel % for me only + \doFLOWblabel \bottombox0\bcFLOWlabel % for me only + \doFLOWllabel \leftbox0\lcFLOWlabel % for me only + \doFLOWrlabel \rightbox0\rcFLOWlabel % for me only + \ifnum#1=\@@FLOWx\relax \doFLOWllabel \leftbox1\lFLOWexit \fi + \ifnum#1=\!!countc \doFLOWrlabel \rightbox1\rFLOWexit \fi + \ifnum#2=\@@FLOWy\relax \doFLOWtlabel \topbox1\tFLOWexit \fi + \ifnum#2=\!!countd \doFLOWblabel \bottombox1\bFLOWexit \fi + \fi\fi\fi\fi} + +% Pass E + +\long\def\startFLOWcellE#1\stopFLOWcell% + {\resetFLOWcell + \ignorespaces#1\unskip + \let\doprocessFLOWcell\doprocessFLOWcellE + \expandafter\doprocessFLOWcell\FLOWlocation\end} + +\def\doprocessFLOWcellE#1,#2\end % redundant + {\ifx\FLOWoverlay\empty \else + \!!counta=#1\relax + \!!countb=#2\relax + \!!countc=\@@FLOWx + \!!countd=\@@FLOWy + \advance\!!countc \@@FLOWnx + \advance\!!countd \@@FLOWny + \advance\!!countc -1 + \advance\!!countd -1 + \ifnum\!!counta<\@@FLOWx\relax + \donefalse + \else\ifnum\!!counta>\!!countc + \donefalse + \else\ifnum\!!countb<\@@FLOWy\relax + \donefalse + \else\ifnum\!!countb>\!!countd + \donefalse + \else + \donetrue + \fi\fi\fi\fi + \ifdone + \advance\!!counta by -\@@FLOWx\advance\!!counta by 1 + \advance\!!countb by -\@@FLOWy\advance\!!countb by 1 + \dimen0=\FLOWgridwidth\dimen0=\!!counta\dimen0 + \advance\dimen0 by -\FLOWgridwidth + \dimen4=\FLOWgridwidth\advance\dimen4 by -\FLOWshapewidth + \advance\dimen0 by .5\dimen4 + \dimen2=\FLOWgridheight\dimen2=\!!countb\dimen2 + \dimen4=\FLOWgridheight\advance\dimen4 by -\FLOWshapeheight + \advance\dimen2 by -.5\dimen4 + \edef\FLOWdx{\the\dimen0}% + \edef\FLOWdy{\the\dimen2}% + \setbox0=\hbox + {\framed + [\c!kader=\v!uit, + \c!achtergrond={\@@FLOWachtergrond,\FLOWoverlay}, + \c!achtergrondkleur=\@@FLOSachtergrondkleur, + \c!breedte=\FLOWshapewidth,\c!hoogte=\FLOWshapeheight] + {}}% + \setbox0=\hbox{\hskip\FLOWdx\lower\FLOWdy\box0}% + \smashbox0 + \box0 + \fi + \fi} + +% Pass F + +\def\checkFLOWautofocus% + {\def\@@FLOWminx{100}\let\@@FLOWminy\@@FLOWminx + \def\@@FLOWmaxx {0}\let\@@FLOWmaxy\@@FLOWmaxx + \def\@@FLOWabsx {0}\let\@@FLOWabsy\@@FLOWabsx + \let\startFLOWcell\startFLOWcellF + \haalbuffer[\FLOWbufferprefix\currentFLOWnumber]% + %\message{AUTOSHAPE 1: (\@@FLOWminx,\@@FLOWminy)->(\@@FLOWmaxx,\@@FLOWmaxy)}% + \ifnum\@@FLOWabsx<\@@FLOWmaxx\let\@@FLOWmaxx\@@FLOWabsx\fi + \ifnum\@@FLOWabsy<\@@FLOWmaxy\let\@@FLOWmaxy\@@FLOWabsy\fi + %\message{AUTOSHAPE 2: (\@@FLOWminx,\@@FLOWminy)->(\@@FLOWmaxx,\@@FLOWmaxy)}% + \donetrue + \ifnum\@@FLOWminx=100 \donefalse\fi + \ifnum\@@FLOWminy=100 \donefalse\fi + \ifnum\@@FLOWmaxx=0 \donefalse\fi + \ifnum\@@FLOWmaxy=0 \donefalse\fi + \doFLOWcheckF\@@FLOWx\@@FLOWminx\@@FLOWmaxx\@@FLOWnx + \doFLOWcheckF\@@FLOWy\@@FLOWminy\@@FLOWmaxy\@@FLOWny} + +\def\startFLOWcellF#1\stopFLOWcell% + {\resetFLOWcell + \ignorespaces#1\unskip + \expandafter\doFLOWlocationF\FLOWlocation\end}% + +\def\doFLOWlocationF#1,#2\end% + {\ifnum#1>\@@FLOWabsx\def\@@FLOWabsx{#1}\fi + \ifnum#2>\@@FLOWabsy\def\@@FLOWabsy{#2}\fi + \ExpandBothAfter\doifinset{\FLOWcell}{\@@FLOWautofocus} + {\dodoFLOWlocationF{#1}<-\@@FLOWminx + \dodoFLOWlocationF{#1}>+\@@FLOWmaxx + \dodoFLOWlocationF{#2}<-\@@FLOWminy + \dodoFLOWlocationF{#2}>+\@@FLOWmaxy}} + +\def\dodoFLOWlocationF#1#2#3#4% + {\ifnum#1#2#4\relax + \!!counta=#1\advance\!!counta by #31\relax + \edef#4{\ifnum\!!counta<1 1\else\the\!!counta\fi}% + \fi} + +\def\doFLOWcheckF#1#2#3#4% + {\ifdone + \let#1=#2% + \!!counta=#3% + \advance\!!counta 1\advance\!!counta -#2\relax + \ifnum\!!counta<1 \!!counta=1 \fi + \edef#4{\the\!!counta}% + \else + \def#1{1}\def#4{0}% no {1} + \fi} + % \useFLOWchart[name][parent][setting,setting][additional settings] % \useFLOWchart[name][parent][additional settings] +\let\currentFLOWchart\empty + \def\useFLOWchart {\doquadrupleempty\douseFLOWchart} \def\douseFLOWchart[#1][#2][#3][#4]% name parent sets mainsettings {\iffourthargument - \setvalue{FLOW--#1}[##1]{\setgetFLOWchart[#2][#3][#4,##1]}% + \setvalue{\@FLOW@--#1}[##1]{\setgetFLOWchart[#2][#3][#4,##1]}% \else \checkparameters[#3]% \ifparameters - \setvalue{FLOW--#1}[##1]{\setgetFLOWchart[#2][][#3,##1]}% + \setvalue{\@FLOW@--#1}[##1]{\setgetFLOWchart[#2][][#3,##1]}% \else - \setvalue{FLOW--#1}[##1]{\setgetFLOWchart[#2][#3][##1]}% + \setvalue{\@FLOW@--#1}[##1]{\setgetFLOWchart[#2][#3][##1]}% \fi \fi} \def\setgetFLOWchart[#1][#2][#3]% - {\def\docommando##1% - {}% cell line focus + {\def\docommando##1{}% cell line focus ? \processcommalist[#2]\docommando \getFLOWchart[#1][#3]} \def\doFLOWchart[#1][#2]% {\hbox\bgroup\vbox\bgroup % vmode suppresses spaces - \doifundefinedelse{FLOW--#1} +\def\currentFLOWchart{#1}% + \doifundefinedelse{\@FLOW@--#1} {\getFLOWchart[#1][#2]} - {\getvalue{FLOW--#1}[#2]}% + {\getvalue{\@FLOW@--#1}[#2]}% \egroup\egroup} \def\FLOWchart% {\dodoubleempty\doFLOWchart} -%D A hook into the help system. +%D A hook into the help system. \def\showFLOWhelp#1% {\doifhelpinfo{\FLOWhelp} @@ -842,7 +986,7 @@ {\forgetall\offinterlineskip\box#1\box\scratchbox}% \box#1}}} -%D The next section is dedicated to splitting up charts. +%D The next section is dedicated to splitting up charts. \def\getFLOWsize[#1]% {\bgroup\let\dodogetFLOWchart\dogetFLOWsize\FLOWchart[#1]\egroup} @@ -854,14 +998,15 @@ \def\getFLOWlocation##1,##2\end% {\ifnum0##1>\FLOWmaxwidth \xdef\FLOWmaxwidth {##1}\fi \ifnum0##2>\FLOWmaxheight\xdef\FLOWmaxheight{##2}\fi}% + \resetFLOWcell \long\def\startFLOWcell##1\stopFLOWcell% - {\resetFLOWcell##1\expandafter\getFLOWlocation\FLOWlocation\end}% + {{##1\expandafter\getFLOWlocation\FLOWlocation\end}}% \def\dosetFLOWchart[##1][##2]% - {\haalbuffer[flw-##1]}% - \getvalue{FLOW-#1}}} + {\haalbuffer[\FLOWbufferprefix##1]}% + \getvalue{\@FLOW@-#1}}} \def\setupFLOWsplit% - {\dodoubleargument\getparameters[@@FLOT]} + {\dodoubleargument\getparameters[\@@FLOT]} \setupFLOWsplit% [\c!nx=3,\c!ny=3, @@ -870,68 +1015,181 @@ \c!markering=\v!aan, \c!voor=,\c!na=] +\def\FLOWsplitx {1} +\def\FLOWsplity {1} +\def\FLOWsplitnx{1} +\def\FLOWsplitny{1} + \def\FLOWcharts% {\dodoubleempty\doFLOWcharts} +%D While splitting, the following variables are available: +%D +%D \starttypen +%D \FLOWsplitnx \FLOWsplitny \FLOWsplitx \FLOWsplity +%D \stoptypen + \def\doFLOWcharts[#1][#2]% {\bgroup \getFLOWsize[#1]% - \def\@@FLOTx{1}% - \doloop - {\def\@@FLOTy{1}% - \doloop + \dodoFLOWcharts\relax + \global\let\FLOWsplitnx\FLOWsplitx + \global\let\FLOWsplitny\FLOWsplity + \dodoFLOWcharts{\dododoFLOWcharts[#1][#2]}% + \egroup} + +\def\dodoFLOWcharts#1% + {\def\@@FLOTx{1}% + \global\let\FLOWsplitx\@@FLOTx + \doloop + {\def\@@FLOTy{1}% + \global\let\FLOWsplity\@@FLOTy + \doloop {\bgroup - \scratchcounter=\FLOWmaxwidth + \scratchcounter=\FLOWmaxwidth \advance\scratchcounter by -\@@FLOTx \advance\scratchcounter by 1 \ifnum\scratchcounter<\@@FLOTnx\edef\@@FLOTnx{\the\scratchcounter}\fi - \scratchcounter=\FLOWmaxheight + \scratchcounter=\FLOWmaxheight \advance\scratchcounter by -\@@FLOTy \advance\scratchcounter by 1 \ifnum\scratchcounter<\@@FLOTny\edef\@@FLOTny{\the\scratchcounter}\fi - \doifnot{\@@FLOTmarkering}{\v!aan}{\let\cuthbox\relax}% - \@@FLOTvoor - \cuthbox - {\@@FLOTcommando - {\FLOWchart[#1][#2, - \c!x=\@@FLOTx,\c!nx=\@@FLOTnx, - \c!y=\@@FLOTy,\c!ny=\@@FLOTny]}}% - \@@FLOTna + #1% does something with the float, or not \egroup \increment(\@@FLOTy,\@@FLOTny)% \ifnum\@@FLOTy>\FLOWmaxheight \exitloop - \else + \else + \doglobal\increment\FLOWsplity \decrement(\@@FLOTy,\@@FLOTdy)% \fi}% \increment(\@@FLOTx,\@@FLOTnx)% - \ifnum\@@FLOTx>\FLOWmaxwidth + \ifnum\@@FLOTx>\FLOWmaxwidth \exitloop - \else + \else + \doglobal\increment\FLOWsplitx \decrement(\@@FLOTx,\@@FLOTdx)% - \fi}% + \fi}} + +\def\dododoFLOWcharts[#1][#2]% + {\bgroup + \@@FLOTvoor + \doifnot{\@@FLOTmarkering}{\v!aan}{\let\cuthbox\hbox}% + \cuthbox + {\@@FLOTcommando + {\FLOWchart[#1][#2, + \c!x=\@@FLOTx,\c!nx=\@@FLOTnx, + \c!y=\@@FLOTy,\c!ny=\@@FLOTny]}}% + \@@FLOTna \egroup} -%D An example of splitting is given below: -%D -%D \starttypen +%D An example of splitting is given below: +%D +%D \starttypen %D \setupFLOWsplit %D [nx=5,ny=10, %D dx=0,dy=0, %D before=, %D after=\pagina] -%D +%D %D \FLOWcharts[mybigflow] -%D \stoptypen +%D \stoptypen %D -%D Or, one can say: +%D Or, one can say: %D -%D \starttypen +%D \starttypen %D \splitsplaatsblok %D {\plaatsfiguur{What a big flowchart this is!}} %D {\FLOWcharts[mybigflow]} +%D \stoptypen + +%D \macros +%D {typeFLOWchart} +%D +%D For documentation purposes the following macro is +%D provided. Watch the use of the first and last line hooks, +%D which is needed because the start and stop commands are +%D not part of the buffer. + +\def\typeFLOWchart[#1]% + {\bgroup + \def\dosetFLOWchart[##1][##2]{\typebuffer[\FLOWbufferprefix##1]}% + \convertargument\startFLOWchart[#1]\to\firstverbatimfileline + \convertargument \stopFLOWchart\to\lastverbatimfileline + \getvalue{\@FLOW@-#1} + \egroup} + +%D New: +%D +%D \starttypen +%D \setupFLOWcharts[command=\Whow] +%D +%D \startFLOWset[convert-en] % [tag][convert-en] +%D \subFLOWchart[a][x=1,y=1,nx=3,ny=3] +%D \subFLOWchart[b][x=1,y=2,nx=3,ny=3] +%D \subFLOWchart[c][x=2,y=1,nx=3,ny=3] +%D \stopFLOWset +%D +%D \def\Whow#1% +%D {\ifnum\currentFLOWset=1 \framed{Some Chart}\fi} +%D +%D \handleFLOWset[convert-en] % [tag] +%D +%D \def\Whow#1% +%D {\stelhoofdin[status=hoog] +%D \startstandardmakeup +%D \centerbox{#1} +%D \stopstandardmakeup} +%D +%D \handleFLOWset[convert-en] % [tag] %D \stoptypen +\def\startFLOWset% + {\dodoubleempty\dostartFLOWset} + +\def\dostartFLOWset[#1][#2]#3\stopFLOWset% tag name data + {\ifsecondargument + \long\setvalue{\@FLOX@#1}{\dohandleFLOWset{#1}{#2}{#3}}% + \else + \long\setvalue{\@FLOX@#1}{\dohandleFLOWset{#1}{#1}{#3}}% + \fi} + +\long\def\dohandleFLOWset#1#2#3% tag name data + {\bgroup + \def\subFLOWchart% + {\dodoubleempty\dosubFLOWchart}% + \def\dosubFLOWchart[##1][##2]% subtag settings + {\ifsecondargument + \dodohandleFLOWset{#1}{##1}{#2}{##2}% + \else + \subFLOWchart[][##1]% + \fi}% + #3% + \egroup} + +\def\dodohandleFLOWset#1#2#3#4% tag subtag name settings + {\increment\currentFLOWset + \bgroup + \@@FLOXcommando + {\ifnum\currentFLOWset=1 \pagereference[#1]\fi + \doifsomething{#2} + {\setupreferencing[\c!prefix=]% + \pagereference[#1:#2]% -:#1:#2 + \setupreferencing[\c!prefix=#1:#2]}% + \FLOWchart[#3][#4]}% + \egroup} + +\def\FLOWset[#1]% + {\newcounter\currentFLOWset + \doifdefinedelse{\@FLOX@#1} + {\getvalue{\@FLOX@#1}} + {\dodohandleFLOWset{#1}{}{#1}{}}} + +\newcounter\currentFLOWset + +\setupFLOWsets + [\c!commando=] + \protect \endinput diff --git a/tex/context/base/m-cweb.tex b/tex/context/base/m-cweb.tex new file mode 100644 index 000000000..57b1ab8b9 --- /dev/null +++ b/tex/context/base/m-cweb.tex @@ -0,0 +1,1371 @@ +%D \module +%D [ file=m-cweb, +%D version=1997.01.15, +%D title=\CONTEXT\ Extra Modules, +%D subtitle=\CWEB\ Pretty Printing Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D First some auxiliary stuff, to be moved to system module. + +\def\dodofindfirstcharacter#1% + {\ifx#1\relax + \let\next=\egroup + \else + \handlecase + {\expandafter\ifnum\expandafter\catcode\expandafter`#1=11 + \def\next##1\relax{\egroup\def\firstcharacter{#1}}% + \fi}% + \fi + \next} + +\def\dofindfirstcharacter#1#2% + {\def\firstcharacter{}% + \bgroup + \convertargument#2\to\ascii + \let\next=\dodofindfirstcharacter + \let\handlecase=#1 + \expandafter\next\ascii\relax} + +\def\normalcase#1% + {#1} + +\def\findfirstcharacter% + {\dofindfirstcharacter\lowercase} + +\def\FindFirstCharacter% + {\dofindfirstcharacter\normalcase} + +\def\FINDFIRSTCHARACTER% + {\dofindfirstcharacter\uppercase} + +% nog doen: +% +% \deactivateCWEB in output routine +% status info +% gelinkte entries +% parskip en parindent + +%D \gdef\CWEBquote#1.{{\em Quote :}\ #1.} % checks the . + +%D This module (re)implements the \CWEB\ macros as defined in +%D the file \type{cwebmac.tex}. +%D +%D \CWEB\ uses short, often one character long, names for +%D macros. This is no real problem because no one is supposed +%D to read and understand the files generated by \CWEB. The +%D standard macros are meant for \PLAIN\ \TEX\ users. In +%D \CONTEXT\ and other macro packages however, there is a +%D potential conflict with format specific or user defined +%D commands. Furthermore, the \CWEB\ macros implement their own +%D output routines. When integrating \CWEB\ documents in +%D another environment, the \CWEB\ specific macros have to be +%D made local. The first part of this module is dedicated to +%D this feature. +%D +%D Instead of using \type{\def} and \type{\let} for defining +%D macros, we use: +%D +%D \starttypen +%D \defCEBmacro arguments {meaning} +%D \letCEBmacro arguments {meaning} +%D \stoptypen +%D +%D \CWEB files contain implicit calls to macros that generate +%D the table of contents, the lists of sections and the index. +%D Because we want to be much more flexible, we implemented our +%D own alternatives, and therefore have to bypass the original +%D ones. The next macro is used for defining these obsolete +%D \CWEB\ macros. The dummies take care of arguments. +%D +%D \starttypen +%D \defCEBdummy arguments {meaning} +%D \stoptypen +%D +%D The list of \CWEB\ specific macro names is saved in a +%D \TOKENLIST. This serves two purposes. First it enables us to +%D activate the \CWEB\ macros, which are saved under a +%D different name, second it can be used to temporary restore +%D the meanings, for instance when the output routine builds +%D the page. + +\newtoks\CWEBmacros + +%D Activating and deactivating is done by means of: +%D +%D \starttypen +%D \activateCWEB +%D \deactivateCWEB +%D \stoptypen +%D +%D Which are implemented as: + +\def\activateCWEB% + {\let\doCWEB=\activateCWEBmacro + \the\CWEBmacros} + +\def\deactivateCWEB% + {\let\doCWEB=\deactivateCWEBmacro + \the\CWEBmacros} + +%D The three definition macros append the name of the macro to +%D the list. The first two macros save the meaning, the last one +%D assigns \type{{}} to the macro and gobbles original meaning. + +\long\def\defCWEBmacro#1% + {\appendtoks\doCWEB#1\to\CWEBmacros + \setvalue{newCWEB\string#1}} + +\long\def\letCWEBmacro#1% + {\appendtoks\doCWEB#1\to\CWEBmacros + \letvalue{newCWEB\string#1}} + +\long\def\defCWEBdummy#1#2#% + {\appendtoks\doCWEB#1\to\CWEBmacros + \setvalue{newCWEB\string#1}#2{}% + \gobbleoneargument} + +%D The macro \type{\defCWEBdummy} of course takes care of the +%D argument. This leaves the two (de|)|activating macros: + +\def\CWEBmacro#1% + {\getvalue{newCWEB\string#1}} + +\def\activateCWEBmacro#1% + {\letvalue{oldCWEB\string#1}=#1% + \def#1{\CWEBmacro#1}} + +\def\deactivateCWEBmacro#1% + {\expandafter\let\expandafter#1\expandafter=\csname oldCWEB\string#1\endcsname} + +%D I did consider loading the \CWEB\ macros using temporary +%D substitutes of \type{\def}, \type{\font}, \type{\newbox} etc. +%D The main problem is that the file contains more than +%D definitions and taking all kind of assignments into account +%D too would not make things easier. So I decided to stick to +%D the method as just described. + +%D Now we're ready for the real job. What follows is a partial +%D adaption of the file \type{cwebmac.tex}, version 3.1, dated +%D September 1994 and written by Levy and Knuth. When possible +%D we kept the original meaning, but we've granted ourselves +%D the freedom to reformat the macro's for readibility. +%D +%D We'll only present the macros we actually use. The source +%D however contains the original implementation. + +% standard macros for CWEB listings (in addition to plain.tex) +% Version 3.1 --- September 1994. +% +% \ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros +% +% \xdef\fmtversion{\fmtversion+CWEB3.1} + +%D \macros{.}{} +%D +%D \CWEBquote preserve a way to get the dot accent (all +%D other accents will still work as usual). + +\letCWEBmacro\: = \. + +% \parskip = 0pt % no stretch between paragraphs +% \parindent = 1em % for paragraphs and for the first line of C text + +% \font\ninerm = cmr9 +% \let\mc = \ninerm % medium caps +% \font\eightrm = cmr8 +% \let\sc = \eightrm % small caps (NOT a caps-and-small-caps font) +% \let\mainfont = \tenrm +% \let\cmntfont = \tenrm +% \font\tenss = cmss10 +% \let\cmntfont = \tenss % alternative comment font +% \font\titlefont = cmr7 scaled \magstep4 % title on the contents page +% \font\ttitlefont = cmtt10 scaled \magstep2 % typewriter type in title +% \font\tentex = cmtex10 % TeX extended character set (used in strings) +% \fontdimen7\tentex = 0pt % no double space after sentences + +%D \macros{mc,sc,cmntfont,eightrm}{} +%D +%D The naming of the fonts in in line with those in \PLAIN\ +%D \TEX. Although \CONTEXT\ implements its own scheme, there is +%D still support for the \PLAIN\ ones. We keep the original +%D names, but change their meaning. That way the macros obey +%D switching to other sizes or styles. + +\defCWEBmacro\mc {\tx} +\defCWEBmacro\sc {\txx} +\defCWEBmacro\cmntfont {\ss} +\defCWEBmacro\eightrm {\tx} + +%D \macros{tentex,sevenrm,sevensy,teni}{} +%D +%D The next one uses a temporary solution. The \type{cmtex10} +%D font is not part of the default mechanism. We make use of +%D the \CONTEXT\ variables \type{\textface}, \type{\scriptface} +%D and \type{\scriptscriptface}, which hold the current +%D sizes. + +\defCWEBmacro\tentex% + {\font\next=cmtex10 at \textface + \fontdimen7\next=0pt + \next} + +\defCWEBmacro\sevenrm {\getvalue{\scriptface rmtf}} +\defCWEBmacro\sevensy {\getvalue{\scriptface mmsy}} +\defCWEBmacro\teni {\getvalue{\textface mmmi}} + +%D \macros{CWEBpt}{} +%D +%D The original macros are based on a 10~point bodyfont size. We +%D therefore have to specify dimension in points a bit +%D different. Specifications like .6pt are changed to +%D \type{.06} times \type{\korpsgrootte}. + +\defCWEBmacro\CWEBpt {\korpsgrootte} % still dutch + +%D \macros{CEE,UNIX,TEX,CPLUSPLUS}{} +%D +%D Next come some logo's. It does not make much sense to use +%D the \CONTEXT\ logo mechanism here, so we simply say: + +\defCWEBmacro \CEE/{{\mc C\spacefactor1000}} +\defCWEBmacro \UNIX/{{\mc U\kern-.05emNIX\spacefactor1000}} +\defCWEBmacro \TEX/{\TeX} +\defCWEBmacro\CPLUSPLUS/{{\mc C\PP\spacefactor1000}} +\defCWEBmacro \Cee{\CEE/} % for backward compatibility + +%D \macros{\ }{} +%D +%D Now we come to the real work: the short commands that make +%D up the typography. +%D +%D \CWEBquote italic type for identifiers. + +\defCWEBmacro\\#1% + {\leavevmode\hbox{\it#1\/\kern.05em}} + +%D \macros{\string|}{} +%D +%D \CWEBquote one letter identifiers look better this way. + +\defCWEBmacro\|#1% + {\leavevmode\hbox{$#1$}} + +%D \macros{\string&}{} +%D +%D \CWEBquote boldface type for reserved words. + +\defCWEBmacro\% + {\leavevmode + \hbox + {\def\_% + {\kern.04em + \vbox{\hrule width.3em height .06\CWEBpt}% .6pt}% + \kern.08em}% + \bf#1\/\kern.05em}} + +%D \macros{.}{} +%D +%D Here we use the previously saved period. This macro +%D takes care of special characters in strings. + +\defCWEBmacro\.#1% + {\leavevmode + \hbox + {\tentex % typewriter type for strings + \let\\=\BS % backslash in a string + \let\{=\LB % left brace in a string + \let\}=\RB % right brace in a string + \let\~=\TL % tilde in a string + \let\ =\SP % space in a string + \let\_=\UL % underline in a string + \let\&=\AM % ampersand in a string + \let\^=\CF % circumflex in a string + #1\kern.05em}} + +%D \macros{)}{} +%D +%D Some discretionary hack. + +\defCWEBmacro\)% + {\discretionary{\hbox{\tentex\BS}}{}{}} + +%D \macros{AT}{} +%D +%D \CWEBquote at sign for control text (not needed in versions +%D $>=$ 2.9). + +\defCWEBmacro\AT{@} + +%D \macros{ATL,postATL,NOATL}{} +%D +%D A two step macro that handles whatever. + +\defCWEBmacro\ATL% + {\par + \noindent + \bgroup + \catcode`\_=12 + \postATL} + +\defCWEBmacro\postATL#1 #2 % + {\bf letter \\{\uppercase{\char"#1}} tangles as \tentex "#2"% + \egroup + \par} + +\defCWEBmacro\noATL#1 #2 % + {} + +%D \macros{noatl}{} +%D +%D \CWEBquote suppress output from \type{@l}. + +\defCWEBmacro\noatl% + {\let\ATL=\noATL} + +% \defCWEBmacro\ATH% +% {\X\kern-.5em:Preprocessor definitions\X} + +%D \macros{PB} +%D +%D \CWEBquote hook for program brackets {\tttf\string|...\string|} +%D in TeX part or section name. + +\defCWEBmacro\PB% + {\relax} + +% \chardef\AM = `\& % ampersand character in a string +% \chardef\BS = `\\ % backslash in a string +% \chardef\LB = `\{ % left brace in a string +% \chardef\RB = `\} % right brace in a string +% \chardef\TL = `\~ % tilde in a string +% \chardef\UL = `\_ % underline character in a string +% \chardef\CF = `\^ % circumflex character in a string + +\defCWEBmacro\AM {\char`\&} % ampersand character in a string +\defCWEBmacro\BS {\char`\\} % backslash in a string +\defCWEBmacro\LB {\char`\{} % left brace in a string +\defCWEBmacro\RB {\char`\}} % right brace in a string +\defCWEBmacro\TL {\char`\~} % tilde in a string +\defCWEBmacro\UL {\char`\_} % underline character in a string +\defCWEBmacro\CF {\char`\^} % circumflex character in a string + +\defCWEBmacro\SP {{\tt\char`\ }} % (visible) space in a string + +% \newbox\PPbox \setbox\PPbox=\hbox +% {\kern.5pt\raise1pt\hbox{\sevenrm+\kern-1pt+}\kern.5pt} +% \newbox\MMbox \setbox\MMbox=\hbox +% {\kern.5pt\raise1pt\hbox{\sevensy\char0\kern-1pt\char0}\kern.5pt} +% \newbox\MGbox \setbox\MGbox=\hbox % symbol for -> +% {\kern-2pt\lower3pt\hbox{\teni\char'176}\kern1pt} +% \newbox\MODbox \setbox\MODbox=\hbox +% {\eightrm\%} +% +% \def\PP {\copy\PPbox} +% \def\MM {\copy\MMbox} +% \def\MG {\copy\MGbox} +% \def\MOD {\mathbin{\copy\MODbox}} + +\defCWEBmacro\PP% symbol for ++ + {\kern.05\CWEBpt + \raise.1\CWEBpt\hbox{\sevenrm+\kern-.1\CWEBpt+}% + \kern.05\CWEBpt} + +\defCWEBmacro\MM% + {\kern.05\CWEBpt + \raise.1\CWEBpt\hbox{\sevensy\char0\kern-.1\CWEBpt\char0}% + \kern.05\CWEBpt} + +\defCWEBmacro\MG% + {\kern-.2\CWEBpt + \lower.3\CWEBpt\hbox{\teni\char'176}% + \kern .1\CWEBpt} + +\defCWEBmacro\MRL#1% + {\mathrel{\let\K==#1}} + +% \def\MRL#1% +% {\KK#1} +% \def\KK#1#2% +% {\buildrel\;#1\over{#2}} + +\letCWEBmacro\GG = \gg +\letCWEBmacro\LL = \ll +\letCWEBmacro\NULL = \Lambda + +% \mathchardef\AND = "2026 % bitwise and; also \& (unary operator) + +\defCWEBmacro\AND% redefines itself (funny) + {\mathchardef\AND="2026 \AND} % bitwise and; also \& (unary operator) + +\letCWEBmacro\OR = \mid % bitwise or +\letCWEBmacro\XOR = \oplus % bitwise exclusive or +\defCWEBmacro\CM {{\sim}} % bitwise complement +\defCWEBmacro\MOD {\mathbin{\eightrm\%}} +\defCWEBmacro\DC {\kern.1em{::}\kern.1em} % symbol for :: +\defCWEBmacro\PA {\mathbin{.*}} % symbol for .* +\defCWEBmacro\MGA {\mathbin{\MG*}} % symbol for ->* +\defCWEBmacro\this {\&{this}} + +% \newbox \bak % backspace one em +% \newbox \bakk % backspace two ems +% +% \setbox\bak =\hbox to -1em{} +% \setbox\bakk=\hbox to -2em{} + +\newcount\CWEBind % current indentation in ems + +\defCWEBmacro\1% indent one more notch + {\global\advance\CWEBind by 1 + \hangindent\CWEBind em} + +\defCWEBmacro\2% indent one less notch + {\global\advance\CWEBind by -1 } + +\defCWEBmacro\3#1% optional break within a statement + {\hfil + \penalty#10 + \hfilneg} + +\defCWEBmacro\4% backspace one notch + {\hbox to -1em{}} + +\defCWEBmacro\5% optional break + {\hfil + \penalty-1 + \hfilneg + \kern2.5em + \hbox to -2em{}% + \ignorespaces} + +\defCWEBmacro\6% forced break + {\ifmmode + \else + \par + \hangindent\CWEBind em + \noindent + \kern\CWEBind em + \hbox to -2em{}% + \ignorespaces + \fi} + +\defCWEBmacro\7% forced break and a little extra space + {\Y + \6} + +\defCWEBmacro\8% no indentation + {\hskip-\CWEBind em + \hskip 2em} + +\defCWEBmacro\9#1% + {} + +\newcount\gdepth % depth of current major group, plus one +\newcount\secpagedepth +\secpagedepth=3 % page breaks will occur for depths -1, 0, and 1 + +% \newtoks\gtitle % title of current major group +% \newskip\intersecskip +% \intersecskip=12pt minus 3pt % space between sections + +% \let\yskip=\smallskip + +\defCWEBmacro\?% + {\mathrel?} + +% \def\note#1#2.% +% {\Y\noindent +% {\hangindent2em\baselineskip10pt\eightrm#1~#2.\par}} + +\defCWEBmacro\lapstar% + {\rlap{*}} + +% \def\stsec% +% {\rightskip=0pt % get out of C mode (cf. \B) +% \sfcode`;=1500 +% \pretolerance 200 +% \hyphenpenalty 50 +% \exhyphenpenalty 50 +% \noindent{\let\*=\lapstar\bf\secstar.\quad}} +% +% \let\startsection=\stsec + +\defCWEBmacro\defin#1% + {\global\advance\CWEBind by 2 \1\&{#1 } } % begin `define' or `format' + +% \def\A% xref for doubly defined section name +% {\note{See also section}} +% +% \def\As% xref for multiply defined section name +% {\note{See also sections}} + +\defCWEBmacro\B% + {\rightskip=0pt plus 100pt minus 10pt % go into C mode + \sfcode`;=3000 + \pretolerance 10000 + \hyphenpenalty 1000 % so strings can be broken (discretionary \ is inserted) + \exhyphenpenalty 10000 + \global\CWEBind=2 \1\ \unskip} + +\defCWEBmacro\C#1% + {\5\5\quad$/\ast\,${\cmntfont #1}$\,\ast/$} + +% \let\SHC\C % "// short comments" treated like "/* ordinary comments */" + +\defCWEBmacro\SHC#1% + {\5\5\quad$//\,${\cmntfont#1}} + +% \def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$} +% \def\SHC#1{\5\5\quad$\diamond\,${\cmntfont#1}} + +\defCWEBmacro\D% macro definition + {\defin{\#define}} + +\letCWEBmacro\E=\equiv % equivalence sign + +% \def\ET% conjunction between two section numbers +% { and~} +% +% \def\ETs% conjunction between the last two of several section numbers +% {, and~} + +\defCWEBmacro\F% format definition + {\defin{format}} + +\letCWEBmacro\G = \ge % greater than or equal sign + +% \H is long Hungarian umlaut accent + +\letCWEBmacro\I = \ne % unequal sign + +\defCWEBmacro\J% TANGLE's join operation + {\.{@\&}} + +% \let\K== % assignment operator + +\letCWEBmacro\K = \leftarrow % "honest" alternative to standard assignment operator + +% \L is Polish letter suppressed-L + +% \outer\def\M#1% +% {\MN{#1}% +% \ifon +% \vfil +% \penalty-100 +% \vfilneg % beginning of section +% \vskip\intersecskip +% \startsection +% \ignorespaces} +% +% \outer\def\N#1#2#3.% +% {\gdepth=#1% +% \gtitle={#3}% +% \MN{#2}% beginning of starred section +% \ifon +% \ifnum#1<\secpagedepth +% \vfil +% \eject % force page break if depth is small +% \else +% \vfil +% \penalty-100 +% \vfilneg +% \vskip\intersecskip +% \fi +% \fi +% \message{*\secno}% progress report +% \edef\next% +% {\write\cont % write to contents file +% {\ZZ{#3}{#1}{\secno}{\noexpand\the\pageno}}}% +% \next % \ZZ{title}{depth}{sec}{page} +% \ifon +% \startsection +% {\bf#3.\quad}% +% \ignorespaces} +% +% \def\MN#1% +% {\par % common code for \M, \N +% {\xdef\secstar{#1}% +% \let\*=\empty +% \xdef\secno{#1}}% remove \* from section name +% \ifx\secno\secstar +% \onmaybe +% \else +% \ontrue +% \fi +% \mark{{{\tensy x}\secno}{\the\gdepth}{\the\gtitle}}} +% +% each \mark is {section reference or null}{depth plus 1}{group title} + +% \O is Scandinavian letter O-with-slash +% \P is paragraph sign + +\defCWEBmacro\Q {\note{This code is cited in section}} % xref for mention of a section +\defCWEBmacro\Qs {\note{This code is cited in sections}} % xref for mentions of a section + +% \S is section sign + +\defCWEBmacro\T#1% + {\leavevmode % octal, hex or decimal constant + \hbox + {$\def\?{\kern.2em}% + \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant + \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick) + \let\~=\oct + \let\^=\hex + {#1}$}} + +\defCWEBmacro\U {\note{This code is used in section}} % xref for use of a section +\defCWEBmacro\Us {\note{This code is used in sections}} % xref for uses of a section + +\letCWEBmacro\R = \lnot % logical not +\letCWEBmacro\V = \lor % logical or +\letCWEBmacro\W = \land % logical and + +% defined later on +% +% \def\X#1:#2\X% +% {\ifmmode +% \gdef\XX{\null$\null}% +% \else +% \gdef\XX{}% +% \fi % section name +% \XX$\langle\,${#2\eightrm\kern.5em#1}$\,\rangle$\XX} + +\unprotect + +\def\theCWEByskip {\blanko[\v!klein]} +\def\theCWEBvskip {\blanko[\v!groot]} + +\protect + +\defCWEBmacro\Y% + {\par + \yskip} + +\defCWEBmacro\yskip% + {\theCWEByskip} + +\letCWEBmacro\Z = \le +% \letCWEBmacro\ZZ = \let % now you can \write the control sequence \ZZ +\letCWEBmacro\* = * + +\defCWEBmacro\oct% + {\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} + +\defCWEBmacro\hex% + {\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} + +\defCWEBmacro\vb#1% + {\leavevmode + \hbox + {\kern.2\CWEBpt + \vrule + \vtop + {\vbox + {\hrule + \hbox{\strut\kern.2\CWEBpt\.{#1}\kern.2\CWEBpt}} + \hrule}% + \vrule + \kern.2\CWEBpt}} % verbatim string + +\def\onmaybe% + {\let\ifon=\maybe} + +\let\maybe=\iftrue + +\newif\ifon + +% \newif\iftitle +% \newif\ifpagesaved +% +% \def\lheader% +% {\mainfont +% \the\pageno +% \eightrm +% \qquad +% \grouptitle +% \hfill +% \title +% \qquad +% \mainfont +% \topsecno} % top line on left-hand pages +% +% \def\rheader% +% {\mainfont +% \topsecno +% \eightrm +% \qquad +% \title +% \hfill +% \grouptitle +% \qquad +% \mainfont +% \the\pageno} % top line on right-hand pages +% +% \def\grouptitle +% {\let\i=I +% \let\j=J +% \uppercase\expandafter{\expandafter\takethree\topmark}} +% +% \def\topsecno% +% {\expandafter\takeone\topmark} +% +% \def\takeone #1#2#3{#1} +% \def\taketwo #1#2#3{#2} +% \def\takethree #1#2#3{#3} +% +% \def\nullsec% +% {\eightrm +% \kern-2em} % the \kern-2em cancels \qquad in headers +% +% \let\page=\pagebody % \def\page {\box255 } +% \raggedbottom % \normalbottom % faster, but loses plain TeX footnotes +% +% \def\normaloutput#1#2#3% +% {\shipout\vbox +% {\ifodd +% \pageno +% \hoffset=\pageshift +% \fi +% \vbox to \fullpageheight +% {\iftitle +% \global\titlefalse +% \else +% \hbox to \pagewidth +% {\vbox to 10pt{}% +% \ifodd\pageno #3\else#2\fi} +% \fi +% \vfill#1}} % parameter #1 is the page itself +% \global\advance\pageno by 1} +% +% \gtitle={\.{CWEB} output} % this running head is reset by starred sections +% +% \mark{\noexpand\nullsec0{\the\gtitle}} +% +% \def\title% +% {\expandafter\uppercase\expandafter{\jobname}} +% +% \def\topofcontents% +% {\centerline{\titlefont\title} +% \vskip.7in +% \vfill} % this material will start the table of contents page + +\def\botofcontents% + {\vfill + \centerline{\covernote}} % this material will end the table of contents page + +\def\covernote% + {} + +% some leftover + +\defCWEBmacro\contentspagenumber{0} % default page number for table of contents + +% \newdimen\pagewidth \pagewidth = 158mm % the width of each page +% \newdimen\pageheight \pageheight = 223mm % the height of each page +% \newdimen\fullpageheight \fullpageheight = 240mm % page height including headlines +% \newdimen\pageshift \pageshift = 0in % shift righthand pages wrt lefthand ones +% +% \def\magnify#1% +% {\mag=#1 +% \pagewidth=6.5truein +% \pageheight=8.7truein +% \fullpageheight=9truein +% \setpage} +% +% \def\setpage% +% {\hsize\pagewidth +% \vsize\pageheight} % use after changing page size +% +% \def\contentsfile {\jobname.toc} % file that gets table of contents info +% \def\readcontents {\input \contentsfile} +% \def\readindex {\input \jobname.idx} +% \def\readsections {\input \jobname.scn} +% +% \newwrite\cont +% \output{\setbox0=\page % the first page is garbage +% \openout\cont=\contentsfile +% \write\cont{\catcode `\noexpand\@=11\relax} % \makeatletter +% \global\output{\normaloutput\page\lheader\rheader}} +% \setpage +% \vbox to \vsize{} % the first \topmark won't be null + +\defCWEBdummy\magnify#1% magnify the page + {} + +\defCWEBmacro\ch% + {\note{The following sections were changed by the change file:} + \let\*=\relax} + +% \newbox\sbox % saved box preceding the index +% \newbox\lbox % lefthand column in the index +% +% \def\inx% +% {\par\vskip6pt plus 1fil % we are beginning the index +% \def\page{\box255 } +% \normalbottom +% \write\cont{} % ensure that the contents file isn't empty +% \write\cont{\catcode `\noexpand\@=12\relax} % \makeatother +% \closeout\cont % the contents information has been fully gathered +% \output +% {\ifpagesaved +% \normaloutput{\box\sbox}\lheader\rheader +% \fi +% \global\setbox\sbox=\page +% \global\pagesavedtrue} +% \pagesavedfalse +% \eject % eject the page-so-far and predecessors +% \setbox\sbox\vbox{\unvbox\sbox} % take it out of its box +% \vsize=\pageheight +% \advance\vsize by -\ht\sbox % the remaining height +% \hsize=.5\pagewidth +% \advance\hsize by -10pt +% % column width for the index (20pt between cols) +% \parfillskip 0pt plus .6\hsize % try to avoid almost empty lines +% \def\lr{L} % this tells whether the left or right column is next +% \output +% {\if L\lr +% \global\setbox\lbox=\page +% \gdef\lr{R} +% \else +% \normaloutput +% {\vbox to\pageheight +% {\box\sbox +% \vss +% \hbox to\pagewidth{\box\lbox\hfil\page}}} +% \lheader +% \rheader +% \global\vsize\pageheight\gdef\lr{L}\global\pagesavedfalse\fi} +% \message{Index:} +% \parskip 0pt plus .5pt +% \outer\def\I##1, {\par\hangindent2em\noindent##1:\kern1em} % index entry +% \def\[##1]{$\underline{##1}$} % underlined index item +% \rm +% \rightskip0pt plus 2.5em +% \tolerance 10000 +% \let\*=\lapstar +% \hyphenpenalty 10000 +% \parindent0pt +% \readindex} +% +% \def\fin% +% {\par\vfill\eject % this is done when we are ending the index +% \ifpagesaved\null\vfill\eject\fi % output a null index column +% \if L\lr\else\null\vfill\eject\fi % finish the current page +% \parfillskip 0pt plus 1fil +% \def\grouptitle{NAMES OF THE SECTIONS} +% \let\topsecno=\nullsec +% \message{Section names:} +% \output={\normaloutput\page\lheader\rheader} +% \setpage +% \def\note##1##2.{\quad{\eightrm##1~##2.}} +% \def\Q{\note{Cited in section}} % crossref for mention of a section +% \def\Qs{\note{Cited in sections}} % crossref for mentions of a section +% \def\U{\note{Used in section}} % crossref for use of a section +% \def\Us{\note{Used in sections}} % crossref for uses of a section +% \def\I{\par\hangindent 2em}\let\*=* +% \readsections} +% +% \def\con% +% {\par\vfill\eject % finish the section names +% %\ifodd\pageno\else\titletrue\null\vfill\eject\fi % for duplex printers +% \rightskip = 0pt +% \hyphenpenalty = 50 +% \tolerance = 200 +% \setpage +% \output={\normaloutput\page\lheader\rheader} +% \titletrue % prepare to output the table of contents +% \pageno=\contentspagenumber +% \def\grouptitle{TABLE OF CONTENTS} +% \message{Table of contents:} +% \topofcontents +% \line{\hfil Section\hbox to3em{\hss Page}} +% \let\ZZ=\contentsline +% \readcontents\relax % read the contents info +% \botofcontents +% \end} % print the contents page(s) and terminate +% +% \def\contentsline#1#2#3#4% +% {\ifnum#2=0 +% \smallbreak +% \fi +% \line{\consetup{#2}#1 +% \rm\leaders\hbox to .5em{.\hfil}\hfil\ #3\hbox to3em{\hss#4}}} +% + +\defCWEBmacro\consetup#1% + {\ifcase#1 \bf % depth -1 (@**) + \or % depth 0 (@*) + \or \hskip2em % depth 1 (@*1) + \or \hskip4em % depth 2 (@*2) + \or \hskip6em % depth 3 (@*3) + \or \hskip8em % depth 4 (@*4) + \or \hskip10em % depth 5 (@*5) + \else \hskip12em + \fi} % depth 6 or more + +\defCWEBdummy \inx {} % index +\defCWEBdummy \fin {} % finish +\defCWEBdummy \con {} % table of contents and finish + +\defCWEBdummy \noinx {} % no indexes or table of contents +\defCWEBdummy \nosecs {} % no index of section names or table of contents +\defCWEBdummy \nocon {} % no table of contents + +\defCWEBmacro\,% + {\relax + \ifmmode + \mskip\thinmuskip + \else + \thinspace + \fi} + +% \def\noinx% +% {\let\inx=\end} +% +% \def\nosecs% +% {\let\FIN=\fin +% \def\fin% +% {\let\parfillskip=\end +% \FIN}} +% +% \def\nocon% +% {\let\con=\end} +% +% \newcount\twodigits +% +% \def\hours% +% {\twodigits=\time +% \divide\twodigits by 60 +% \printtwodigits +% \multiply\twodigits by -60 +% \advance\twodigits by \time +% :\printtwodigits} +% +% \def\gobbleone1{} +% +% \def\printtwodigits% +% {\advance\twodigits by 100 +% \expandafter\gobbleone\number\twodigits +% \advance\twodigits by -100 } +% +% \def\today% +% {\ifcase\month +% \or January\or February\or March\or April\or May\or June% +% \or July\or August\or September\or October\or November\or December% +% \fi +% \space +% \number\day, \number\year} +% +% \def\datethis% +% {\def\startsection% +% {\leftline{\sc\today\ at \hours} +% \bigskip +% \let\startsection=\stsec +% \stsec}} +% +% \def\datecontentspage% +% {\def\topofcontents% +% {\leftline{\sc\today\ at \hours} +% \bigskip +% \centerline{\titlefont\title} +% \vfill}} + +\defCWEBdummy\datethis {} % say `\datethis' in limbo, to get your listing timestamped before section 1 +\defCWEBdummy\datecontentspage {} % timestamps the contents page + +\defCWEBmacro\TeX% + {{\ifmmode\it\fi + \leavevmode + \hbox{T\kern-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}} + +% alternative implementation + +\newif\ifCWEBnotes + +\defCWEBmacro\Q {\CWEBnotesfalse \note{This code is cited in section}} % xref for mention of a section +\defCWEBmacro\Qs {\CWEBnotestrue \note{This code is cited in sections}} % xref for mentions of a section + +\defCWEBmacro\U {\CWEBnotesfalse \note{This code is used in section}} % xref for use of a section +\defCWEBmacro\Us {\CWEBnotestrue \note{This code is used in sections}} % xref for uses of a section + +\defCWEBmacro\A {\CWEBnotesfalse \note{See also section}} % xref for doubly defined section name +\defCWEBmacro\As {\CWEBnotestrue \note{See also sections}} % xref for multiply defined section name + +\defCWEBmacro\ET% conjunction between two section numbers + { and~} + +\defCWEBmacro\ETs% conjunction between the last two of several section numbers + {, and~} + +%\def\processCWEBsectionnumbers[#1]% +% {\bgroup +% \def\CWEBcomma% +% {\def\CWEBcomma{, }}% +% \def\docommando##1% +% {\bgroup +% \def\[####1]{####1}% +% \xdef\CWEBreference{##1}% +% \egroup +% \CWEBcomma{\naar{\donottest{##1}}[web:\CWEBreference]}}% +% \processcommalist[{#1}]\docommando +% \egroup} + +% \def\processCWEBsectionnumbers[#1]% +% {\bgroup +% \def\CWEBcomma% +% {\def\CWEBcomma{, }}% +% \def\docommando##1% +% {\bgroup +% \def\(####1){####1}% +% \xdef\CWEBreference{##1}% +% \egroup +% \CWEBcomma +% {\localcolortrue\naar{\donottest{##1}}[web:\CWEBreference]}}% +% \bgroup +% \def\[##1]{\(##1)}\let\(=\relax\xdef\CWEBreferences{#1}% +% \egroup +% \unexpanded\def\(##1){\[##1]}% +% \processcommacommand[\CWEBreferences]\docommando +% \egroup} + +\def\processCWEBsectionnumbers[#1]% + {\bgroup + \def\CWEBcomma% + {\def\CWEBcomma{, }}% + \def\docommando##1% + {\bgroup + \def\[####1]{####1}% + \xdef\CWEBreference{##1}% + \egroup + \CWEBcomma{\localcolortrue\naar{\donottest{##1}}[web:\CWEBreference]}}% + \processlist{(}{)}{,}\docommando(#1) + \egroup} + +\def\processCWEBsectionnotes% + {\catcode`\s=12 + \doprocessCWEBsectionnotes} + +\def\doprocessCWEBsectionnotes#1.% + {\ifCWEBnotes + \def\next##1\ET##2##3.% + {\processCWEBsectionnumbers[##1]% + \if##2s% + {, and~\naar{##3}[web:##3]}% + \else + { and~\naar{##2##3}[web:##2##3]}% + \fi}% + \next#1.% + \else + \naar{#1}[web:#1]% + \fi + \afterCWEBnote % inside group! + \egroup} + +\let\afterCWEBnote=\relax + +\defCWEBmacro\note#1% + {\bgroup + \Y\noindent + \def\afterCWEBnote{\par}% + \hangindent2em + %\baselineskip10pt + \eightrm#1~\processCWEBsectionnotes} + +\def\oldCWEBmacroX#1:#2\X% original + {\ifmmode + \gdef\XX{\null$\null}% + \else + \gdef\XX{}% + \fi % section name + \XX$\langle\,${#2\eightrm\kern.5em#1}$\,\rangle$\XX} + +\defCWEBmacro\ATH% + {\oldCWEBmacroX\kern-.5em:Preprocessor definitions\X} + +\def\newCWEBmacroX#1:#2\X% original + {\ifmmode + \gdef\XX{\null$\null}% + \else + \gdef\XX{}% + \fi % section name + \XX$\langle\,$% + {#2\eightrm\kern.5em\processCWEBsectionnumbers[{#1}]}% + $\,\rangle$\XX} + +\defCWEBmacro\X#1:#2\X% + {\newCWEBmacroX#1:#2\X} + +\definieermarkering[CWEBfilename] +\definieermarkering[CWEBsectiontitle] +\definieermarkering[CWEBsectionnumber] +\definieermarkering[CWEBsectiondepth] + +\defCWEBmacro\M#1% + {\MN{#1}% + \ifon + \vfil + \penalty-100 + \vfilneg % beginning of section + \theCWEBvskip + \startsection + \pagereference[web:#1]% + \expanded{\marking[CWEBsectionnumber]{\secno}}% + \expanded{\marking[CWEBsectiondepth]{\the\gdepth}}% + \ignorespaces} + +\defCWEBmacro\N#1#2#3.% + {\gdepth=#1% + \MN{#2}% beginning of starred section + \ifon + \ifnum#1<\secpagedepth + \vfil + \eject % force page break if depth is small + \else + \vfil + \penalty-100 + \vfilneg + \theCWEBvskip + \fi + \fi + \message{*\secno}% progress report + \makesectionformat % context + \convertargument#3\to\ascii + \edef\next% + {\write\CWEBcont % write to contents file + {\string\ZZ{\ascii}{#1}{\secno}% + {\sectionformat::\noexpand\userfolio}{\noexpand\realfolio}}}% + \next % \ZZ{title}{depth}{sec}{page} + \ifon + \startsection + \pagereference[web:#2]% + \marking[CWEBsectiontitle] {#3}% + \expanded{\marking[CWEBsectionnumber]{\secno}}% + \expanded{\marking[CWEBsectiondepth]{\the\gdepth}}% + {\bf#3.\quad}% + \ignorespaces} + +\defCWEBmacro\MN#1% + {\par % common code for \M, \N + {\xdef\secstar{#1}% + \let\*=\empty + \xdef\secno{#1}}% remove \* from section name + \ifx\secno\secstar + \onmaybe + \else + \ontrue + \fi} + +\newif\iflinktoCWEBfile + +\def\setCWEBlinkfile#1% + {\linktoCWEBfiletrue + \def\otherCWEBfile{#1}} + +\unprotect + +\def\gotoCWEBsection#1[#2]% + {\iflinktoCWEBfile + \bgroup + \setupinteraction[\c!kleur=,\c!letter=]% + \let\savedreferenceprefix=\referenceprefix + \localcolortrue + \naar{#1}[\otherCWEBfile::\savedreferenceprefix web:#2]% + \egroup + \else + #1% + \fi} + +\protect + +\defCWEBmacro\startsection% + {\rightskip=0pt % get out of C mode (cf. \B) + \sfcode`;=1500 + \pretolerance 200 + \hyphenpenalty 50 + \exhyphenpenalty 50 + \noindent + \bgroup + \let\*=\lapstar + \gotoCWEBsection{\bf\secstar.\quad}[\secno]% + \egroup} + +\def\ignoreCWEBinput% + {\let\normalinput=\input + \def\input ##1 % + {\let\input=\normalinput}} + +\def\loadCWEBmacros#1% + {\let\oldN=\N + \def\N{\bgroup\setbox0=\vbox\bgroup\endinput}% + \ignoreCWEBinput + \ReadFile{#1.tex}% + \egroup\egroup + \let\N=\oldN} + +\def\resetCWEBcontext% + {\catcode`\|=12 % used in context discretionaries + \everypar{} % used for context indentation and floats + \parskip=0pt % no stretch between cweb paragraphs + \parindent=1em} % is related to cweb backspace etc + +\newwrite\CWEBcont + +\def\processCWEBsource #1 % + {\bgroup + \resetCWEBcontext + \activateCWEB + \ignoreCWEBinput + \immediate\openout\CWEBcont=#1.toc + \write\CWEBcont{\noexpand\unprotect} + \message{Source:} + \marking[CWEBfilename]{#1} + \ReadFile{#1.tex}\relax + \write\CWEBcont{\noexpand\protect} + \closeout\CWEBcont + \par + \egroup} + +\def\resetCWEBindexentry% + {\xdef\currentCWEBindexentry{}} + +\def\showCWEBindexentry#1% can be redefined + {\theCWEBvskip + \vskip3\lineheight + \goodbreak + \vskip-3\lineheight + {\pagereference[web:#1]\bf#1}% + \theCWEBvskip} + +\def\checkCWEBindexentry#1% + {\bgroup + \def\\##1{##1}% a dummy that also removes the {} + \def\|##1{##1}% another dummy + \def\.##1{*##1}% and another (the typewriter one) + \def\&##1{##1}% and a last one + \def\9##1{##1}% hold this one + \catcode`*=11 + \expandafter\def\expandafter\entry\expandafter{#1}% + \convertcommand\entry\to\ascii + \expanded{\FINDFIRSTCHARACTER{\ascii}}% + \doifnot{\currentCWEBindexentry}{\firstcharacter} + {\doifnot{\firstcharacter}{*} % signal for \firstbunch + {\global\let\currentCWEBindexentry=\firstcharacter + \showCWEBindexentry{\currentCWEBindexentry}}}% + \egroup} + +\def\theCWEBbeforeindex {\startkolommen} +\def\theCWEBafterindex {\stopkolommen} + +\def\processCWEBindex #1 % + {\bgroup + \resetCWEBcontext + \activateCWEB + \resetCWEBindexentry + \def\I##1, % + {\par + \checkCWEBindexentry{##1}% + \hangindent2em + \noindent##1:\kern1em% + \def\next####1.% + {\processCWEBsectionnumbers[{####1}]}% + \next}% + \def\[##1]% + {$\underline{##1}$}% + \let\*=\lapstar + \parfillskip 0pt plus .6\hsize % try to avoid almost empty lines +% \parskip 0pt plus .5pt + \rightskip0pt plus 2.5em + \tolerance 10000 + \hyphenpenalty 10000 + \parindent0pt + \message{Index:} + \marking[CWEBfilename] {#1} + \marking[CWEBsectiontitle] {index} + \marking[CWEBsectionnumber]{} + \marking[CWEBsectiondepth]{} + \loadCWEBmacros{#1} + \theCWEBbeforeindex + \ReadFile{#1.idx}\relax + \theCWEBafterindex + \par + \egroup} + +\def\processCWEBsections #1 % + {\bgroup + \resetCWEBcontext + \activateCWEB + \loadCWEBmacros{#1} + \parfillskip = 0pt plus 1fil + \parindent = 0pt + \let\topsecno=\nullsec + \def\note##1% + {\quad + \bgroup + \eightrm + ##1~\processCWEBsectionnotes} + \def\Q {\CWEBnotesfalse \note{Cited in section}} % crossref for mention of a section + \def\Qs{\CWEBnotestrue \note{Cited in sections}} % crossref for mentions of a section + \def\U {\CWEBnotesfalse \note{Used in section}} % crossref for use of a section + \def\Us{\CWEBnotestrue \note{Used in sections}} % crossref for uses of a section + \def\I {\par\hangindent 2em}% + \let\*=* + \message{Section names:} + \marking[CWEBfilename] {#1} + \marking[CWEBsectiontitle] {sections} + \marking[CWEBsectionnumber]{} + \marking[CWEBsectiondepth]{} + \loadCWEBmacros{#1} + \ReadFile{#1.scn}\relax + \par + \botofcontents + \par + \egroup} + +\def\processCWEBcontents #1 % + {\bgroup + \resetCWEBcontext + \activateCWEB + \loadCWEBmacros{#1} + \rightskip = 0pt + \hyphenpenalty = 50 + \tolerance = 200 + \parindent = 0pt + \line{\hfil Section\hbox to3em{\hss Page}} + \let\ZZ=\contentsline + \message{Table of contents:} + \marking[CWEBfilename] {#1} + \marking[CWEBsectiontitle] {table of contents} + \marking[CWEBsectionnumber]{} + \marking[CWEBsectiondepth]{} + \loadCWEBmacros{#1} + \ReadFile{#1.toc}\relax + \par + \egroup} + +\defCWEBmacro\contentsline#1#2#3#4#5% + {\ifnum#2=0 + \smallbreak + \fi + \line{\consetup{#2}#1 + \rm + \leaders\hbox to .5em{.\hfil}\hfil\ + {\localcolortrue\naar{#3}[web:#3]}% below: \gotorealpage ? should be changed + \hbox to3em{\localcolortrue\hss\gotorealpage{}{}{#5}{\translatednumber[#4]\presetgoto}}}} + +%D A last hack, needed because a file can overload of the +%D above. (Some day: a check like \ifx#1\CWEBdefined.) + +\def\outer#1#2% + {\ifx#2\undefined + \expandafter#1\expandafter#2% + \else + \expandafter#1\expandafter\ThrowAway + \fi} + +\endinput diff --git a/tex/context/base/m-pictex.tex b/tex/context/base/m-pictex.tex index ac74c1d6b..408105581 100644 --- a/tex/context/base/m-pictex.tex +++ b/tex/context/base/m-pictex.tex @@ -239,7 +239,7 @@ %D Now we can load \PICTEX: -\loadpictec +\loadpictex %D Finally we restore the old definitions of \type{\newdimen} %D and \type{\newskip}: diff --git a/tex/context/base/m-units.tex b/tex/context/base/m-units.tex index f0f13c48f..fd82b1499 100644 --- a/tex/context/base/m-units.tex +++ b/tex/context/base/m-units.tex @@ -44,6 +44,16 @@ 1: Verwende \string\Degrees\space\string\Celsius\space statt \string\Celsius ! \stopmessages +\startmessages italian library: units + title: unità + 1: usare \string\Degrees\space\string\Celsius\space invece di \string\Celsius ! +\stopmessages + +\startmessages norwegian library: units + title: enheter + 1: bruk \string\Degrees\space\string\Celsius\space istedenfor \string\Celsius ! +\stopmessages + \unprotect %D This runtime loadable module implements a way of defining @@ -593,12 +603,12 @@ %D Some more, thanks to Tobias: -\getvalue{\v!eenheid} [Gray] {Gr} {Gray} -\getvalue{\v!eenheid} [Weber] {Wb} {Weber} -\getvalue{\v!eenheid} [Henry] {H} {Henry} -\getvalue{\v!eenheid} [Sterant] {sr} {Sterant} -\getvalue{\v!eenheid} [Angstom] {\AA} {\AA ngstr\"om} -\getvalue{\v!eenheid} [Gauss] {G} {Gauss} +\getvalue{\v!eenheid} [Gray] {Gr} {Gray} +\getvalue{\v!eenheid} [Weber] {Wb} {Weber} +\getvalue{\v!eenheid} [Henry] {H} {Henry} +\getvalue{\v!eenheid} [Sterant] {sr} {Sterant} +\getvalue{\v!eenheid} [Angstrom] {\AA} {\AA ngstr\"om} +\getvalue{\v!eenheid} [Gauss] {G} {Gauss} \setuplabeltext [\s!nl] diff --git a/tex/context/base/main-001.tex b/tex/context/base/main-001.tex index db1a16b4a..5a1e0758d 100644 --- a/tex/context/base/main-001.tex +++ b/tex/context/base/main-001.tex @@ -13,12 +13,6 @@ %D This module is still to be split and documented. -% nog oplossen: voetnoot setten ivm later veranderde -% witruimte; probleem: als lijn graphic - -% The %I etc thing will be replaced by documentation. Some -% years ago they served as helpinfo blocks for our editor. - \writestatus{loading}{Context Core Macros (1)} \newevery \everybodyfont \Everybodyfont % just to be sure @@ -51,7 +45,6 @@ \protect - \unprotect \startmessages dutch library: systems @@ -178,6 +171,68 @@ 27: verze \stopmessages +\startmessages italian library: systems + title: sistema + 1: caricamento dei file supplementari posticipato (typemode) + 2: -- caricato + 3: provare LaTeX + 4: comando -- già definito + 5: macro del modulo -- caricate + 6: nessuna macro trovata nel modulo -- + 7: macro del modulo -- già caricate + 8: nuova versione del file supplementare, seconda passata necessaria + 9: -- non trovato/elaborato + 10: non usare em in -- + 11: costruzione di un semplice supplemento + 12: file di supplemento non ordinato, usare texutil + 13: marcatura -- definita -- + 14: nuova pagina obbligata in lista a -- + 15: salvataggio del buffer -- + 16: composizione del buffer -- + 17: composizione verbatim del buffer -- + 18: sinonimo -- -- non esistente + 19: significato (sinonimi) di -- caricato + 20: significato (specie) di -- caricato + 21: nessuna informazione supplementare caricata + 22: usare un file supplementare valido + 23: -- sistemato a -- + 24: Oggetti mobili + 25: Riferimenti + 26: Registri + 27: Versione +\stopmessages + +\startmessages norwegian library: systems + title: system + 1: innlesning av hjelpefila utsatt (typemode) + 2: -- er lest inn + 3: forsøker LaTeX + 4: kommando -- er allerede definert + 5: makroene i modul -- er lest inn + 6: ingen makroer funnet i modul --- + 7: makroene i modul -- er allerede lest inn + 8: ny versjon av hjelpefil, andre gjennomkjøring nødvendig + 9: -- ikke funnet/behandlet + 10: ikke bruk em i -- + 11: lager enkel hjelpefil + 12: hjelpefila er ikke sortert, bruk texutil + 13: markering -- definert -- + 14: tvunget sideskift i liste ved -- + 15: lagrer Buffer -- + 16: tegnsetter buffer -- + 17: tegnsetter verbatim-buffer -- + 18: synonym -- -- eksisterer ikke + 19: betydning (synonymer) av -- er lest inn + 20: betydning (sorterer) av -- er lest inn + 21: hjelpefila er ikke lest inn + 22: bruk en gyldig hjelpefil + 23: -- arrangert på -- + 24: Flytblokker + 25: Referanser + 26: Registere + 27: Versjon +\stopmessages + \startmessages dutch library: floatblocks title: plaatsblokken 1: -- hernummerd / -- => -- @@ -242,6 +297,38 @@ 12: nedefinovano \stopmessages +\startmessages italian library: floatblocks + title: oggetti mobili + 1: -- rinumerato / -- => -- + 2: -- salavto + 3: -- mosso + 4: -- sistemato + 5: ordine aggiustato + 6: n di top floats limitato a -- + 7: n di bottom floats limitato a -- + 8: meno di -- righe + 9: ordine disturbato + 10: -- limitato + 11: nessun oggetto specificato + 12: non definito +\stopmessages + +\startmessages norwegian library: floatblocks + title: flytblokker + 1: -- renummerert / -- => -- + 2: -- lagret + 3: -- flyttet + 4: -- plassert + 5: rekkefølge tilpasset + 6: maksimalt -- flytblokker øverst + 7: maksimalt -- flytblokker nederst + 8: mindre enn -- linjer + 9: rekkefølge endret + 10: -- begrenset + 11: ingen blokk oppgitt + 12: udefinert +\stopmessages + \startmessages dutch library: layouts title: layout 1: teksthoogte aangepast met -- op pagina -- @@ -297,6 +384,34 @@ 10: -- a -- nedava dohromady 1.0 11: svisla mezera -- neni povolena v pevnem radkovem rejstriku \stopmessages + +\startmessages italian library: layouts + title: layout + 1: altezza del testo adattata con -- a pagina -- + 2: posizionato testo posticipato -- volte + 3: testo posticipato -- volte + 4: blocchi in margine attivi + 5: blocchi in margine inattivi + 6: gruppo di sottopagine -- elaborato (dimensione --) + 7: calcolo dello spazio per logo + 8: calcolo dello sfondo + 10: -- e -- non sommano a 1.0 + 11: spaziatura -- non permessa in modo griglia +\stopmessages + +\startmessages norwegian library: layouts + title: layout + 1: teksthøyde tilpasset med -- på side -- + 2: -- ganger forskjøvet tekst plassert + 3: -- ganger tekst forskjøvet + 4: margblokker aktive + 5: margblokker inaktive + 6: delside sett -- behandlet (størrelse --) + 7: beregner plass for logo + 8: beregner bakgrunn + 10: -- og -- er ikke 1.0 til sammen + 11: mellomrom -- ikke tillatt i gridmodus +\stopmessages % \CONTEXTtrue % Now we know that we can use ConTeXt commands. @@ -466,13 +581,15 @@ {\emergencystretch\!!zeropoint\relax} \def\forgetall% - {\let\par=\endgraf % i.v.m. getpar etc - \notragged - \forgetparskip - \forgetparindent - \forgetbothskips - \forgetspacing % i.v.m. funny spacing in pagebody - \everypar{}} % indeed! + {\the\everyforgetall} + +\appendtoks \let\par=\endgraf \to \everyforgetall % i.v.m. getpar etc +\appendtoks \notragged \to \everyforgetall +\appendtoks \forgetparskip \to \everyforgetall +\appendtoks \forgetparindent \to \everyforgetall +\appendtoks \forgetbothskips \to \everyforgetall +\appendtoks \forgetspacing \to \everyforgetall % i.v.m. funny spacing in pagebody +\appendtoks \everypar\emptytoks \to \everyforgetall % indeed! \def\localvbox#1#% {\vbox#1\bgroup @@ -509,6 +626,10 @@ \newskip\leftskipadaption \def\doadaptleftskip#1% + {\dosetleftskipadaption{#1}% + \advance\leftskip by \leftskipadaption} + +\def\dosetleftskipadaption#1% {\leftskipadaption\!!zeropoint \processaction[#1] % \ExpandFirstAfter [\v!standaard=>\leftskipadaption= @@ -516,8 +637,7 @@ \v!ja=>\leftskipadaption= \ifdim\voorwit=\!!zeropoint\@@sllinks\else\voorwit\fi, \v!nee=>, - \s!unknown=>\leftskipadaption=#1]% - \advance\leftskip by \leftskipadaption} + \s!unknown=>\leftskipadaption=#1]} \def\herhaal {\dorepeat} \def\herhaler {\repeater} @@ -609,18 +729,6 @@ \catcode`\^^L=\@@endofline -%I n=Struts -%I c=\strut,\setnostrut,\setstrut,\toonstruts,\pseudostrut -%I -%I Struts zijn onzichtbare 'karakters' met alleen een hoogte -%I en diepte. De volgende commando's hebben betrekking op -%I struts -%I -%I \strut -%I \setstrut -%I \setnostrut -%I \toonstruts - \def\toonstruts% {\setteststrut} @@ -674,6 +782,7 @@ \def\baselinegluefactor {0} \def\normallineheight {\baselinefactor ex} +\def\minimallinedistance {\lineskip} \def\strutheight {0pt} \def\strutdepth {0pt} @@ -736,7 +845,7 @@ \openlineheight \!!plus\baselinegluefactor\openlineheight \!!minus\baselinegluefactor\openlineheight - \normallineskip\!!onepoint\relax + \normallineskip\minimallinedistance\relax % \!!onepoint\relax \normallineskiplimit\!!zeropoint\relax \normalbaselines} @@ -776,18 +885,66 @@ % The double \hbox construction enables us to \backtrack % boxes. +% \def\setstrut% +% {\setstrutdimen\strutheight\strutheightfactor\spacingfactor +% \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor +% \let\strut=\normalstrut +% \setbox\strutbox=\normalhbox +% {\normalhbox +% {\vrule +% \!!width \strutwidth +% \!!height \strutheight +% \!!depth \strutdepth +% \normalkern-\strutwidth}}} + \def\setstrut% {\setstrutdimen\strutheight\strutheightfactor\spacingfactor \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor - \let\strut=\normalstrut - \setbox\strutbox=\normalhbox - {\normalhbox - {\vrule - \!!width \strutwidth - \!!height \strutheight - \!!depth \strutdepth - \normalkern-\strutwidth}}} + \dosetstrut} + +\def\setcharstrut#1% + {\setbox\strutbox=\hbox{#1}% + \edef\strutheight{\the\ht\strutbox}% + \edef\strutdepth {\the\dp\strutbox}% + \dosetstrut} + +\def\setcapstrut% could be M, but Q has descender + {\setcharstrut{Q}} +%D Centered looks nicer: + +\def\dosetstrut% + {\let\strut=\normalstrut + \setbox\strutbox=\normalhbox + {\normalhbox to \!!zeropoint + {% \hss % new, will be option + \vrule + \!!width \strutwidth + \!!height\strutheight + \!!depth \strutdepth + \hss}}} +%D Sometimes a capstrut comes in handy +%D +%D \starttabulatie[|Tl|l|l|] +%D \NC yes \NC normal strut \NC {\toonstruts\setupstrut[ja]\strut} \NC \NR +%D \NC no \NC no strut \NC {\toonstruts\setupstrut[nee]\strut} \NC \NR +%D \NC kap \NC a capital strut (i.e. Q) \NC {\toonstruts\setupstrut[kap]\strut} \NC \NR +%D \NC A B \unknown \NC a character strut (e.g. A) \NC {\toonstruts\setupstrut[A]\strut} \NC \NR +%D \NC \NC a normal strut \NC {\toonstruts\setupstrut\strut} \NC \NR +%D \stoptabulatie + +\def\setupstrut% + {\dosingleempty\dosetupstrut} + +\def\dosetupstrut[#1]% yet undocumented + {\processaction + [#1] + [ \v!ja=>\setstrut, + \v!nee=>\setnostrut, + \v!kap=>\setcapstrut, + \s!default=>\setstrut, + \s!unknown=>\setcharstrut{\commalistelement}]} + \def\setteststrut% {\def\strutwidth{.8pt}% \setstrut} @@ -845,6 +1002,10 @@ \def\setfontparameters% {\the\everybodyfont} +%D Handy: + +\def\baselinedistance{\the\lineheight} + %D We need \type{\normaloffinterlineskip} because the new %D definition contains an assignment, and |<|don't ask me %D why|>| this assignment gives troubles in for instance the @@ -1180,110 +1341,6 @@ \def\startglobal {\dostartglobaldefs<+} \def\stopglobal {\dostopglobaldefs} -%I n=Zetspiegel -%I c=\stellayoutin,\definieerpapierformaat,\stelpapierformaatin -%I c=\paslayoutaan -%I -%I De zetspiegel is het door de tekst gevormde vlak. -%I Hiertoe behoren ¢¢k de hoofd- en voetmarge. De zetspiegel -%I wordt ingesteld met: -%I -%I \stellayoutin[breedte=,hoogte=,rugwit=,kopwit=] -%I -%I Er dienen maten te worden ingevuld, waarbij de eenheid -%I direkt achter het getal staat: 10pt, 100mm, 5cm, 3.5in. -%I -%I De parameters hebben de volgende betekenis: -%I -%I breedte breedte van het tekstvlak, inclusief marges -%I hoogte hoogte van het tekstvlak, inclusief marges -%I rugwit witruimte aan de binnenzijde, zonder marge -%I kopwit witruimte aan de bovenzijde, zonder marge -%P -%I Rond de zetspiegel vinden we marges, randen, het hoofd en -%I de voet. Ook deze worden ingesteld met: -%I -%I \stellayoutin[breedte=,hoogte=,rugwit=,kopwit=] -%I -%I hoofd hoogte van de bovenmarge binnen de zetspiegel -%I voet hoogte van de ondermarge binnen de zetspiegel -%I marge breedte van de marge naast de zetspiegel -%I -%I en -%I -%I rand breedte van de rand naast de marge -%I boven hoogte van de rand boven het hoofd -%I onder hoogte van de rand onder de voet -%I -%I Alleen het hoofd en de voet hangen dus samen met de -%I zetspiegel. -%P -%I Eventueel kunnen de linker- en rechtermarge en apart -%I worden ingesteld: -%I -%I \stellayoutin[linkermarge=,rechtermarge=] -%I -%I Het zelfde geldt voor de randen. In dat geval wordt bij -%I dubbelzijdig zetten gespiegeld. Oppassen dus! -%I -%I De afstanden tussen marges, randen enz. kunnen worden -%I ingesteld met: -%I -%I bovenafstand, onderafstand -%I hoofdafstand,voetafstand -%I linkermargeafstand,rechtermargeafstand, -%I linkerrandafstand,rechterrandafstand -%P -%I De zetspiegel kan (tijdelijk) worden aangepast met het -%I commando: -%I -%I \paslayoutaan[hoogte=] -%I -%I Men dient een positieve (+) of negatieve (-) maat op te -%I geven. De zethoogte blijft gelijk, maar de teksthoogte -%I wordt aangepast ten koste van de voethoogte. Eventueel -%I kan 'max' worden opgegeven. -%I -%I Er kan een reeks aanpassingen worden opgegeven: -%I -%I \paslayoutaan[nr,nr,nr,...][hoogte=] -%I -%I Hierbij is staat nr voor het paginanummer, dat wil -%I zeggen: het volgnummer in de tekst. -%I -%I Bij voorlopige versies wordt onderaan de pagina de -%I aanpassing weergegeven. -%P -%I Beeldmerken en achtergronden worden uit oogpunt van -%I verwerkingssnelheid niet vaker berekend dan nodig. Mocht -%I om een of andere reden een beeldmerk of achtergrond niet -%I overeenkomen komen met de wensen, dan kan herberekenen -%I worden geforceerd met: -%I -%I \stellayoutin[reset] -%P -%I Het papierformaat is in te stellen met het commando -%I -%I \stelpapierformaatin[DIN-formaat] -%I -%I Mogelijke DIN-formaten zijn A4 tot en met A9. De -%I afmetingen van een A4 zijn: -%I -%I breedte : 21.0cm = 8.18in = 589pt -%I hoogte : 29.7cm = 11.58in = 834pt -%I -%I Optioneel kan men het printer papierformaat instellen door -%I een tweede argument mee te geven. Standaard wordt -%I uitgegaan van A4. -%I -%I \stelpapierformaatin[A5][A4] -%I -%P Men kan zelf een papierformaat definieren met -%I -%I \definieerpapierformaat [naam] [hoogte=,breedte=] -%I -%I waarbij de offset betrekking heeft op dubbelzijdig zetten. - \ifx\stelpapierformaatin\undefined \let\stelpapierformaatin\relax \fi @@ -1352,6 +1409,8 @@ \def\dodostelpapierformaatin[#1][#2]% {\ifsecondargument + \xdef\herstelpapierformaat% + {\noexpand\stelpapierformaatin[#1][#2]}% \dostelpapierrichtingin{#1}\paperlandscape\paperrotation\paperreverse\papermirror \dostelpapierrichtingin{#2}\printlandscape\printrotation\printreverse\printmirror \def\docommando##1% @@ -1360,7 +1419,7 @@ \global\papierhoogte=\getvalue{\??pp##1\c!hoogte}% \calculatepaperoffsets{##1}% \xdef\papierformaat{##1}}}}% - \processcommalist[#1]\docommando + \processcommacommand[#1]\docommando \doifdefinedelse{\??pp#1\c!schaal} {\edef\papierschaal{\getvalue{\??pp#1\c!schaal}}} {\edef\papierschaal{1}}% @@ -1369,7 +1428,7 @@ {\global\printpapierbreedte=\getvalue{\??pp##1\c!breedte}% \global\printpapierhoogte=\getvalue{\??pp##1\c!hoogte}% \xdef\printpapierformaat{##1}}}}% - \processcommalist[#2]\docommando + \processcommacommand[#2]\docommando \ifnum\paperlandscape>0 \doglobal\swapdimens\papierbreedte\papierhoogte \fi @@ -1390,9 +1449,11 @@ \else\iffirstargument \stelpapierformaatin[#1][#2]% \else\ifx\papierformaat\undefined\else - \stelpapierformaatin[\papierformaat][\printpapierformaat]% + \herstelpapierformaat \fi\fi\fi} +\let\herstelpapierformaat\relax + \def\stelpapierformaatin% {\dodoubleempty\dostelpapierformaatin} @@ -1431,9 +1492,11 @@ \doifelse{\@@lybreedte}{\v!midden} {\global\zetbreedte=\papierbreedte \global\advance\zetbreedte by -\rugwit - \doifelsenothing{\@@lysnijwit} - {\global\advance\zetbreedte by -\rugwit} - {\global\advance\zetbreedte by -\@@lysnijwit}} + \scratchdimen=\@@lysnijwit\relax + \ifdim\scratchdimen=\!!zeropoint + \scratchdimen=\rugwit + \fi + \global\advance\zetbreedte by -\scratchdimen} {\doifelse{\@@lybreedte}{\v!passend} {\global\zetbreedte=\papierbreedte \global\advance\zetbreedte by -\rugwit @@ -1457,16 +1520,18 @@ {\doifelse{\@@lyhoogte}{\v!midden} {\global\zethoogte=\papierhoogte \global\advance\zethoogte by -\kopwit - \doifelsenothing{\@@lybodemwit} - {\global\advance\zethoogte by -\kopwit} - {\global\advance\zethoogte by -\@@lybodemwit}} + \scratchdimen=\@@lybodemwit\relax + \ifdim\scratchdimen=\!!zeropoint + \scratchdimen=\kopwit + \fi + \global\advance\zethoogte by -\scratchdimen} {\doifelse{\@@lyhoogte}{\v!passend} {\global\zethoogte=\papierhoogte \global\advance\zethoogte by -\kopwit \scratchdimen=\kopwit \advance\scratchdimen by -\bovenhoogte \advance\scratchdimen by -\bovenafstand - \ifdim\scratchdimen<\!!zeropoint + \ifdim\scratchdimen<\!!zeropoint \scratchdimen=\!!zeropoint \fi \global\advance\zethoogte by -\onderafstand @@ -1481,10 +1546,7 @@ \calculatehsizes \calculatevsizes \global\newlogostrue - \global\newbackgroundtrue - \setMPpagedata} - -\ifx\setMPpagedata\undefined \let\setMPpagedata\relax \fi + \global\newbackgroundtrue} \def\checklayout% {\doifsomething{\@@lyregels} @@ -1590,23 +1652,6 @@ \def\paslayoutaan% {\dodoubleempty\dopaslayoutaan} -%I n=Margeblokken -%I c=\startmargeblok,\stelmargeblokkenin -%I -%I voorlopig: -%I -%I \stelmargeblokkenin -%I [plaats=,breedte,letter=,uitlijnen=, -%I voor=,na=,links=,rechts=,boven=,onder=,tussen=] -%I -%I plaats = inmarge, links, rechts, midden -%I links, rechts, voor, na = rule -%I boven, onder, tussen = skip -%I status= -%I -%I \startmargeblok -%I \stopmargeblok - \newif\ifmargeblokken \def\dostelmargeblokkenin[#1]% @@ -1632,10 +1677,8 @@ \def\dosomenextfloat[#1]% {\global\setbox\marginbox=\vbox {\hsize\@@mbbreedte - \unvbox\marginbox - \ifvoid\marginbox\else - \@@mbtussen - \fi + \unvcopy\marginbox + \ifvoid\marginbox\else\expandafter\@@mbtussen\fi \box\floatbox\filbreak}% \ifdim\ht\marginbox>\teksthoogte \dosavefloatinfo @@ -1735,42 +1778,6 @@ \egroup \@@mbna} -%I n=Uitstellen -%I c=\startuitstellen -%I -%I Zetcommando's kunnen in een wachtrij worden gezet en na -%I een pagina worden uitgevoerd. Dit gebeurt met het commando: -%I -%I \startuitstellen -%I ... -%I \stopuitstellen -%I -%I Dit kan handig zijn bij bijvoorbeeld grote tussen te voegen -%I figuren, tabellen, formulieren enz. -%I -%I \startuitstellen -%I \plaatsfiguur[pagina][]{...}{...} -%I \stopuitstellen -%I -%I Er kunnen meerdere commando's in de wachtrij worden -%I geplaatst. -%P -%I Het mechanisme werkt nog niet vlekkeloos. Zo wordt -%I nog gerekend met waarden van de vorige pagina. Dit heeft -%I bijvoorbeeld als gevolg dat figuren kunnen worden -%I opgespaard. -%I -%I Het kan gebeuren dat een (te) groot figuur er voor zorgt -%I dat ook andere figuren worden verplaatst. De volgorde -%I blijft immers gehandhaafd. In dat geval kan zo'n groot -%I figuur worden verplaatst naar de eerstvolgende voor de -%I handliggende pagina: -%I -%I \startuitstellen -%I \plaatsfiguur[pagina][]{...}{...} -%I \pagina -%I \stopuitstellen - \newcounter\nofpostponedblocks \newif\ifinuitstellen @@ -1825,7 +1832,7 @@ \def\dostelsubpaginanummerin[#1]% {\doifelse{#1}{\v!reset} - {\resetnummer[\s!subpage]} + {\resetsubpaginanummer} % \resetnummer[\s!subpage] {\getparameters[\??sn][#1]% \processaction [\@@snstatus] @@ -2052,7 +2059,7 @@ \fi} \def\myshipout#1% - {\voorpagina + {\voorpagina % voor de pagebody dus ! \dontshowcomposition \ifarrangingpages \actualarrange @@ -2280,8 +2287,10 @@ \ifbottomnotes \ht0=\!!zeropoint \fi +%% \setbox0= % todo, there must be a faster way to kill funny depths \vbox to \teksthoogte {\box0\box2\ifbottomnotes\else\vfill\fi}% +%% \dp0=\!!zeropoint \box0 % new \egroup} \def\dodummypageskip#1% @@ -2347,6 +2356,7 @@ \hss}% new \ht0=\teksthoogte \wd0=\zetbreedte +\dp0=\!!zeropoint % new, maybe a reason for small shifts \ifshowgrid \setgridbox2\zetbreedte\teksthoogte \hbox{\color[red]{\box2}\hskip-\zetbreedte\box0}% @@ -2662,8 +2672,8 @@ {\getallmarks \the\everypagebody \startcolorpage - \gotonextsubpage - \dontshowboxes + \gotonextsubpage % nog eens: als in pagina (tbv standaard opmaak) + \dontshowboxes % dan hier blokkeren en verderop resetten \naastpagina \checkreferences \checkmargeblokken @@ -2763,31 +2773,10 @@ \def\dooutput% {\finaloutput\unvbox\normalpagebox} +\maxdeadcycles=1000 + \output={\dooutput} -%I n=Beeldmerken -%I c=\definieerbeeldmerk,\plaatsbeeldmerken -%I -%I In het hoofd of in de voet kan een logo worden gezet met -%I het commando: -%I -%I \plaatsbeeldmerken[naam] -%I -%I Plaatsen kan dan ook pas nadat een beeldmerk is gedefinieerd: -%I -%I \definieerbeeldmerk[naam][lokatie][plaats][commando=,status=] -%I -%I waarbij status 'start' of 'stop' kan zijn. In geval van -%I 'start' wordt op elke bladzijde het logo geplaatst. -%I -%I Mogelijke lokaties zijn 'boven', 'hoofd', 'voet' en 'onder' en -%I als plaats kan worden opgegeven 'linkerrand', 'linkermarge', -%I 'links', 'midden', 'rechts', 'rechtermarge' en 'rechterrand'. -%I -%I Logo's worden boven, onder of in de hoofd- of voetregel gezet, -%I zo hoog of laag mogelijk. Verdere positionering zal dus in -%I het commando moeten plaatsvinden! - \newbox\leftlogos \newbox\rightlogos @@ -2930,38 +2919,6 @@ {\copy\rightlogos}% \fi} -%I n=Spatiering -%I c=\stelspatieringin -%I c=\omlaag,\opelkaar,\spatie,\vastespaties -%I -%I De ruimte na interpunctie worden ingesteld met: -%I -%I \stelspatieringin[instelling] -%I -%I waarbij de volgende instellingen mogelijk zijn: -%I -%I ruim flexibele ruimte na interpunctie -%I opelkaar een spatie na interpunctie -%I -%I Bij een smalle layout levert de instelling 'ruim' minder -%I in de marge uitstekende (niet af te breken) woorden op. -%I -%P -%I Andere commando's zijn: -%I -%I \omlaag[afstand] een vaste afstand omlaag -%I \opelkaar ruimte tussen regels weghalen -%I -%I \spatie een (harde) spatie -%I \geenspatie geen vorige/volgende spatie -%I -%I \hfil \hfill \hfilll opvullen met horizontaal wit -%I \vfil \vfill \vfilll opvullen met vertikaal wit -%I -%I \strut karakter-box zonder breedte -%I -%I \vastespaties geeft ~ de breedte van een cijfer - % \frenchspacing leidt soms tot afbreken tussen -, vandaar % de variant \newfrenchspacing. @@ -3010,51 +2967,6 @@ {\nointerlineskip \vskip#1 } -%I n=Witruimte -%I c=\stelwitruimtein,\witruimte,\geenwitruimte -%I c=\startopelkaar,\startvanelkaar -%I c=\startregelcorrectie,\corrigeerwitruimte -%I -%I De afstand tussen paragrafen is in te stellen met: -%I -%I \stelwitruimtein[maat] -%I -%I In te vullen op de plaats van 'maat' (12pt, 1cm) of een -%I van de aanduidingen klein, middel of groot. Als niets -%I wordt meegegeven, dus alleen \stelwitruimtein, dan -%I wordt de ingestelde witruimte aangepast aan het formaat -%I letter. -%I -%I Voor elke lege regel in de ASCII-file voegt TEX de -%I ingestelde witruimte tussen. -%I -%I Het commando \witruimte dwingt witruimte af en het -%I commando \geenwitruimte maakt witruimte ongedaan. -%I -%I Behalve met de hier beschreven witruimte-commando's is de -%I witruimte tussen paragrafen te be‹nvloeden met behulp van -%I de elders beschreven blanko-commando's. -%P -%I Een stuk tekst kan zonder witruimte worden gezet door het -%I tussen de volgende commando's op te nemen: -%I -%I \startopelkaar -%I \stopopelkaar -%I -%I Waarbij een optioneel argument [blanko] mogelijk is. De -%I tegenhanger hiervan is: -%I -%I \startvanelkaar -%I \stopvanelkaar -%P -%I TeX handelt de interlinie van een (omlijnde) box of een -%I rule anders af dan van een regel tekst. In dergelijke -%I gevallen kan de volgende constructie worden gebruikt: -%I -%I \startregelcorrectie -%I \omlijnd{tekst} -%I \stopregelcorrectie - \newskip\tussenwit \tussenwit=\!!zeropoint @@ -3246,27 +3158,6 @@ \stopbaselinecorrection}% \vbox} -%I n=Regelafstand -%I c=\stelinterliniein -%I -%I De regelafstand is in te stellen met het commando: -%I -%I \stelinterliniein[factor] -%I -%I Invulmogelijkheden voor 'factor' zijn: klein (1.00), -%I middel (1.25), groot (1.50) of een getal. OOk kan -%I aan of uit worden opgegeven. -%I -%I Als het commando zonder [factor] wordt gegeven, dan -%I worden de interlinie aangepast aan het formaat van het -%I actuele letterformaat. Een aan het formaat aangepaste -%I interlinie kan ook worden ingesteld met: -%I -%I \stelinterliniein[reset,factor] -%I -%I In z'n eenvoudigste vorm \stelinterliniein wordt de -%I interlinie aangepast aan het formaat letter. - %D There are two ways to influence the interline spacing. The %D most general and often most consistent way is using %D @@ -3323,11 +3214,12 @@ \let\@@itdiepte=\strutdepthfactor \else \let\strutheightfactor=\@@ithoogte - \let\strutdepthfactor =\@@itdiepte + \let\strutdepthfactor=\@@itdiepte \fi - \let\normallineheight=\@@itregel - \let\topskipfactor =\@@itboven - \let\maxdepthfactor =\@@itonder + \let\minimallinedistance=\@@itafstand + \let\normallineheight=\@@itregel % let ! ! ! ! ! ivm ex + \let\topskipfactor=\@@itboven + \let\maxdepthfactor=\@@itonder \setfontparameters % redundant \setstrut \updateraggedskips} % yes indeed {\processallactionsinset % \regelwit = dummy ! @@ -3346,65 +3238,6 @@ \definecomplexorsimple\stelinterliniein -%I n=Blanko -%I c=\blanko,\geenblanko,\stelblankoin -%I c=\startregelcorrectie -%I -%I Behalve met de hier beschreven blanko-commando's is de -%I witruimte tussen paragrafen te be‹nvloeden met behulp van -%I de elders beschreven witruimte-commando's. -%I -%I Het commando -%I -%I \blanko[sprong] -%I -%I voegt witruimte tussen paragrafen toe. -%I -%I Mogelijke instellingen voor 'sprong' zijn: terug, klein, -%I middel, groot. Per blanko is elke combinatie van -%I instellingen toegestaan. Ook een veelvoud van een instelling -%I is mogelijk. Enkele voorbeelden: -%I -%I \blanko[terug,3*groot] -%I \blanko[klein,middel] -%P -%I Naast de genoemde instellingen zijn enkele bijzondere -%I instellingen mogelijk: -%I -%I wit tussenvoegen van \witruimte -%I geenwit terugspringen van \witruimte -%I blokkeer overslaan van de volgende \blanko -%I reset opheffen van \blanko[blokkeer] -%I forceer afdwingen van een blanko (bovenaan) -%I -%I Ook deze instellingen zijn in combinatie met andere te -%I gebruiken. Een voorbeeld: \blanko[forceer,wit,2*middel]. -%I -%I Het commando \blanko (zonder instelling) is gelijk aan -%I \blanko[groot]. -%I -%I Het commando \geenblanko maakt het commando \blanko -%I ongedaan. -%P -%I Met het commando's -%I -%I \stelblankoin[maat] -%I -%I is het mogelijk de spronggrootte in te stellen. De maat -%I kan worden opgegeven in getallen en eenheden (12pt, 1cm). -%I De standaard instellingen krijgt met met 'normaal', -%I regelafstanden met 'regel'. -%I -%I Het commando \stelblankoin (zonder argument) past de sprong -%I aan het formaat letter aan. -%P -%I Rond omlijnde tekst, of algemener: rond lijnen, wordt -%I geen witruimte gegenereerd. Wil men dit wel, dan dient men -%I de betreffende tekst te omringen met: -%I -%I \startregelcorrectie -%I \stopregelcorrectie - % In earlier versions \type{\bigskipamount} was % \type{\ht\strutbox} and the stretch was plus or minus % \type{.4\dp\strutbox}. Don't ask me why. The most recent @@ -3528,6 +3361,7 @@ \par \ifvmode \ifblankoforceer\ifdim\prevdepth>\!!zeropoint\else + % -1000pt signals top of page or column (\ejectcolumn) \vbox{\strut}\kern-\lineheight \fi\fi \ifblankoblokkeer @@ -3763,34 +3597,15 @@ \noexpand\blankoflexibelfalse \fi}} +\def\inhibitblank% the fast, local way + {\endgraf\ifvmode\prevdepth\newprevdepth\fi} + %D Now. \definieerblanko [\s!default] [\v!wit] -%I n=Inspringen -%I c=\inspringen,\nietinspringen,\welinspringen -%I c=\stelinspringenin -%I -%I Het inspringen van de eerste regel van een paragraaf -%I wordt ingesteld met het commando: -%I -%I \inspringen[parameter] -%I -%I waarbij als parameter kan worden meegegeven: -%I -%I niet de volgende paragraaf niet inspringen -%I nooit de volgende paragrafen niet inspringen -%I altijd de volgende paragrafen inspringen -%I -%I De mate van inspringen wordt ingesteld met: -%I -%I \stelinspringenin[maat] -%I -%I waarbij maat staat voor een TeX-maat of het woord klein, -%I middel, groot of geen. - \let\currentvoorwit=\empty \newdimen\voorwit @@ -3834,37 +3649,6 @@ \def\nietinspringen{\inspringen[\v!nee,\v!volgende]} \def\welinspringen {\inspringen[\v!ja,\v!eerste]} -%I n=Positioneren -%I c=\startpositioneren,\stelpositionerenin -%I -%I Er kan (binnen zekere grenzen) gepositioneerd worden met -%I de commando's: -%I -%I \startpositioneren -%I \stoppositioneren -%I -%I met daartussen -%I -%I \positioneer(x,y){...} -%I -%I waarbij x en y alleen getallen worden ingevuld. Ongewenste -%I spaties moeten zonodig met worden voorkomen met een %-teken. -%P -%I Een en ander kan worden ingesteld met: -%I -%I \stelpositionerenin[eenheid=,factor=,schaal=,xstap=, -%I ystap=,xoffset=,yoffset=,offset=] -%I -%I Standaard is de eenheid cm en de factor 1. Mogelijke -%I stapaanduidingen zijn 'absoluut' en 'relatief'. Deze -%I instellingen kunnen \resetpositioneren worden hersteld. -%I -%I Als men negatieve coordinaten (of een negatieve offset) -%I gebruikt, dan kan het soms wenselijk zijn het nulpunt te -%I laten samenvallen met de linkerbovenhoek van de omringende -%I box. In dat geval kan met offset=nee instellen. De negatieve -%I posities vallen in dat geval buiten de box. - % Het gebruik van \skip's spaart \dimen's. \newskip\xpositie @@ -3924,7 +3708,7 @@ \resetpositioneren \def\stelpositionerenin% - {\resetpositioneren% + {\resetpositioneren \dodoubleargument\getparameters[\??ps]}% % \def\positioneer(#1,#2)#3% \nextbox @@ -3981,50 +3765,32 @@ \def\dopositioneer[#1]#2(#3,#4)% {\dowithnextbox {\bgroup - \stelpositionerenin[#1]% + \getparameters[\??ps][#1]% \dontcomplain \berekenpositioneren{#3}{\@@psxstap}{\xpositie} {\@@psxoffset}{\wd\nextbox}{\xafmeting}{\xoffset} {\@@psxschaal}{\@@psxfactor}% - \scratchdimen=\ht\nextbox \advance\scratchdimen \dp\nextbox + \scratchdimen=\ht\nextbox \advance\scratchdimen by \dp\nextbox \berekenpositioneren{#4}{\@@psystap}{\ypositie} {\@@psyoffset}{\scratchdimen}{\yafmeting}{\yoffset} {\@@psyschaal}{\@@psyfactor}% - \setbox\nextbox=\hbox - {\hskip\xpositie\lower\ypositie\box\nextbox}% - \smashbox\nextbox - \box\nextbox + \vbox to \!!zeropoint % kan beter. + {\vskip\ypositie + \hbox to \!!zeropoint + {\hskip\xpositie + \box\nextbox + \hskip-\xpositie}% + \vskip-\ypositie}% + \xdef\dopoppositioneer% + {\xpositie=\the\xpositie + \ypositie=\the\ypositie + \noexpand\def\noexpand\@@psxoffset{\@@psxoffset}% + \noexpand\def\noexpand\@@psyoffset{\@@psyoffset}}% \egroup + \dopoppositioneer \ignorespaces} \hbox} -%I n=Kolommen -%I c=\stelkolommenin,\startkolommen,\kolom -%I -%I Tekst kan in kolommen worden gezet. Het aantal kolommen -%I en het al dan niet opnemen van een vertikale lijn kan -%I worden ingesteld. -%I -%I \stelkolommenin[n=,lijn=,tolerantie=,afstand=, -%I balanceren=,uitlijnen=,hoogte=] -%I -%I Hierin staat n voor het aantal kolommen. Aan lijn -%I kan aan of uit worden toegekend. Aan voor en na kan -%I een commando worden toegekend, bijvoorbeeld ~~. -%I -%I Mogelijke waarden voor de tolerantie zijn: zeerstreng, -%I streng, soepel en zeersoepel. -%P -%I De in kolommen te zetten tekst moet worden opgenomen -%I tussen de commando's: -%I -%I \startkolommen -%I \stopkolommen -%I -%I Er wordt naar een nieuwe kolom gesprongen met: -%I -%I \kolom - \newif\ifbinnenkolommen \newif\if@@klbalanceren \newif\if@@kluitlijnen @@ -4143,30 +3909,60 @@ \definecomplexorsimpleempty\startkolommen +%\def\kolom% +% {\ifbinnenkolommen +% \ejectcolumn +% \fi} + +\def\preferredejectcolumn% + {\goodbreak} + +% \def\forcedejectcolumn% +% {\vfil +% \penalty-200 +% \prevdepth=-1000pt % signals top of column to \blanko +% \vfilneg} + +\def\forcedejectcolumn% + {\par % todo: since + {\testrulewidth\!!zeropoint\ruledvskip\teksthoogte} % we misuse a + \penalty-200 % side effect + \vskip-\teksthoogte + \prevdepth=-1000pt} % signals top of column to \blanko + \def\kolom% + {\dosingleempty\dokolom} + +\def\dokolom[#1]% {\ifbinnenkolommen - \ejectcolumn + \iffirstargument + \processaction + [#1] + [ \v!ja=>\forcedejectcolumn, + \v!voorkeur=>\preferredejectcolumn]% + \else + \preferredejectcolumn + \fi \fi} -%I n=Kader -%I c=\toonkader,\tooninstellingen,\toonlayout -%I -%I Met behulp van de drie commando's: -%I -%I \toonkader -%I \tooninstellingen -%I -%I kan de zetspiegel zichtbaar worden gemaakt, of eventueel -%I met: -%I -%I \toonkader [rand,tekst,marge] -%I -%I Het commando: -%I -%I \toonlayout -%I -%I genereert enkele (linker en rechter) pagina's. +%D Undocumented and still under development. + +\def\startsimplecolumns% + {\dosingleempty\dostartsimplecolumns} + +\def\dostartsimplecolumns[#1]% + {\bgroup + \getparameters[\??kl][\c!breedte=\hsize,\c!afstand=1em,\c!n=2,#1]% + \setrigidcolumnhsize\@@klbreedte\@@klafstand\@@kln + \setbox\scratchbox=\vbox\bgroup + \forgetall} % \blanko[\v!blokkeer] +\def\stopsimplecolumns% + {\removebottomthings + \egroup + \rigidcolumnbalance\scratchbox + \egroup} + \def\dotoonkader[#1][#2]% {\ifsecondargument \stelachtergrondenin @@ -4410,58 +4206,6 @@ \herhaal[4*\tooninstellingen\pagina] \egroup} -%I n=Uitlijnen -%I c=\startuitlijnen,\steluitlijnenin,\steltolerantiein -%I c=\regellinks,\regelrechts,\regelmidden, -%I c=\woordrechts -%I -%I De regelval kan worden ingesteld met: -%I -%I \steluitlijnenin[instelling] -%I -%I waarbij de volgende instellingen mogelijk zijn: -%I -%I links links niet uitvullen -%I midden links/rechts niet uitvullen = centreren -%I rechts rechts niet uitvullen -%I breedte uitvullen over breedte (default) -%I beide wisselend (afhankelijk bladzijde) -%I onder onderkant niet uitgelijnd (default) -%I hoogte uitvullen over hoogte (op baseline) -%I regel uitvullen over hoogte (binnen kader) -%I reset uitvullen over breedte en hoogte -%I -%I In combinatie met links, midden en rechts kan 'ruim' -%I worden opgegeven. -%P -%I Aanvullend zijn de volgende commando's beschikbaar: -%I -%I \startuitlijnen[instelling] -%I \stopuitlijnen -%I -%I Een regel kan op verschillende manieren worden uitgelijnd -%I met behulp van de commando's: -%I -%I \regellinks{tekst} -%I \regelrechts{tekst} -%I \regelmidden{tekst} -%I -%I Aan het eind van een paragraaf kan een stukje tekst -%I worden geplaatst met: \woordrechts{ziezo} -%P -%I De tolerantie waarbinnen het uitlijnen plaatsvindt kan -%I worden ingesteld met: -%I -%I \steltolerantiein[instelling] -%I -%I Mogelijke waarden zijn: zeerstreng, streng, soepel en -%I zeersoepel. -%I -%I Standaard heeft de tolerantie betrekking op horizontaal -%I uitlijnen. Vertikaal kan het uitlijnen worden beinvloed -%I door het trefwoord 'vertikaal' mee te geven. Standaard -%I geldt [vertikaal,streng] en [horizontaal,zeerstreng]. - \definetwopasslist{\s!paragraph} \newcounter\nofraggedparagraphs @@ -4493,6 +4237,8 @@ #2\relax \fi} +% \let\doifrightpageelse\setraggedparagraphmode + % De onderstaande macro's zijn opgenomen in Plain TeX. % % \def\raggedright% @@ -4511,28 +4257,52 @@ % % en worden hieronder wat aangepast. +% the three boolean will become obsolete some day in favour +% of \bottomraggedness + +\chardef\bottomraggedness=0 % 0=ragged 1=normal/align 2=baseline + +\def\bottomalignlimit{3\lineheight} + \newif\ifn@rmalbottom \newif\ifr@ggedbottom \newif\ifb@selinebottom -\def\normalbottom% - {\n@rmalbottomtrue - \r@ggedbottomfalse +\def\raggedbottom% + {\chardef\bottomraggedness=0 + \n@rmalbottomfalse + \r@ggedbottomtrue \b@selinebottomfalse \settopskip} -\def\raggedbottom% - {\n@rmalbottomfalse - \r@ggedbottomtrue +\def\alignbottom% + {\chardef\bottomraggedness=1 + \n@rmalbottomtrue + \r@ggedbottomfalse \b@selinebottomfalse \settopskip} \def\baselinebottom% - {\n@rmalbottomfalse + {\chardef\bottomraggedness=2 + \n@rmalbottomfalse \r@ggedbottomfalse \b@selinebottomtrue \settopskip} +\let\normalbottom=\alignbottom % downward compatible + +% so, the new one will be +% +% \chardef\bottomraggedness=0 % 0=ragged 1=normal/align 2=baseline +% +% \def\bottomalignlimit{3\lineheight} % will be settable +% +% \def\raggedbottom {\chardef\bottomraggedness=0 \settopskip} +% \def\alignbottom {\chardef\bottomraggedness=1 \settopskip} +% \def\baselinebottom{\chardef\bottomraggedness=2 \settopskip} +% +% \let\normalbottom =\alignbottom + % \hyphenpenalty = ( 2.5 * \hsize ) / \raggedness % \tolerance >= 1500 % was 200 % \raggedness = 2 .. 6\korpsgrootte @@ -4543,14 +4313,33 @@ \def\rightraggedness {2\bodyfontsize} \def\middleraggedness {6\bodyfontsize} +%D More hyphenation control, will be combined with align +%D setup. + +\def\nohyphens% + {\ifx\dohyphens\relax + \edef\dohyphens% + {\hyphenpenalty\the\hyphenpenalty + \exhyphenpenalty\the\exhyphenpenalty\relax}% + \fi + \hyphenpenalty\@M + \exhyphenpenalty\@M} + +\let\dohyphens\relax + +%D To prevent unwanted side effects, we also have to check +%D for hyphens here: + \def\setraggedness#1% {\ifnum\tolerance<1500\relax % small values have \tolerance=1500\relax % unwanted side effects - \fi % - \spaceskip=2.5\hsize % we misuse these - \xspaceskip=#1\relax % registers for temporary - \divide\spaceskip by \xspaceskip % storage; they are - \hyphenpenalty=\spaceskip} % changed anyway + \fi + \spaceskip=2.5\hsize % we misuse these registers + \xspaceskip=#1\relax % for temporary storage; + \divide\spaceskip by \xspaceskip % they are changed anyway + \ifx\dohyphens\relax + \hyphenpenalty=\spaceskip % \else no hyphens is active + \fi} \let\updateraggedskips\relax @@ -4639,6 +4428,10 @@ \v!rechts=>\if!!donea\veryraggedright \else\raggedright \fi, \v!midden=>\if!!doneb\raggedwidecenter\else \if!!donea\veryraggedcenter\else\raggedcenter\fi\fi, + \v!hangend=>\enableprotruding, + \v!niethangend=>\disableprotruding, + \v!afgebroken=>\dohyphens, +\v!nietafgebroken=>\nohyphens, \v!reset=>\notragged\normalbottom]} \def\dosteluitlijnenin[#1]% @@ -4726,90 +4519,6 @@ \def\woordrechts% {\groupedcommand{\hfill\hbox}{\parfillskip\!!zeropoint}} -%I n=Margeteksten -%I c=\inmarge,\inlinker,\inrechter,\stelinmargein -%I c=\margetitel,\figuurinmarge -%I c=\oplinker -%I -%I Een paragraaf kan worden ingeluid met een tekst in -%I de marge: -%I -%I \inmarge{tekst} -%I \inlinker{tekst} -%I \inrechter{tekst} -%I -%I Met \\ kan binnen een margetekst naar een volgende regel -%I worden gesprongen. -%P -%I Het onderstaande commando kan gebruikt worden om een -%I paragraafaanduiding in de marge te plaatsen. Het commando -%I moet aan het begin van de paragraaf staan. Er wordt -%I gecontroleerd of een en ander nog op de bladzijde past. -%I -%I \margetitel{tekst} -%I -%I Tussen \margetitel{tekst} en de volgende alinea mag, -%I omwille van de overzichtelijkheid, een lege regels staan. -%I Als dit commando wordt gebruikt na een commando als -%I \paragraaf, kan het controlemechanisme leiden tot een -%I ongewenste overgang naar een nieuwe bladzijde. In dat -%I geval kan beter het volgende commando worden gebruikt. -%I -%I \margewoord{tekst} -%I -%I Dit commando komt overeen met \inmarge, alleen is bij -%I \margewoord de lege regel toegestaan. -%P -%I Er kan eventueel voor {tekst} een [referentie] worden -%I meegegeven. In dat geval kan worden verwezen naar het -%I paginanummer waarop het margewoord staat. -%I -%I Als TeX twijfelt in welke marge het woord moet staan, is -%I een tweede verwerkingsslag nodig. Als een margewoord bij -%I herhaling verkeerd wordt geplaatst, dan kan het -%I automatisme worden verstoord door [+] mee te geven. Een -%I margewoord kan lager worden gezet met [laag]. Combinaties -%I kunnen ook: -%I -%I \margewoord[+,laag][referentie]{woord} -%P -%I De wijze van weergeven kan worden ingesteld met het -%I commando: -%I -%I \stelinmargein[letter=,plaats=,voor=,na=,uitlijnen=] -%I -%I Als plaats kan links, rechts of beide worden meegegeven. In -%I het laatste geval hangt de plaats af van het -%I enkel/dubbelzijdig zetten. -%I -%I Uitlijnen kent twee instellingen: 'ja' en 'nee'. Inhet -%I eerste geval (default) worden de margewoorden tegen de -%I kantlijn geplaatst. -%P -%I Vooruitlopend op meer commando's is er al vast het -%I commando: -%I -%I \oplinker{tekst} -%I -%I Dit commando kan bijvoorbeeld worden gebruikt binnen -%I een midden-uitgelijnde tekst. Het commando is nog niet -%I definitief en robuust. - -% %P -% %I Aanvullend zijn commando's beschikbaar om figuren in -% %I de marge te plaatsen: -% %I -% %I \figuurinmarge{figuur} -% %I \figuurinlinker{figuur} -% %I \figuurinrechter{figuur} - -%T n=margetitel -%T m=mar -%T a=m -%T -%T \margetitel{?} -%T - \newif\iflowinmargin \def\stelinmargein% @@ -4856,6 +4565,11 @@ \ifnum\margetekstnummer=0 \def\margetekstnummer{#2}% \fi +\doifnumberelse{\margetekstnummer} + {\ifnum\margetekstnummer>25 % to be translated + \writestatus{\m!systems}{potential margin stack overflow (\margetekstnummer)}% + \fi} + {}% \processaction [\getvalue{\??im\margetekstnummer\c!uitlijnen}] [ \v!ja=>\setvalue{\??im\margetekstnummer\c!uitlijnen}{#2}, @@ -4925,7 +4639,16 @@ \ht0=\!!zeropoint \dp0=\!!zeropoint \gdef\margestrutheight{\the\ht\strutbox}% - \vadjust{\box0}} + %\vadjust{\box0}} % fails in high math lines, let it be + %\hbox{\lower\dp\strutbox\box0}} % alas, wrong lapping, therefore useless + \dopositionmarginbox0} + +%D This approach permits us to implement a better mechanism +%D later. + +\ifx\dopositionmarginbox\undefined + \def\dopositionmarginbox#1{\vadjust{\box#1}} +\fi \def\doinlinker#1% {\doplacemargintext @@ -5037,6 +4760,41 @@ \expandafter\doflushmargincontents % speed up the \fi scan by \fi} % using a \do.. +% \def\doflushmargincontents% % links + rechts +% {\bgroup +% \forgetall +% \global\marginheight\!!zeropoint +% \dorecurse{\margincontent} +% {\bgroup +% \edef\margetekstafstand {\getvalue{\??im\recurselevel\c!afstand}}% +% \edef\margetekstregels {\getvalue{\??im\recurselevel\c!regel}}% +% \edef\margetekstscheider{\getvalue{\??im\recurselevel\c!scheider}}% +% \let\margetekstnummer=\recurselevel +% \getvalue{\??im\recurselevel}% +% \global\setvalue{\??im\recurselevel}{}% +% \egroup}% +% \ifdim\marginheight>\lineheight % This is something real dirty! +% \advance\marginheight by \pagetotal +% \advance\marginheight by \lineheight % a sort of bonus +% \ifdim\marginheight>\pagegoal +% \xdef\restoreinterlinepenalty% +% {\global\let\restoreinterlinepenalty\relax +% \global\interlinepenalty=\the\interlinepenalty}% +% \global\interlinepenalty=10000 +% \fi +% \else % We need the above because interlinepenalties overrule vadjusted \nobreaks. +% %\vadjust +% % {\forgetall +% % \global\advance\marginheight by \lineheight +% % \global\divide\marginheight by \lineheight +% % \dorecurse{\number\marginheight} +% % {\nobreak\vskip\lineheight}% +% % \kern-\number\marginheight\lineheight}% +% \vadjust{\nobreak}% +% \fi +% \doglobal\newcounter\margincontent +% \egroup} + \def\doflushmargincontents% % links + rechts {\bgroup \forgetall @@ -5050,7 +4808,14 @@ \getvalue{\??im\recurselevel}% \global\setvalue{\??im\recurselevel}{}% \egroup}% - \ifdim\marginheight>\lineheight % This is something real dirty! +\ifbinnenkolommen + \donetrue % how fuzzy +\else\ifdim\marginheight>\lineheight\relax + \donetrue % how dirty +\else + \donefalse % how needed +\fi\fi +\ifdone \advance\marginheight by \pagetotal \advance\marginheight by \lineheight % a sort of bonus \ifdim\marginheight>\pagegoal @@ -5072,6 +4837,8 @@ \doglobal\newcounter\margincontent \egroup} +% Some day: \definieermarkering[\v!margetitel] + \def\docomplexmargewoord#1#2#3% {\@EA\setgvalue\@EA{\@EA\??im\@EA\margincontent\@EA}\@EA {\@EA\stelinmargein\@EA[\margincontent][]% see next macro @@ -5247,40 +5014,6 @@ {\doquintupleempty\doinmarge [\@@implaats][\woordinlinker][\woordinrechter]} -%I n=Paginanummer -%I c=\stelpaginanummerin,\stelsubpaginanummerin -%I -%I Het paginanummer kan worden ingesteld met het commando: -%I -%I \stelpaginanummerin[nummer=,status=] -%I -%I Het nummeren kan gedurende een of meerdere pagina's worden -%I stilgezet door in plaats van een nummer start, stop of -%I handhaaf mee te geven. -%I -%I Het paginanummer is oproepbaar met: -%I -%I \paginanummer -%I -%I en het totaal aantal paginanummers met: -%I -%I \totaalaantalpaginas -%P -%I Er zijn subnummers beschikbaar. De wijze van nummeren -%I wordt ingesteld met: -%I -%I \stelsubpaginanummerin[wijze=,status=] -%I -%I De status kan 'stop', 'start' of 'geen' zijn. In het -%I laatste geval wordt gewoon doorgenummerd, maar wordt het -%I nummer niet geplaatst. -%I -%I Standaard wordt 'perdeel' genummerd. De subnummers zijn -%I oproepbaar met: -%I -%I \subpaginanummer -%I \aantalsubpaginas - % Standaard is \count0 in Plain TeX de paginateller. Omwille % van de afhandeling van lokaal nummeren, definieren we % echter een eigen nummer. @@ -5292,12 +5025,17 @@ \c!status=\@@nmstatus, \c!start=1] +% \@@pnstatus global, but \@@nmstatus local and only start/stop + +\global\let\@@pnstatus\@@pnstatus + \def\dostelpaginanummerin[#1]% {\getparameters [\??pn] - [\c!status=\v!start, + [%\c!status=\v!start, \c!nummer=, #1]% + \global\let\@@pnstatus\@@pnstatus \doifsomething{\@@pnnummer} {\setnummer[\s!page]{\@@pnnummer}% \setuserpageno{\ruwenummer[\s!page]}}} @@ -5306,45 +5044,20 @@ {\dosingleargument\dostelpaginanummerin} \def\verlaagpaginanummer% - {\doif{\@@pnstatus}{\v!start} + {\doifinset{\@@pnstatus}{\v!start,\v!leeg,\v!geen} {\verlaagnummer[\s!page]% \setuserpageno{\ruwenummer[\s!page]}}} \def\verhoogpaginanummer% - {\processaction - [\@@pnstatus] - [ \v!start=>{\verhoognummer[\s!page]% - \setuserpageno{\ruwenummer[\s!page]}}, - \v!handhaaf=>{\doassign[\??pn][\c!status=\v!start]}]} + {\doifinset{\@@pnstatus}{\v!start,\v!leeg,\v!geen} + {\verhoognummer[\s!page]% + \setuserpageno{\ruwenummer[\s!page]}}% + \doifinset{\@@pnstatus}{\v!handhaaf,\v!leeg} + {\global\let\@@pnstatus\v!start}} \def\checkpagecounter% {\checknummer{\s!page}} -%I n=Pagina -%I c=\pagina -%I -%I Het volgende commando kan worden gebruikt om pagina's af -%I te dwingen of blokkeren: -%I -%I \pagina[instelling] -%I -%I Waarbij als instelling kan worden gegeven: -%I -%I ja een geforceerde paginaovergang met \vfill -%I opmaak een geforceerde paginaovergang zonder \vfill -%I nee bij voorkeur geen paginaovergang -%I voorkeur bij voorkeur de paginaovergang hier (3) -%I grotevoorkeur bij voorkeur de paginaovergang hier (7) -%I links ga naar een linker pagina -%I rechts ga naar een rechter pagina -%I leeg een lege pagina -%I blokkeer blokkeer ja ... grotevoorkeur (1 pagina) -%I reset het blokkering ja ... grotevoorkeur op -%I -%I Als geen instelling wordt meegegeven (\pagina), wordt een -%I overgang geforceerd. Als een nummer wordt meegegeven, wordt -%I naar de opgegeven pagina gegaan. - \newif\ifpaginageblokkeerd \paginageblokkeerdfalse @@ -5405,11 +5118,11 @@ \fi \fi}, \v!grotevoorkeur=>{\ifpaginageblokkeerd\else - \ifbinnenkolommen - \dosomebreak\goodbreak - \else - \testpagina[5][\!!zeropoint]% - \fi + \ifbinnenkolommen + \dosomebreak\goodbreak + \else + \testpagina[5][\!!zeropoint]% + \fi \fi}, \v!leeg=>{\ejectinsert \ejectpage @@ -5524,146 +5237,6 @@ \global\rightpagetrue \fi} -%I n=Hoofdteksten -%I c=\stelnummeringin -%I c=\stelhoofdtekstenin,\stelvoettekstenin,\stelhoofdin,\stelvoetin -%I c=\stelboventekstenin,\stelondertekstenin,\stelbovenin,\stelonderin -%I -%I Zogeheten hoofd- en/of voetteksten kan men instellen -%I met: -%I -%I \stelhoofdtekstenin [linker tekst] [rechter tekst] -%I \stelvoettekstenin [linker tekst] [rechter tekst] -%I -%I Bij dubbelzijdig zetten worden de linker en rechter -%I teksten gespiegeld. -%I -%I In plaats van een tekst kunnen de woorden 'hoofdstuk', -%I 'paragraaf' en 'deel' worden meegegeven. Ook kan het -%I woord 'datum' worden meegegeven. -%P -%I Als men op de even en oneven pagina's een andere tekst -%I wil hebben, dan kan men een tweede paar meegeven. In dat -%I geval zijn er dus vier argumenten: [][][][]. -%I -%I Als men in de marge of randen teksten wil, kan men dat -%I direct achter het commando aangeven: -%I -%I \stelhoofdtekstenin [lokatie] [links] [rechts] -%I \stelvoettekstenin [lokatie] [links] [rechts] -%I -%I Mogelijke lokaties zijn: tekst, marge en rand. -%P -%I In de tekst opgenomen commando's kunnen soms voor -%I problemen zorgen. Commando's kan men daarom laten -%I voorafgaan \geentest, bijvoorbeeld: -%I -%I \stelvoettekstenin[\geentest\lastigcommando][] -%I -%I Meestal geven commando's geen problemen. Wel moet men -%I oppassen met []. Accolades zijn hiervoor de oplossing: -%I -%I \stelvoettekstenin[{{\huidigedatum[mm,/,jj]}}][] -%I -%I of -%I -%I \stelvoettekstenin[\geentest{\huidigedatum[mm,/,jj]}][] -%P -%I De wijze van nummeren wordt gedefinieerd met: -%I -%I \stelnummeringin[variant=,plaats=,conversie=, -%I links=,rechts=,tekst=,tekstscheider=,nummerscheider, -%I wijze=,blok=,status=,letter=,nummer=,commando=] -%I -%I De plaats van het nummer hangt af van het eerste -%I meegegeven argument: -%I -%I enkelzijdig dubbelzijdig -%I -%I links, rechts kantlijn (links of rechts) -%I marge marge (links of rechts) -%I midden midden -%I inlinker, inrechter inlinker, inrechter -%P -%I Met plaats geeft men tevens aan of het nummer in het hoofd -%I of in de voet komt {hoofd,midden}. Met 'nummerscheider' geeft -%I men aan wat er binnen een (eventueel) samengestelde nummer -%I als scheider wordt gezet, standaard: 2-3. Met 'tekstscheider' -%I geeft men aan wat er tussen het paginanummer en een hoofd- of -%I voettekst wordt gezet (in geval van plaatsen op de marge). -%I -%I Liefhebbers kunnen aan 'commando' een eigen commando om het -%I nummer te zetten meegeven. Dit eigen commando krijgt als -%I argument het paginanummer mee. -%I -%I Het is mogelijk een dubbelzijdige tekst met enkelzijdige -%I marges te zetten: -%I -%I \stelnummeringin[variant={enkelzijdig,dubbelzijdig}] -%I -%I In dit geval worden de hoofd- en voetregels dus wel -%I gespiegeld en hebben commando's als \pagina[rechts] betekenis. -%P -%I Als 'conversie' is mogelijk: cijfers, letters, Letters, -%I romeins en Romeins. Als 'status' kan 'start' of 'stop' -%I worden meegegeven. Op deze manier kan het aangeven van -%I een paginanummer worden aan- en uitgezet. -%I -%I Er kan per sectienummer (deelnummer, hoofdstuknummer enz.) -%I worden ingesteld of het zichtbaar is ('ja' of 'nee'). -%I -%I Mogelijke wijzen van nummeren zijn: perdeel of perhoofdstuk. -%P -%I Hoofd- en voetregels blijven achterwege of juist niet na het -%I commando: -%I -%I \geenhoofdenvoetregels -%I \welhoofdenvoetregels -%I -%I of na: -%I -%I \stelhoofdin[lokatie][linkerletter=,rechterletter=, -%I letter=,linkerbreedte=,rechterbreedte=,voor=,na=] -%I \stelvoetin[locatie][linkerletter=,rechterletter=, -%I letter=,linkerbreedte=,rechterbreedte=,voor=,na=] -%I -%I mogelijke lokaties zijn: tekst, marge en rand. Als [lokatie] -%I wordt wegelaten, dan wordt tekst verondersteld. -%I -%I Als de breedte wordt ingesteld, dan wordt de weergegeven -%I tekst zonodig ingekort en gevolgd door ... -%P -%I Het is mogelijk het plaatsen van hoofd- en voetregels -%I stop te zetten: -%I -%I \stelhoofdin[status=] -%I \stelvoetin[status=] -%I -%I Aan status kunnen de olgende aarden worden toegekend: -%I -%I geen de kop/voet vervalt (de tekst schuift omhoog) -%I leeg de kop/voet blijft 1 pagina leeg -%I hoog de kop/voet vervalt 1 pagina leeg (idem) -%I normaal de kop/voet wordt gezet -%I stop de kop/voet blijft vanaf nu leeg -%I start de kop/voet wordt vanaf nu weer gevuld -%I -%I Het is ook mogelijk bij \stelhoofdin en \stelvoetin als -%I parameters [voor=] en [na=] mee te geven. De toegekende -%I commando's worden in dat geval voor en na het hoofd en de -%I de voet uitgevoerd. -%P -%I Boven het hoofd en onder de voet is ook ruimte. Deze kan -%I worden gedefinieerd met vergelijkbare commando's: -%I -%I \stelboventekstenin[...][...][...] -%I \stelondertekstenin[...][...][...] -%I -%I \stelbovenin[...] -%I \stelonderin[...] -%I -%I \geenbovenenonderregels -%I \welbovenenonderregels % De onderstaande macro's lijken op het eerste gezicht vrij % ingewikkeld en omslachtig. Dit is het gevolg van een @@ -5717,8 +5290,8 @@ {\ConvertConstantAfter\doifelse{\v!paginanummer}{#6} {\@@plaatspaginanummer} {\ConvertConstantAfter\doifelse{\v!datum}{#6} - {\currentdate} - {\opeenregel\dolimitateteksten{#1#2#5}{#6}}}}}}% + {\currentdate} % #6{}{}{} -> {} needed for lookahead macros, like \uniqueMPgraphic + {\opeenregel\dolimitateteksten{#1#2#5}{#6{}{}{}}}}}}}% \egroup} \def\dodoteksten#1#2#3#4#5#6% @@ -5953,10 +5526,6 @@ \def\placepositionanchors{\vskip\teksthoogte} \fi -%\def\@@plaatspaginascheider% -% {\doif{\@@nmstatus}{\v!start}% -% {\@@nmtekstscheider}} - \def\@@nmin {} % kan vervallen (upward compatibility) \def\@@nmplaats {} % mag {plaats, in} zijn @@ -6068,11 +5637,13 @@ \egroup} \unexpanded\def\@@plaatspaginanummer% called in empty tests - {\doif{\@@nmstatus}{\v!start}% + %{\doif{\@@pnstatus}{\v!start} + {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start} {{\@@nmcommando{\doattributes\??nm\c!letter\c!kleur{\volledigepaginanummer}}}}} -\def\@@plaatspaginascheider% - {\doif{\@@nmstatus}{\v!start}% +\def\@@plaatspaginascheider% still used ? + %{\doif{\@@pnstatus}{\v!start}% + {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start} {\@@nmtekstscheider}} \def\userfolio% naast realfolio @@ -6081,47 +5652,38 @@ \def\pagenumber% {\userfolio} -\def\volledigepaginanummer% alleen voor paginanummers !! - {\@@nmlinks - \def\donexttrackcommando##1% - {\doifvalue{\??nm##1\v!nummer}{\v!ja} % v - {\ifnum\countervalue{\??se##1}>0\relax - \getvalue{##1\c!nummer}\@@nmnummerscheider - \fi}% - \doifsomething{\@@nmtekst} - {\@@nmtekst\@@nmnummerscheider}% - \donexttracklevel{##1}}% - \donexttrackcommando{\firstsection}% - \pagenumber - \@@nmrechts} +\def\pageprefixes% + {\def\donexttrackcommando##1% + {\doifvalue{\??nm##1\v!nummer}{\v!ja} % v + {\ifnum\countervalue{\??se##1}>0\relax + \getvalue{##1\c!nummer}\@@nmnummerscheider + \fi}% + \doifsomething{\@@nmtekst} + {\@@nmtekst\@@nmnummerscheider}% + \donexttracklevel{##1}}% + \donexttrackcommando{\firstsection}} + +\unexpanded\def\volledigepaginanummer% + {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start} + {\@@nmlinks\labeltexts{\v!paginanummer}{\pageprefixes\pagenumber}\@@nmrechts}} + +\unexpanded\def\plaatspaginanummer% + {\doif{\@@nmstatus\@@pnstatus}{\v!start\v!start} + {\labeltexts{\v!paginanummer}{\pagenumber}}} \def\translatednumber[#1::#2::#3]% {#3} -%I n=Selecteren -%I c=\soortpagina,\verwerkpagina,\koppelpagina -%I -%I Het is mogelijk pagina's te markeren en selectief te -%I verwerken. Markering vindt plaats met het commando: -%I -%I \soortpagina[aanduiding] -%I -%I en selecteren vindt plaats met: -%I -%I \verwerkpagina[aanduiding,...][instelling] -%I -%I waarbij de instelling 'ja' of 'nee' is en meerdere -%I aanduidingen worden gescheiden door een comma. -%P -%I Er kunnen commando's worden gekoppeld aan pagina's: -%I -%I \koppelpagina[aanduiding,...][voor=,na=,optie=] -%I -%I De opgegeven commando's worden voor respectievelijk na het -%I vrijgeven van de pagina uitgevoerd. - % hier nog uti blokkeren +% don't change this / test case: +% +% \setupbackgrounds[state=repeat] +% \setupbackgrounds[text][text][background=whatever] +% \couplepage[chapter][before={\defineoverlay[whatever][ON]}] +% \setuphead[chapter][before={\pagetype[chapter]}] +% \chapter{First} \page test \chapter{second} \page test + \newif\ifgeselecteerd \geselecteerdtrue @@ -6283,70 +5845,6 @@ \unexpanded\def\referencepagenumber[#1]% {\paginaprefix\??rf[#1]\translatednumber[#1]} -%I n=Regels -%I c=\startregels,\stelregelsin -%I c=\startregelnummeren,\stelregelnummerenin -%I c=\crlf -%I c=\startregel,\stopregel,\eenregel,\inregel -%I -%I Het is mogelijk de indeling in regels zoals die in de ruwe -%I tekst wordt gehanteerd af te dwingen. Er wordt in dit -%I geval niet ingesprongen. De regels worden gezet tussen de -%I twee commando's: -%I -%I \startregels -%I -%I ................................................... -%I -%I \stopregels -%P -%I Er kan met betrekking tot regels een en ander worden -%I ingesteld: -%I -%I \stelregelsin[voor=,na=,inspringen=] -%I -%I Aan 'inspringen' kan men 'ja', 'nee', 'even' of 'oneven' -%I toekennen. -%P -%I Het is mogelijk regels te nummeren door ze tussen de -%I volgende commando's te plaatsen: -%I -%I \startregelnummeren -%I \stopregelnummeren -%I -%I Als de regelovergangen moeten worden gehandhaafd, dan moet -%I \startregels voor \startregelnummeren worden gegeven. -%I -%I Het nummeren begint steeds opnieuw bij 1. Als verder moet -%I worden genummeren, dan kan achter \startregelnummeren -%I [verder] worden meegegeven. -%I -%I Standaard worden regels alinea-gewijs genummerd. Als men -%I over een paginagrens wil nummeren, dan moet [opelkaar] -%I worden meegegeven. -%P -%I De wijze van nummeren kan worden ingesteld met: -%I -%I \stelregelnummerenin[conversie=,start=,stap=,letter=, -%I plaats=,breedte=,letter=] -%I -%I Als 'conversie' kan worden meegegeven: cijfers, letters, -%I Letters, romeins of Romeins. Aan 'start' en 'stap' kan -%I een getal worden toegekend, aan 'letter' een trefwoord, -%I aan 'breedte' een maat (bij voorkeur in ex) en aan -%I 'plaats' het trefwoord 'inmarge' of 'intekst'. -%P -%I Er kan worden overgegaan naar een nieuwe regel met: -%I -%I \crlf -%P -%I .... testfase ... -%I -%I \startregel[tag] ... \stopregel[tag] -%I \eenregel[tag] -%I -%I \inregel[tag] - \newif\ifinregels \newif\ifregelnummersinmarge @@ -6416,6 +5914,10 @@ % het gebruik van \setlocalreference scheelt een hash entry +\def\dodoshowlinenumber% for use elsewhere, to be extended + {\doschrijfregelnummer + \global\advance\linenumber by 1\relax}% + \def\regelweergave% {\convertnumber\@@rnconversie\linenumber}% @@ -6677,49 +6179,6 @@ \doshowparagraphnumberA \fi} -%I n=Opmaak -%I c=\definieeropmaak,\testopmaak,\startstandaardopmaak -%I -%I Het is mogelijk een lege pagina op te maken. Hiertoe wordt -%I een blok gereserveerd met het commando: -%I -%I \definieeropmaak[naam][breedte=,hoogte=,voffset=, -%I hoffset=,pagina=,commandos=,voor=,na=,dubbelzijdig=] -%I -%I Hierbij wordt bij de eerste vier parameters een getal -%I meegegeven (5cm, 24pt, enz.). Met 'pagina' geeft men aan -%I of naar een nieuwe pagina wordt gesprongen (standaard -%I 'rechts'). Aan de 'commandos' kunnen commando's worden -%I toekend die tijdens de opmaak gelden. Aan de laatste twee -%I parameters toegekende commando's worden voor en na het -%I opmaken van de pagina uitgevoerd. De opgemaakte pagina -%I kan worden geselecteerd op naam. Met 'dubbelzijdig' geeft -%I men aan of er een lege achterkant moet worden opgemaakt -%I (standaard: ja). Dit geldt aleen bij dubbelzijdig zetten. -%I -%I Naast het bovenstaande commando is er het commando: -%I -%I \stelopmaakin[naam][instellingen] -%P -%I Na het geven van dit commando zijn twee commando's -%I beschikbaar: \startnaamopmaak en \stopnaamopmaak. Tussen -%I deze twee commando's kunnen zetopdrachten en teksten -%I worden opgenomen. Een en ander wordt op een lege bladzijde -%I gezet. -%I -%I Met het commando \testopmaak kunnen hulplijnen worden -%I opgeroepen. -%I -%I De commando's \startstandaardopmaak en \stopstandaardopmaak -%I maken het opmaken binnen de standaard-layout mogelijk. -%P -%I Eventueel kunnen de volgende twee commando's worden gebruikt -%I om een pagina op te maken met hoofd- en voetregels. -%I -%I \startopmaak -%I ..... -%I \stopopmaak - \newbox\opmaak \def\setopmaaklayout[#1]% @@ -6849,31 +6308,6 @@ \def\stelopmaakin% {\dodoubleargument\dostelopmaakin} -%I n=Smaller -%I c=\startsmaller,\stelsmallerin -%I -%I Een paragraaf kan smaller gezet worden met behulp van de -%I commando's: -%I -%I \startsmaller[afstand] -%I \stopsmaller -%I -%I Als maat wordt links, rechts, midden of een combinatie -%I hiervan meegegeven. Eventueel wordt geen afstand meegegeven. -%I -%I De linker, rechter of dubbele inspringing kan worden -%I ingesteld met: -%I -%I \stelsmallerin[links=,rechts=,midden=] -%I -%I Enkele voorbeelden van smelelr zetten zijn: -%I -%I \startsmaller[2*links,rechts] -%I \stopsmaller -%I -%I \startsmaller[midden,rechts] -%I \stopsmaller - \newskip\linkssmaller \newskip\rechtssmaller \newskip\middensmaller @@ -6918,33 +6352,6 @@ \def\stelsmallerin% {\dodoubleargument\getparameters[\??sl]} -%I n=Boxen -%I c=\definieerhbox,\cbox,\lbox,\rbox,\sbox -%I -%I Het is mogelijk een tekst in een blok met een vaste -%I omvang te zetten. Dit is vergelijkbaar met het opmaken -%I van een tabel. -%I -%I \hbox?{tekst} (horizontaal blok) -%I -%I De box wordt eerst gedefinieerd met: -%I -%I \definieerhbox[?][maat] -%I -%I Er kan een links, rechts of midden uitgelijnde \vbox worden -%I gezet met de commando: -%I -%I \lbox{tekst\\tekst\\tekst} of \lbox to {...} -%I \rbox{tekst\\tekst\\tekst} of \rbox to {...} -%I \cbox{tekst\\tekst\\tekst} of \cbox to {...} -%I -%I Het commando \\ forceert een overgang naar een nieuwe regel. -%I -%I Een (hoge) box kan een gedwongen hoogte gelijk aan die -%I van een strut krijgen met: -%I -%I \sbox{box} - \def\dodefinieerhbox[#1][#2]% {\setvalue{hbox#1}##1% {\hbox to #2{\begstrut##1\endstrut\hss}}} @@ -6986,159 +6393,55 @@ \s!default=>\let\raggedbox\hbox, \s!unknown=>\let\raggedbox\hbox]} -\def\dosetraggedcommand#1% ook ruim,rechts en zo - {\processaction +% \def\dosetraggedcommand#1% ook ruim,rechts en zo +% {\processaction +% [#1] +% [ \v!links=>\def\raggedcommand{\raggedleft}, +% \v!rechts=>\def\raggedcommand{\raggedright}, +% \v!midden=>\def\raggedcommand{\raggedcenter}, +% \v!nee=>\def\raggedcommand{\raggedright}, +% \v!normaal=>\let\raggedcommand\relax, +% \s!default=>\def\raggedcommand{\raggedcenter}, +% \s!unknown=>\let\raggedcommand\relax]} + +\def\dosetraggedcommand#1% + {\expanded{\dodosetraggedcommand{#1}}} + +\def\dodosetraggedcommand#1% + {\doifinsetelse{\v!ruim} {#1}{\!!doneatrue}{\!!doneafalse}% + \doifinsetelse{\v!breed}{#1}{\!!donebtrue}{\!!donebfalse}% + \let\raggedcommand\relax + \let\raggedtopcommand\empty + \let\raggedbottomcommand\empty + \!!donectrue + \ExpandFirstAfter\processallactionsinset [#1] - [ \v!links=>\def\raggedcommand{\raggedleft}, - \v!rechts=>\def\raggedcommand{\raggedright}, - \v!midden=>\def\raggedcommand{\raggedcenter}, + [ \v!links=>\if!!donea \def\raggedcommand{\veryraggedleft}% + \else \def\raggedcommand{\raggedleft}% + \fi + \!!donecfalse, % {\v!links,\v!midden} + \v!rechts=>\if!!donea \def\raggedcommand{\veryraggedright}% + \else \def\raggedcommand{\raggedright}% + \fi + \!!donecfalse, % {\v!rechts,\v!midden} + \v!midden=>\if!!donec + \if!!doneb \def\raggedcommand{\raggedwidecenter}% + \else\if!!donea \def\raggedcommand{\veryraggedcenter}% + \else \def\raggedcommand{\raggedcenter}% + \fi\fi + \!!donecfalse % {\v!midden,\v!midden} + \else + \let\raggedbottomcommand\vfilll % bonus, pretty strong + \let\raggedtopcommand \vfilll % used with \framed for + \fi, % instance in tables + \v!hoog=>\let\raggedbottomcommand\vfilll, % and since we lack a + \v!laag=>\let\raggedtopcommand \vfilll, % proper keyword, but + \v!laho=>\let\raggedbottomcommand\vfilll % we do support the + \let\raggedtopcommand \vfilll, % ugly laho (lohi) \v!nee=>\def\raggedcommand{\raggedright}, - \v!normaal=>\let\raggedcommand\relax, - \s!default=>\def\raggedcommand{\raggedcenter}, - \s!unknown=>\let\raggedcommand\relax]} + \v!ja=>\let\raggedcommand\relax, + \v!normaal=>\let\raggedcommand\relax]} -%I n=Blokken -%I c=\stelplaatsblokkenin,\stelblokkopjesin -%I c=\definieerplaatsblok,\stelplaatsblokin -%I c=\reserveer,\leeg,\plaats,\volledigelijstmet,\plaatslijstmet -%I -%I Figuren, tabellen, grafieken enz. kunnen in de tekst -%I worden geplaatst met het commando: -%I -%I \plaats[voorkeur][referentie]{titel}{blok} -%I -%I Als voorkeur kan worden opgegeven: -%I -%I hier bij voorkeur op deze plaats in de tekst -%I forceer per se op deze plaats in de tekst -%I pagina op een nieuwe pagina -%I boven bovenaan de huidige pagina -%I onder onderaan de huidige pagina -%I -%I links links in de paragraaf -%I rechts rechts in de paragraaf -%I -%I inlinker in linker marge (gelijke hoogte) -%I inrechter in rechter marge (gelijke hoogte) -%I inmarge in linker/rechter marge (gelijke hoogte) -%I marge in de marge -%P -%I Als er op de huidige bladzijde geen plaats is, dan wordt -%I standaard de figuur verplaatst (eerste vier opties) en/of -%I wordt overgegaan naar een nieuwe bladzijde (laatste twee -%I opties. -%I -%I Men kan plaatsen afdwingen door het trefwoord altijd -%I mee te geven: \plaats[hier,altijd][]{}{}. Er zijn dan -%I twee runs nodig, omdat de nummering van de blokken moet -%I worden aangepast. -%I -%I Als in plaats van een titel 'geen' wordt meegegeven, wordt -%I geen titel geplaatst. -%I -%I Als het blok nog onbekend is, kan in plaats van het blok -%I een van de volgende commando's worden meegegeven: -%I -%I \leeg -%I \lege -%P -%I Het is mogelijk ruimte voor een blok te reserveren: -%I -%I \reserveer[hoogte=,breedte=,kader=][voorkeur] -%I [referentie]{titel} -%I -%I Beide commando's kunnen ook gegeven worden zonder [], -%I dus in de vorm -%I -%I \plaats{titel}{blok} -%I \reserveer{titel} -%I -%I Ten behoeve van een consistente verwijzing wordt het -%I commando: -%I -%I \in[referentie] -%I -%I gedefinieerd. Dit levert in de tekst op: -%I -%I 'in ' -%P -%I Blokken kunnen worden gedefinieerd met het commando: -%I -%I \definieerplaatsblok[blok][blokken] -%I -%I Hierna zijn de volgende commando's beschikbaar: -%I -%I \plaatsblok[plaats][referentie]{titel}{blok} -%I \reserveerblok[afmetingen][plaats][referentie]{titel} -%I \leegblok -%I -%I Het is mogelijk een en ander in te stellen met het -%I commando: -%I -%I \stelplaatsblokin[blok][hoogte=,breedte=,kader=, -%I bovenkader=,onderkader=,linkerkader=,rechterkader=, -%I paginaovergangen=] -%I -%I De hoogte en breedte hebben betrekking op de te reserveren -%I ruimte. -%P -%I Naast de eerder genoemde commando's zijn nog beschikbaar: -%I -%I \plaatslijstmetblokken -%I \volledigelijstmetblokken -%I -%I en een (extra) commando om tekst naast een blok (hier met -%I de naam 'blok') te plaatsen: -%I -%I \startbloktekst[plaats][referentie]{kop}{blok} -%I ... -%I \stopbloktekst -%I -%I Mogelijke plaatsen zijn 'links', 'rechts', 'hoog', 'laag' en -%I 'midden'. Ook is een combinatie van deze instellingen -%I mogelijk, bijvoorbeeld [links,hoog]. De instelling 'offset' -%I resulteert in een verschuiving van 1 regel. -%P -%I Blokken die tussen de tekst staan kunnen links, rechts of in -%I het midden worden uitgelijnd. De plaats wordt ingesteld met: -%I -%I \stelplaatsblokkenin[plaats=,breedte=,kader=,bovenkader=, -%I onderkader=,linkerkader=,rechterkader=,offset=,voorwit=, -%I nawit=,marge=] -%I -%I De genummerde kopjes bij blokken kunnen worden ingesteld -%I met: -%I -%I \stelblokkopjesin[plaats=,voor=,tussen=,na=,letter=, -%I kopletter=,breedte=,nummer=,uitlijnen=] -%I -%I waarbij als plaats kan worden meegegeven: 'boven', 'onder', -%I 'geen', 'hoog', 'laag' of 'midden'. Als breedte kan 'passend' -%I of 'max' worden meegegeven. De parameter nummer kan 'ja' of -%I 'nee' zijn. Als breedte=max, dan wordt het kopje over de -%I hele breedte geplaatst. In dat geval kan uitlijnen worden -%I ingesteld: 'links', 'midden' of 'rechts'. -%P -%I Als er geen plaats is, worden plaatsblokken tijdelijk -%I achtergehouden. De opgespaarde blokken worden op de -%I volgende bladzijde(n) geplaatst. Dit plaatsen is te -%I beinvloeden met: -%I -%I \stelplaatsblokkenin[nboven=,nonder=,nregels=] -%I -%I Standaard worden maximaal 2 blokken bovenaan de -%I bladzijde geplaatst en 0 blokken onder. Er wordt overgegaan -%I op een nieuwe bladzijde als het aantal regels groter is -%I dan 4. Deze waarden kunnen worden ingesteld. -%P -%I Kopjes boven lijsten en labels voor nummers kunnen worden -%I ingesteld met de elders beschreven commando's: -%I -%I \stellabeltekstin[label=...] -%I \stelkoptekstin[tekst=...] -%I -%I Standaard zijn deze ingesteld op de opgegeven namen. - \def\stelplaatsblokkenin% {\dodoubleargument\getparameters[\??bk]} @@ -7171,7 +6474,8 @@ \hsize=\@@mbbreedte}% \fi \global\insidefloattrue - \dowithnextbox + \dowithnextboxcontent + {\postponefootnotes} % new {\docompletefloat {#1}{#3}{#1}{#2}{#1}{#4} {\box\nextbox}}% @@ -7432,7 +6736,8 @@ \witruimte \previoussidefloat \stallsidefloat - \setbox\floatbox=\hbox{\vbox{\vskip\sidefloattopoffset#1}} + \setbox\floatbox=\hbox{\vbox % pretty ugly, will be rewritten + {\vskip\ifmarginfloat-\sidefloattopskip\else\sidefloattopoffset\fi#1}} \measuresidefloat \ifroomforfloat \setsidefloat @@ -7995,7 +7300,8 @@ \blanko[\@@bkvoorwit]% \flushfloatbox \blanko[\@@bknawit]% - \doinsertfloatinfo} + \doinsertfloatinfo + \doif{\@@bkspringvolgendein}{\v!nee}{\noindentation}} % new \def\somefixdfloat[#1]% {\doroomfloat @@ -8020,7 +7326,8 @@ \v!rechts=>\rightfloat{\box\floatbox}, \v!inlinker=>\leftmarginfloat{\box\floatbox}, \v!inrechter=>\rightmarginfloat{\box\floatbox}, - \v!inmarge=>{\doinmargenormal\leftmarginfloat\rightmarginfloat[]{\box\floatbox}}]% + \v!inmarge=>{\doinmargenormal\leftmarginfloat + \rightmarginfloat{\box\floatbox}}]% \doifinset{\v!lang}{#1} {\flushsidefloatsafterpar}% \fi} @@ -8047,6 +7354,7 @@ \setbox\floattext=\vbox to \floattextheight} {\setbox\floattext=\vbox}% \bgroup +\forgetall\stelblankoin\stelwitruimtein % new, also needed for footnotes \blanko[\v!blokkeer] \hsize\floattextwidth \ignorespaces} @@ -8258,10 +7566,10 @@ {\doregelplaats\@@flflplaats}% \ConvertToConstant\doifelse{#3}{\v!geen} {\global\setbox\floatbox=\vbox % pas op als wd groter dan hsize - {\ifbinnenkolommen\ifdim\wd4>\hsize - \let\locatefloat\relax - \fi\fi - \locatefloat{\box4}}} + {\ifbinnenkolommen\ifdim\wd4>\hsize + \let\locatefloat\relax + \fi\fi + \locatefloat{\copy4}}} % we need \wd4 later {\setbox2=\hbox {\footnotesenabledfalse\putcompletecaption{#4}{#2}{#3}{0}}% \doifinsetelse{\@@kjkjplaats}{\v!hoog,\v!midden,\v!laag} @@ -8303,10 +7611,11 @@ \hsize=0.9\wd4 \putcompletecaption{#4}{#2}{#3}{0}}% \else - \setbox0=\vbox - {\forgetall - \hsize=1.0\wd4 - \putcompletecaption{#4}{#2}{#3}{0}}% + %\setbox2=\vbox % was 0, bug + % {\forgetall + % \hsize=1.0\wd4 + % \putcompletecaption{#4}{#2}{#3}{0}}% + \setbox2=\hbox{\putcompletecaption{#4}{#2}{#3}{0}}% \fi \else \setbox0=\vbox @@ -8326,20 +7635,24 @@ \fi \putcompletecaption{#4}{#2}{#3}{0}}% \else - \setbox0=\vbox - {\forgetall - \dimen2=1.5\dimen0\relax - \ifdim\dimen2<\hsize - \hsize=\dimen2\relax - \fi - \putcompletecaption{#4}{#2}{#3}{0}}% + %\setbox2=\vbox % was 0, bug + % {\forgetall + % \dimen2=1.5\dimen0\relax + % \ifdim\dimen2<\hsize + % \hsize=\dimen2\relax + % \fi + % \putcompletecaption{#4}{#2}{#3}{0}}% + \setbox2=\hbox{\putcompletecaption{#4}{#2}{#3}{0}}% \fi \fi} {\dosetraggedvbox{\@@kjkjuitlijnen}% \setbox2=\raggedbox {\hsize\@@kjkjbreedte \putcompletecaption{#4}{#2}{#3}{0}}}% - \fi}}% + \else + \setbox2=\hbox % we want footnotes ! + {\putcompletecaption{#4}{#2}{#3}{0}}% + \fi}}% \global\setbox\floatbox=\vbox {\forgetall \processaction @@ -8377,13 +7690,32 @@ \tfskip \copy4}}, \v!geen=>\locatefloat{\copy4}]}}% - \ifdim\wd4>\hsize - \global\setbox\floatbox= - \hbox to \ifbinnenkolommen\wd4\else\hsize\fi - {\hss\box\floatbox\hss}% - \fi + % extended: + \postcenterfloatbox{\wd4}% + %\ifdim\wd4>\hsize + % \global\setbox\floatbox= + % \hbox to \ifbinnenkolommen\wd4\else\hsize\fi + % {\hss\box\floatbox\hss}% + %\fi \egroup} +\newif\ifpostponecolumnfloats \postponecolumnfloatsfalse % don't change + +\def\postcenterfloatbox#1% + {\ifbinnenkolommen + \ifpostponecolumnfloats + \scratchdimen=\makeupwidth + \else + \scratchdimen=#1\relax + \fi + \else\ifdim#1>\hsize + \scratchdimen=\hsize + \else + \scratchdimen=\wd\floatbox + \fi\fi + \global\setbox\floatbox=\hbox to \scratchdimen + {\hfill\box\floatbox\hfill}} % geen \hss, gaat mis in kolommen ! + \def\dosetparfloat#1#2#3#4% {\bgroup \forgetall @@ -8436,7 +7768,7 @@ \edef\@@kjkjplaats {\getvalue{\??kj#4\c!plaats}}% \edef\@@kjkjuitlijnen{\getvalue{\??kj#4\c!uitlijnen}}% \edef\@@flflplaats {\getvalue{\??fl#4\c!plaats}}% - \ifparfloat + \ifparfloat \dosetparfloat{#1}{#2}{#3}{#4}% \else \dosetpagfloat{#1}{#2}{#3}{#4}% @@ -8532,76 +7864,6 @@ #4% \pagina[\v!ja]} -%I n=Figuren -%I c=\plaatsfiguur,\reserveerfiguur,\startfiguurtekst -%I c=\leegfiguur,\volledigelijstmetfiguren -%I c=\plaatstabel,\reserveertabel,\starttabeltekst -%I c=\legetabel,\volledigelijstmettabellen -%I -%I Figuren en tabellen (gebruik ..tabel.. in plaats van -%I ..figuur..) kunnen in de tekst worden geplaatst met het -%I commando: -%I -%I \plaatsfiguur[plaats][referentie]{titel}{figuur} -%I -%I Als voorkeur kan worden opgegeven 'hier', 'forceer', -%I 'pagina', 'boven', 'onder', 'links' en 'rechts'. In plaats -%I van een titel kan 'geen' worden meegegeven, in dat geval -%I wordt geen titel geplaatst. Eventueel kan in combinatie -%I met links en rechts 'lang' worden opgegeven. -%I -%I De volgorde kan worden afgedwongen met 'altijd', -%I bijvoorbeeld [hier,altijd]. In dat geval wordt bij een -%I volgende run zonodig de nummering aangepast. -%I -%I In plaats van een titel kan {geen} worden ingevuld. In -%I dat geval blijft de titel achterwege. -%P -%I Het is mogelijk ruimte voor een figuur te reserveren: -%I -%I \reserveerfiguur[hoogte=,breedte=,kader=][voorkeur] -%I [referentie]{titel} -%P -%I Een lijst met figuren kan worden opgeroepen met: -%I -%I \plaatslijstmetfiguren -%I \volledigelijstmetfiguren -%I -%I Men kan een tekst naast een figuur zetten met: -%I -%I \startfiguurtekst[plaats][referentie]{kop}{figuur} -%I ... -%I \stopfiguurtekst -%I -%I Mogelijke plaatsen zijn (combinaties van) 'links', 'rechts', -%I 'hoog', 'laag' en 'midden'. Met 'offset' dwingt men een -%I verschuiving omlaag van van 1 regel af. -%I -%I Zie verder onder plaatsblokken. - -%I n=Tabellen -%I -%I Zie figuren. - -%I n=Intermezzo -%I -%I Zie figuren. - -%I n=Grafieken -%I -%I Zie figuren. - -%T n=figuur -%T m=fig -%T a=f -%T -%T \plaatsfiguur -%T [hier] -%T [fig:] -%T {} -%T {\naam{?}} -%T - \definieernummer [\??si] [\c!wijze=\v!per\v!tekst, @@ -8652,53 +7914,6 @@ \def\splitsplaatsblok% {\dosingleempty\dosplitsplaatsblok} -%I n=Formules -%I c=\plaatsformule,\plaatssubformule,\stelformulesin -%I -%I Formules kunnen in de tekst worden geplaatst met -%I het commando: -%I -%I \plaatsformule[referentie]subnummer$$formule$$ -%I -%I Dit commando handelt de witruimtes om de formules af en -%I plaatst nummers. Als geen nummer nodig is, en dus ook -%I geen referentie, dan moet met het commando als volgt -%I gebruiken: -%I -%I \plaatsformule-$$...$$ of \plaatsformule[-]$$...$$ -%I -%I Als het nummer niet moet worden opgehoogd, gebruikt men -%I -%I \plaatssubformule[referentie]subnummer$$formule$$ -%P -%I PAS OP: -%I -%I Binnen een aantal wiskundige commando's, zoals -%I \displaylines, moet men het nummer zelf plaatsen. Dit -%I kan gebeuren met: \formulenummer of \subformulenummer. -%I Ook hier kan een [referentie] en een {subnummer} worden -%I meegegeven. -%I -%I \plaatsformule -%I $$\displaylines -%I {x \hfill\formulenummer[eerste]{}\cr -%I y \hfill\cr -%I z \hfill\formulenummer[derde]{}\cr} -%I $$ -%P -%I De wijze waarop formules worden genummerd kan worden -%I be‹nvloed door het commando: -%I -%I \stelformulesin[links=,rechts=,plaats=] -%I -%I De nummers kunnen links en rechts worden gezet. Standaard -%I worden de symbolen ( en ) gebruikt. -%I -%I Tussen twee formules kan witruimte worden geforceerd met -%I het commando: -%I -%I \blanko[formule] - \abovedisplayskip = \!!zeropoint\relax \abovedisplayshortskip = \!!zeropoint\relax % evt. 0pt minus 3pt \belowdisplayskip = \!!zeropoint\relax @@ -8780,7 +7995,7 @@ \belowdisplayskip\!!zeropoint \abovedisplayshortskip\!!zeropoint \belowdisplayshortskip\!!zeropoint -\vbox{\strut}\vskip-2\lineheight % Why 2 and not 1? +\vbox{\strut}\vskip-2\openlineheight % Why 2 and not 1? ; 'open' is new $$\def\dostopformula{$$\egroup}} \def\plaatsformule% @@ -8849,17 +8064,6 @@ \ignorespaces \endgroup} -%I n=Naast -%I c=\startnaast,\stelnaastplaatsenin -%I -%I Experiment: -%I -%I \startnaast -%I ... -%I \stopnaast -%I -%I \stelnaastplaatsenin[status=] - \newbox\facingbox \newbox\facingpage @@ -8915,43 +8119,6 @@ \def\stelnaastplaatsenin% {\dosingleargument\dostelnaastplaatsenin} -%I n=Achtergronden -%I c=\stelachtergrondenin -%I -%I Achter de tekst kan een achtergrond worden geplaatst. -%I Voor de afzonderlijke elementen van een tekst wordt een -%I achtergrond gedefinieerd met het commando: -%I -%I \stelachtergrondenin -%I [boven,hoofd,tekst,voet,onder] -%I [linkerrand,rechterrand,linkermarge,reachtermarge,tekst] -%I [achtergrond=,kleur=,raster=] -%I -%I Voor de hele bladzijde gebruiken we: -%I -%I \stelachtergrondenin -%I [pagina] -%I [achtergrond=,kleur=,raster=] -%P -%I Het is mogelijk elk blok iets ruimer om de tekst te -%I plaatsen met: -%I -%I \stelachtergrondenin -%I [pagina] -%I [offset=,diepte=] -%I -%I Een offset van .25\korpsgrootte en een diepte van -%I .5\korpsgrootte voldoen aardig. -%I -%I Er kunnen ronde hoeken worden gezet met: -%I -%I \stelachtergrondenin -%I [pagina] -%I [hoek=,straal=] -%I -%I Hierbij kan voor hoek de instelling rond of recht worden -%I meegegeven en voor straal een dimensie. - % Don't use \@@mawhatevercommand directly, use \getvalue instead. \newif\ifnewbackground @@ -9246,93 +8413,6 @@ \egroup \fi} -%I n=File-management -%I c=\starttekst,\startprojekt,\startonderdeel,\startprodukt -%I c=\startomgeving,\startdeelomgeving -%I -%I Een eenvoudige tekst wordt gestart en gestopt met de -%I commando's: -%I -%I \starttekst -%I \stoptekst -%P -%I Het is mogelijk een projektstructuur op te zetten. Per -%I projekt wordt een file aangemaakt waarin de volgende -%I commando's voorkomen: -%I -%I \startprojekt naam -%I \stopprojekt -%I -%I Als deze file in TeX wordt geladen, dan worden alle -%I produkten achter elkaar gezet. -%I -%I Een produkt wordt gedefinieerd met: -%I -%I \startprodukt naam -%I \stopprodukt -%I -%I Deze file kan zelfstandig door TeX worden gehaald. -%P -%I Een omgeving wordt gedefinieerd door: -%I -%I \startomgeving naam -%I \stopomgeving -%I -%I Een onderdeel wordt gedefinieerd door: -%I -%I \startonderdeel naam -%I \stoponderdeel -%I -%I Files worden eerst gezocht op het actuele gebied. Als een -%I file niet aanwezig is wordt op de 'roots' gezocht. -%I -%I Een onderdeel kan zelfstandig door TeX worden gehaald. -%P -%I Binnen een projekt, produkt, omgeving of onderdeel komen -%I de volgende instellingen voor (tussen haakjes=facultatief): -%I -%I projekt omgeving produkt onderdeel -%I -%I \projekt naam * * -%I \omgeving naam (*) (*) (*) (*) -%I \produkt naam * -%I \onderdeel naam (*) (*) -%I -%I Binnen een omgeving kunnen deelomgevingen worden gedefinieerd -%I die alleen voor bepaalde produkten, onderdelen enz. gelden. -%I -%I \startdeelomgeving[naam,...,naam] -%I commando's -%I \stopdeelomgeving -%P -%I Het programma TeXEdit doorzoekt bij het aanmaken van een -%I file-menu de hele tekst op de genoemde commando's. Bij een -%I lange tekst kan dit misschien 'te' lang duren. Met het -%I commando: -%I -%I \geenfilesmeer -%I -%I kan worden aangegeven dat er geen structuurcommando's meer -%I volgen. -%I -%I Ten behoeve van TeXUtil moet in plaats van het commando -%I \input het commando \verwerkfile{naam} worden gebruikt. -%P -%I Als men standaard een en ander wil instellen, dan kan men -%I dit doen in de file 'cont-sys.tex'. Deze file wordt direkt -%I na het opstarten geladen cq. uitgevoerd. Daarnaast wordt, -%I indien aanwezig, de file 'cont-new.tex' geladen. - -%T n=starttekst -%T m=sta -%T a=x -%T -%T \starttekst -%T -%T ? -%T -%T \stoptekst - \def\currentproject {} \def\currentproduct {} \def\currentenvironment {} @@ -9348,7 +8428,7 @@ \setvalue{\c!file::0}{\jobname} -\def\processedfile% +\def\processedfile% is used in styles, don't change ! {\getvalue{\c!file::\fileprocesslevel}} %\def\processfile#1% @@ -9392,7 +8472,7 @@ {\addtocommalist{##1}\allinputpaths}}% \processcommalist[#1]\docommando} -\def\registreerfileinfo[#1#2]#3% +\def\registreerfileinfo[#1#2]#3% geen \showmessage ? {\writestatus{\m!systems}{#1#2 file #3 at line \the\inputlineno}% \immediatewriteutility{f #1 {#3}}} @@ -9428,8 +8508,8 @@ \loadallsystemfiles\f!filfilename \loadallsystemfiles\f!sysfilename} -%D Loading of \type {cont-usr.tex} and \type {cont-exe.tex} -%D (the one generated by texexec). +%D Loading of \type {cont-usr.tex} (edited by the user) +%D and \type {cont-fmt.tex} (generated by texexec). \def\loaduserspecifications {\readsysfile{\f!usrfilename} @@ -9452,19 +8532,20 @@ % \newevery \everyjob \EveryJob % \appendtoks ... \to \everyjob -\prependtoks \showcontextbanner \to \everyjob - -\appendtoks \loadsystemfiles \to \everyjob -\appendtoks \preloadfonts \to \everyjob -\appendtoks \settopskip \to \everyjob -\appendtoks \preloadlanguages \to \everyjob -\appendtoks \preloadspecials \to \everyjob -\appendtoks \openspecialfile \to \everyjob -\appendtoks \checkutilityfile \to \everyjob -\appendtoks \openutilities \to \everyjob -\appendtoks \loadoptionfile \to \everyjob -\appendtoks \loadtwopassdata \to \everyjob -\appendtoks \setupfootnotes \to \everyjob % pas op: hangt af van korps +\prependtoks \showcontextbanner \to \everyjob + +\appendtoks \loadsystemfiles \to \everyjob +\appendtoks \preloadfonts \to \everyjob +\appendtoks \settopskip \to \everyjob +\appendtoks \preloadlanguages \to \everyjob +\appendtoks \preloadspecials \to \everyjob +\appendtoks \openspecialfile \to \everyjob +\appendtoks \checkutilityfile \to \everyjob +\appendtoks \openutilities \to \everyjob +\appendtoks \loadoptionfile \to \everyjob +\appendtoks \loadtwopassdata \to \everyjob +\appendtoks \setupfootnotes \to \everyjob % depends on bodyfont +\appendtoks \initializeMPgraphics \to \everyjob % after loading system files \appendtoks \pagina[\v!laatste] \pagina \to \everybye \appendtoks \ifarrangingpages\poparrangedpages\fi \to \everybye @@ -9760,43 +8841,6 @@ \wd0=\!!zeropoint \box0\relax} -%I n=Commando's -%I c=\definieer,\naam -%I c=\gebruikcommandos -%I -%I Het is mogelijk eigen commando's te definieren met behulp -%I van het commando: -%I -%I \definieer[aantal argumenten]\commando{betekenis} -%I -%I Een argument kan worden opgeroepen door een # gevolgd -%I een nummer, bijvoorbeeld #2. -%I -%I \definieer\test{ziezo} \ziezo -%I \definieer[1]\test{ziezo #1} \ziezo{} -%I \definieer[2]\test{ziezo #1 en #2} \ziezo{}{} -%P -%I In commandonamen mogen alleen karakters voorkomen. Mocht -%I onverhoopt een cijfer nodig zijn, dan kunnen dergelijke -%I commando's worden opgeroepen met: -%I -%I \naam{} -%I -%I In een aantal gevallen, bijvoorbeeld bij het wegschrijven -%I naar lijsten, worden commando's \noexpand-ed. Dit is -%I bijvoorbeeld het geval bij synoniemen en sorteren, als -%I het criterium ongelijk is aan 'alles'. Dergelijke (zelf) -%I gedefinieerde commando's dienen eerst te worden -%I geactiveerd met : -%I -%I \gebruikcommandos{\commando} -%I -%I Er mogen meerdere commando's tegelijk worden opgegeven: -%I -%I \gebruikcommandos{\alfa,\beta,gamma} -%I -%I waarbij de \ facultatief is. Er wordt niets gezet! - % \docommando kan niet worden gebruikt omdat deze macro % soms lokaal wordt gebruikt @@ -9858,33 +8902,6 @@ \processcommalist[#1]\docommando \egroup} -%I n=Groeperen -%I c=\start,\definieerstartstop -%I -%I Met behulp van de volgende commando's kan de werking van -%I andere commando's worden beperkt: -%I -%I \start[label] -%I \stop[label] -%I -%I Men is vrij in de keuze van het commentaar. Het gebruik -%I van deze commando's komt overeen met het gebruiken van {}. -%P -%I Er kunnen \start-\stop-paren worden gedefinieerd en -%I ingesteld met: -%I -%I \definieerstartstop[label][voor=,na=,commandos=, -%I letter=] -%I -%I De aan 'voor' en 'na' toegekende commando's worden voor -%I \start en na \stop uitgevoerd; de aan 'commando' -%I toegekende commando's direct na \start. -%I -%I Naast het \start-\stop-paar is ook het verkorte commando -%I beschikbaar: -%I -%I \label{tekst} - \def\complexstart[#1]{\bgroup\getvalue{\e!start#1}} \def\complexstop [#1]{\getvalue{\e!stop #1}\egroup} @@ -9933,16 +8950,6 @@ \def\copyright {\omcirkeld{c}} -%I n=Systeem -%I c=\stelsysteemin -%I -%I Systeemvariabelen kunnen worden ingesteld met het -%I commando: -%I -%I \stelsysteemin[resolutie=,korps=] -%I -%I Aan 'resolutie' dient het aantal dpi (300). - \def\dosetupsystem[#1]% {\getparameters[\??sv][#1]% \setuprandomize[\@@svwillekeur]% @@ -9966,6 +8973,8 @@ \s!unknown=>\time=#1]% \nextrandom \egroup}} + +\def\outputfilename{\@@svfile} % Default-instellingen (verborgen) @@ -9979,8 +8988,9 @@ \setupsystem [\c!gebied=, - \c!resolutie=300dpi, + \c!resolutie=600dpi, \c!willekeur=, + \c!file=\jobname, \c!korps=\normalizedlocalbodyfontsize] % of iets anders % Pas op: @@ -9991,7 +9001,6 @@ \stellayoutin [ \c!kopwit=.08417508418\papierhoogte, % .08333 2.5cm - %\c!boven=.03367003367\papierhoogte, % .03331 1.0cm \c!boven=\!!zeropoint, \c!bovenafstand=\!!zeropoint, \c!hoofd=.06734006734\papierhoogte, % .06667 2.0cm @@ -10002,11 +9011,8 @@ \c!onderafstand=\@@lybovenafstand, \c!onder=\!!zeropoint, \c!rugwit=.11904761905\papierbreedte, % 2.5cm - %\c!rand=.14285714286\papierbreedte, % 3.0cm \c!rand=\!!zeropoint, \c!randafstand=\@@lymargeafstand, - %\c!marge=\@@lyrugwit, - %\c!marge=.07888078409\papierbreedte, % rugwit-2*afstand \c!marge=.12649983170\papierbreedte, % snijwit-2*afstand \c!margeafstand=.02008341748\papierbreedte, % 12.0pt \c!linkerrand=\@@lyrand, @@ -10023,7 +9029,7 @@ \c!tekstbreedte=, % dangerous here \tekstbreedte \c!letter=, \c!markering=\v!uit, - \c!plaats=\v!enkelzijdig, + \c!plaats=, % \v!enkelzijdig, but empty is signal \c!schaal=1, \c!nx=1, \c!ny=1, @@ -10031,8 +9037,8 @@ \c!dy=\!!zeropoint, \c!grid=\v!nee, \c!regels=, - \c!snijwit=, - \c!bodemwit=] + \c!snijwit=\!!zeropoint, + \c!bodemwit=\!!zeropoint] % instellingen hierop terugvallen, bijvoorbeeld de volgende: @@ -10106,6 +9112,7 @@ \c!diepte=.28, \c!boven=1.0, \c!onder=0.4, + \c!afstand=1pt, \c!regel=2.8ex] \stelkolommenin @@ -10468,6 +9475,7 @@ \c!nawit=\v!groot, \c!zijvoorwit=\@@bkvoorwit, \c!zijnawit=\@@bknawit, + \c!springvolgendein=\v!nee, \c!marge=1em, \c!nboven=2, \c!nonder=0, @@ -10519,7 +9527,8 @@ [\v!definitief] \stelpaginanummerin - [\c!nummer=1] + [\c!status=\v!start, + \c!nummer=1] \stelsubpaginanummerin [\c!wijze=\v!per\v!deel, diff --git a/tex/context/base/main-002.tex b/tex/context/base/main-002.tex index 169f5a0aa..6abe6cb1b 100644 --- a/tex/context/base/main-002.tex +++ b/tex/context/base/main-002.tex @@ -17,46 +17,6 @@ \unprotect -%I n=Items -%I c=\items,\stelitemsin -%I -%I Met het commando \items kunnen invullijsten worden -%I gegenereerd: -%I -%I \items{alternatief1,alternatief2,...,alternatiefN} -%I -%I Als in plaats van een alternatief een - wordt gegeven, -%I dan wordt ruimte opengelaten. -%I -%I De wijze waarop items worden weergegeven wordt ingesteld -%I met het commando: -%I -%I \stelitemsin[plaats=,symbool=,breedte=,n=,voor=, -%I tussen=,na=,uitlijnen=] -%I -%I Mogelijke plaatsen zijn links, rechts, onder, boven en -%I inmarge. Als breedte wordt de breedte van de totale tekst -%I opgegeven. Het aantal is facultatief, eventueel kan er -%I 'onbekend' worden meegegeven. Uitlijnen is 'ja' of 'nee'. -%P -%I Indien gewenst, kan de instelling direkt achter \item worden -%I geplaatst: -%I -%I \items[plaats=,symbool=,...]{alternatief1,...} -%I -%I In plaats van een symbool kan ook een van de volgende -%I aanduidingen worden meegegeven: -%I -%I a a, b, c, d, ... -%I A A, B, C, D, ... -%I n 1, 2, 3, 4, ... -%I r i, ii, iii, ... -%I R I, II, III, ... -%I -%I Eventueel kan een nummer worden meegegeven. In dat -%I geval wordt het overeenkomstige symbool van de -%I opsomming gebruikt (1--n). - %\def\checkinterlineskip% % {\ifvmode % \ifdim\lastskip>\!!zeropoint\relax @@ -96,14 +56,14 @@ \fi\fi}% \vbox{#2}} -\def\dostelitemsin[#1]% maakt direkt gebruik van \??ss en \??cv +\def\dostelitemsin[#1]% {\getparameters[\??is][#1]% \doif{\@@isbreedte}{\v!onbekend} {\def\@@isbreedte{\hsize}}% - \doifdefinedelse{\??cv\@@issymbool} + \doifconversiondefinedelse{\@@issymbool} {\def\doitembullet##1{\convertnumber{\@@issymbool}{##1}}} - {\doifdefined{\??ss\@@issymbool} - {\def\doitembullet##1{\symbol[\@@issymbool]}}}} + {\doifsymboldefinedelse{\@@issymbool} + {\def\doitembullet##1{\symbol[\@@issymbool]}}{}}} \def\makeitemsandbullets#1% {\doifelse{\@@isn}{\v!onbekend} @@ -184,36 +144,6 @@ \definecomplexorsimpleempty\items -%I n=Tabulatie (1) -%I c=\definieeralineas,\stelalineasin -%I -%I Er kunnen paragrafen in meerdere kolommen worden gezet na -%I het commando: -%I -%I \definieeralineas[naam][n=,voor=,na=,afstand=, -%I hoogte=,lijn=,binnen=] -%I -%I Kolommen worden vervolgens gezet met: -%I -%I \startnaam .... \naam .... \naam .... \stopnaam -%I -%I of (soms verwarrend): -%I -%I \naam .... \naam .... \naam .... \naam -%I -%I of (lekker kort): -%I -%I \naam .... \\ .... \\ .... \\ -%I -%I waarbij het aantal malen .... \naam of \\ gelijk is -%I aan n. Naast \naam en \\ is ook \volgendenaam toegestaan. -%P -%I Het is mogelijk per kolom een en ander in te stellen met -%I het commando: -%I -%I \stelalineasin[naam][kolomnummer][afstand=,breedte=, -%I hoogte=,boven=,onder=,letter=,binnen=,lijn=, -%I uitlijnen=,tolerantie=] % Te zijner tijd [plaats=boven,onder,midden] implementeren, % in dat geval moet eerst de maximale hoogte worden bepaald. @@ -405,21 +335,6 @@ \par \getvalue{\??al#1\c!na}}% -%I n=Tabulatie (2) -%I c=\steltabin,\tab -%I -%I Eenvoudige tabulatie is mogelijk met het commando: -%I -%I \tab{tekst} tekst tekst tekst ..... -%I -%I Instelling vindt plaats met het commando: -%I -%I \steltabin[monster=,breedte=,kopletter=,voor,na=] -%I -%I Dit commando is een vereenvoudigde variant van het -%I commando \doordefinieren. In de regel kan volstaan -%I worden met het opgeven van een monster. Dit is het -%I woord dat de breedte bepaalt. \def\dosteltabin[#1]% {\getparameters[\??ta] @@ -444,27 +359,6 @@ \def\steltabin% {\dosingleargument\dosteltabin} -%I n=Diversen -%I c=\celsius,\bedrag,\breuk -%I c=\procent,\promille -%I -%I De volgende commando's vatten (vooral mathematische) -%I zetcommando's samen: -%I -%I \chem{symbool}{onder}{boven} chemische symbolen -%I \celsius{graden} graden Celsius (..~øC) -%I \breuk{boven}{onder} breuken («) -%I \bedrag{getal} geldbedragen (Ÿ~..) -%I \punten[n] puntjes (. . .) -%I \ongeveer plus-minus (ñ) -%I \inch inch ('') -%I \doorsnede \circ doorsneden met / -%I \graden ø (^\circ) -%I \procent percentage (vgl promille) -%I \promille promilage -%I \dollar dollar teken -%I \sterling pound sterling teken -%I \florijn gulden teken % The following macro's are derived from PPCHTEX and % therefore take some LaTeX font-switching into account. @@ -662,37 +556,6 @@ f% \egroup} -%I n=Citaten -%I c=\startcitaat,\citaat,\stelcitatenin -%I c=\citeer,\stelciterenin -%I -%I Als variant op \startsmaller is het volgende commando -%I beschikbaar: -%I -%I \startcitaat -%I tekst -%I \stopcitaat -%I -%I Rond de tekst worden in de marge dubbele quotes -%I geplaatst. Ook bij dit commando kunnen tussen [] maten -%I worden opgegeven: -%I -%I \startcitaat[2*links,rechts] -%I -%I In de lopende tekst kan gebruik worden gemaakt van: -%I -%I \citaat{tekst} -%I \citeer{tekst} -%I -%I Het eerste commando levert dubbele quotes en het tweede -%I enkele quotes. -%P -%I Er zijn twee varianten (1 en 2) beschikbaar die kunnen -%I worden ingesteld met: -%I -%I \stelciterenin -%I [letter=] - \newsignal\quotationsignal \def\quotationskip{.125em} @@ -787,15 +650,6 @@ \def\activiteit#1#2% {\sym{\tijdspan{#1}{#2}}} -%I n=Toevoegen -%I c=\toevoegen -%I -%I Er kan witruimte worden gemarkeerd met het commando: -%I -%I \toevoegen[instelling]{korte tekst} -%I -%I waarbij als instellingen mogelijk zijn: klein, middel of -%I groot. \def\dotoevoegen#1% {\def\next{#1}% @@ -814,25 +668,6 @@ \definecomplexorsimpleempty\toevoegen -%I n=Roosters -%I c=\rooster -%I -%I Er kunnen roosters (te vergelijken met ruitjespapier) -%I worden gemaakt met: -%I -%I \rooster[nx=,ny=,dx=,dy=,eenheid=,xstap=,ystap=, -%I offset=,schaal=,factor=] -%I -%I De instelling [nx=20,ny=20,dx=.5,dy=.5,eenheid=cm] levert -%I een patroon van 10cm bij 10cm van hokjes van 0.5cm op. -%I -%I Met '.stap' kunnen getallen langs de assen worden gezet. -%I als 0 wordt ingevuld (default), dan worden geen getallen -%I gezet. Met offset (ja of nee) kan men aangeven of de -%I getallen langs de assen binnen of buiten de box rond -%I het rooster vallen (vergelijk \stelpositionerenin). -%I -%I !! Dit commando wordt nog aangepast/uitgebreid. !! \def\dorooster[#1]% {\begingroup @@ -945,33 +780,6 @@ \def\rooster% {\dosingleempty\dorooster} -%I n=Literatuurlijsten -%I c=\stelpublicatiesin,\startpublicatie,\publicatie -%I -%I Literatuurlijsten kunnen worden opgemaakt met het commando: -%I -%I \startpublicatie[referentie] -%I \naam .... -%I \titel .... -%I \jaar .... -%I \plaats .... -%I \uitgever .... -%I \stoppublicatie -%I -%I Een publicatie wordt opgeroepen met: -%I -%I \publicatie[referentie] -%P -%I Het formaat kan worden ingesteld met het commando: -%I -%I \stelpublicatiesin[variant=,voor=,na=,nummeren=, -%I breedte=,kopletter=,links=,rechts=] -%I -%I waarbij mogelijke varianten zijn: normaal apa en normaal. -%I Nummeren kan 'ja' of 'nee' zijn; links en rechts -%I hebben betrekking op de weergave in de tekst en zijn -%I standaard [ en ]. - % Dit wordt: % % \doorverwijzen[naam][instellingen] enz. @@ -1040,27 +848,6 @@ \def\publicatie#1[#2]% {\@@pblinks\in{#1}[#2]\@@pbrechts} -%I n=Kenmerken -%I c=\kenmerk,\kenmerkdatum -%I -%I Er kan een kenmerk worden gezet met het commando: -%I -%I \kenmerk[bet=,ken=,dat=,van=,aan=,ref=] -%I -%I waarbij de verplichte parameters staan voor 'betreft', -%I 'kenmerk' en 'datum' en de optionele voor 'van', 'aan' en -%I 'referentie'. -%I -%I Een kenmerk-datum kan worden gezet met het commando: -%I -%I \kenmerkdatum -%I -%I zodat een kenmerk er bijvoorbeeld uitziet als: -%I -%I \kenmerk -%I [bet=rekening eerste termijn, -%I ken=\kenmerkdatum.sork.gvk / afo, -%I dat=\currentdate] \def\kenmerkdatum% {\currentdate[\v!kenmerk]} diff --git a/tex/context/base/main-003.tex b/tex/context/base/main-003.tex index 989e6a792..3f401c0e0 100644 --- a/tex/context/base/main-003.tex +++ b/tex/context/base/main-003.tex @@ -32,33 +32,15 @@ \startmessages czech library: systems 41: externi soubor -- ve skupine -- neexistuje \stopmessages - -%I n=Formules+ -%I c=\startlegenda,\startgegeven -%I -%I Ten behoeve van een consistente toelichting op een -%I formule zijn er de volgende commando's: -%I -%I \startlegenda -%I \leg symbool \\ betekenis \\ dimensie \\ -%I \leg symbool \\ betekenis \\ dimensie \\ -%I \stoplegenda -%I -%I \startgegeven -%I \geg betekenis \\ symbool \\ waarde \\ -%I \geg betekenis \\ symbool \\ waarde \\ -%I \stopgegeven -%I -%I Ten behoeve van het zetten van ub- en superscripts zijn -%I er, naast \hbox, de commando's \xbox en \xxbox. -%P -%I Het onderstaande mag ook: -%I -%I \startlegenda[twee] -%I \leg symbool \\ symbool \\ betekenis \\ dimensie \\ -%I \leg symbool \\ symbool \\ betekenis \\ dimensie \\ -%I \stoplegenda +\startmessages italian library: systems + 41: il file esterno -- del gruppo -- non esiste +\stopmessages + +\startmessages norwegian library: systems + 41: ekstern fil -- i gruppe -- eksisterer ikke +\stopmessages + \definetabulate [\e!legenda] [|emj1|i1|mR|] @@ -89,13 +71,97 @@ % {$\rm#1$} %D \macros -%D {setuplegend, placelegend} +%D {definepairedbox, setuppairedbox, placepairedbox} %D -%D It makes sense to typeset a legend to a figure in \TEX\ and -%D not in a drawing package. The macro \type {\placelegend} -%D combines a figure (or something else) and its legend. +%D Paired boxes, formally called legends, but from now on a +%D legend is just an instance, are primarily meant for +%D typesetting some text alongside an illustration. Although +%D there is quite some variation possible, the functionality is +%D kept simple, if only because in most cases such pairs are +%D typeset sober. +%D +%D The location specification accepts a pair, where the first +%D keyword specifies the arrangement, and the second one the +%D alignment. The first key of the location pair is one of +%D \type {left}, \type {right}, \type {top} or \type {bottom}, +%D while the second key can also be \type {middle}. +%D +%D The first box is just collected in an horizontal box, but +%D the second one is a vertical box that gets passed the +%D bodyfont and alignment settings. + +% \startbuffer[test] +% \test left \test left,top \test left,bottom \test left,middle +% \test right \test right,top \test right,bottom \test right,middle +% \test top \test top,left \test top,right \test top,middle +% \test bottom \test bottom,left \test bottom,right \test bottom,middle +% \stopbuffer +% +% \def\showtest#1% +% {\pagina +% \typebuffer[demo] +% \def\test##1 +% {\startlinecorrection[blank] +% \getbuffer[demo]% +% \ruledhbox\placelegend +% [bodyfont=6pt,location={##1}] +% {\framed[width=.25\textwidth]{\tttf##1}} +% {#1} +% \stoplinecorrection} +% \getbuffer[test]} +% +% \startbuffer[demo] +% \setuplegend +% [width=\hsize,maxwidth=\makeupwidth, +% height=\vsize,maxheight=\makeupheight] +% \stopbuffer +% +% \showtest{These examples demonstrate the default settings.} +% +% \startbuffer[demo] +% \setuplegend +% [width=\textwidth, +% maxwidth=\textwidth] +% \stopbuffer +% +% \showtest{\input tufte } +% +% \startbuffer[demo] +% \setuplegend +% [width=.65\textwidth] +% \stopbuffer +% +% \showtest{\input knuth } +% +% \startbuffer[demo] +% \setuplegend +% [height=2cm] +% \stopbuffer +% +% \showtest{These examples demonstrate some other settings.} +% +% \startbuffer[demo] +% \setuplegend +% [width=.65\textwidth, +% height=2cm] +% \stopbuffer +% +% \showtest{These examples demonstrate some other settings.} +% +% \startbuffer[demo] +% \setuplegend +% [n=2,align=right,width=.5\textwidth] +% \stopbuffer +% +% \showtest{\input zapf } + +%D \macros +%D {setuplegend, placelegend} %D -%D \showsetup{placelegend} +%D It makes sense to typeset a legend to a figure in \TEX\ +%D and not in a drawing package. The macro \type {\placelegend} +%D combines a figure (or something else) and its legend. This +%D command is just a paired box. %D %D The legend is placed according to \type {location}, being %D \type {bottom} or \type {right}. The macro macro is used as @@ -153,121 +219,231 @@ %D \item head \item legs \item tail \item belly \item horns %D \stopitemize}} %D \stoptypen -%D -%D There are a few more parameters: -%D -%D \showsetup{setuplegend} -\def\setuplegend% - {\dodoubleargument\getparameters[\??ld]} +% \def\setuplegend% +% {\dodoubleargument\getparameters[\??ld]} +% +% \setuplegend +% [\c!n=1, +% \c!afstand=1em, +% \c!tussen={\blanko[\v!middel]}, +% \c!breedte=\hsize, +% \c!hoogte=\vsize, +% \c!korps=, +% \c!plaats=\v!onder] +% +% \def\placelegend% +% {\bgroup +% \dosingleempty\doplacelegend} +% +% \def\doplacelegend[#1]% watch the hsize/vsize tricks +% {\setuplegend[#1]% % and don't change them +% \dowithnextbox +% {\switchtobodyfont[\@@ldkorps]% split under same regime +% \scratchdimen=\wd\nextbox +% \doifelse{\@@ldplaats}{\v!rechts} +% {\vsize=\ht\nextbox +% \vsize=\@@ldhoogte +% \hsize=\zetbreedte +% \advance\hsize by -\scratchdimen +% \advance\hsize by -\@@ldafstand +% \plaatsnaastelkaar{\box\nextbox}\bgroup} +% {\hsize\scratchdimen +% \plaatsonderelkaar{\box\nextbox}\bgroup}% +% \hsize\@@ldbreedte +% \doif{\@@ldplaats}{\v!rechts}{\hskip\@@ldafstand}% +% \ifnum\@@ldn>1 +% \setrigidcolumnhsize\hsize\@@ldafstand\@@ldn +% \fi +% \dowithnextbox +% {\doifelse{\@@ldplaats}{\v!rechts} +% {\vbox to \vsize +% {\ifnum\@@ldn>1 +% \rigidcolumnbalance\nextbox +% \else +% \box\nextbox +% \fi +% \vfill}} +% {\vbox +% {\@@ldtussen +% \ifnum\@@ldn>1 +% \rigidcolumnbalance\nextbox +% \else +% \box\nextbox +% \fi}}% +% \egroup\egroup}% +% \vbox +% \bgroup +% \forgetall +% \tolerantTABLEbreaktrue % hm. +% \blanko[\v!blokkeer]% +% \everypar{\begstrut}% +% \let\next=} +% \hbox} + +\newbox\firstpairedbox +\newbox\secondpairedbox + +\def\definepairedbox% + {\dodoubleempty\dodefinepairedbox} + +\def\dodefinepairedbox[#1][#2]% + {\getparameters + [\??ld#1] + [\c!n=1, + \c!afstand=\bodyfontsize, + \c!tussen={\blanko[\v!middel]}, + \c!breedte=\hsize, + \c!hoogte=\vsize, + \c!maxbreedte=\zetbreedte, + \c!maxhoogte=\zethoogte, + \c!korps=, + \c!uitlijnen=, + \c!plaats=\v!onder, + #2]% + \setvalue{\e!stel#1\e!in}{\setuppairedbox[#1]}% + \setvalue{\e!plaats#1}{\placepairedbox[#1]}} + +\def\setuppairedbox% + {\dodoubleempty\dosetuppairedbox} + +\def\dosetuppairedbox[#1]% + {\getparameters[\??ld#1]} + +\def\placepairedbox% + {\bgroup\dodoubleempty\doplacepairedbox} + +\def\doplacepairedbox[#1][#2]% watch the hsize/vsize tricks + {\setuppairedbox[#1][#2]% % and don't change them + \copyparameters + [\??ld][\??ld#1] + [\c!n,\c!afstand,\c!tussen, + \c!breedte,\c!hoogte,\c!maxbreedte,\c!maxhoogte, + \c!korps,\c!uitlijnen,\c!plaats]% + \beforefirstpairedbox + \dowithnextbox + {\betweenbothpairedboxes + \dowithnextbox + {\afterbothpairedboxes + \egroup} + \vbox\bgroup + \insidesecondpairedbox + \let\next=} + \hbox} -\setuplegend - [\c!n=1, - \c!afstand=1em, - \c!tussen={\blanko[\v!middel]}, - \c!breedte=\hsize, - \c!hoogte=\vsize, - \c!korps=, - \c!plaats=\v!onder] +\def\beforefirstpairedbox% + {\chardef\pairedlocationa=1 % left + \chardef\pairedlocationb=4 % middle + \getfromcommacommand[\@@ldplaats][1]% + \processaction + [\commalistelement] + [ \v!links=>\chardef\pairedlocationa=0, + \v!rechts=>\chardef\pairedlocationa=1, + \v!boven=>\chardef\pairedlocationa=2, + \v!onder=>\chardef\pairedlocationa=3]% + \getfromcommacommand[\@@ldplaats][2]% + \processaction + [\commalistelement] + [ \v!links=>\chardef\pairedlocationb=0, + \v!rechts=>\chardef\pairedlocationb=1, + \v!hoog=>\chardef\pairedlocationb=2, + \v!boven=>\chardef\pairedlocationb=2, + \v!laag=>\chardef\pairedlocationb=3, + \v!onder=>\chardef\pairedlocationb=3, + \v!midden=>\chardef\pairedlocationb=4]} + +\def\betweenbothpairedboxes% + {\switchtobodyfont[\@@ldkorps]% split under same regime + \setbox\firstpairedbox=\box\nextbox + \ifnum\pairedlocationa<2 + \hsize\wd\firstpairedbox % trick + \hsize=\@@ldbreedte + \scratchdimen=\wd\firstpairedbox + \advance\scratchdimen by \@@ldafstand + \bgroup\advance\scratchdimen by \hsize + \ifdim\scratchdimen>\@@ldmaxbreedte\relax + \egroup + \hsize=\@@ldmaxbreedte + \advance\hsize by -\scratchdimen + \else + \egroup + \fi + \else + \hsize\wd\firstpairedbox + \hsize\@@ldbreedte % can be \hsize + \ifdim\hsize>\@@ldmaxbreedte\relax \hsize=\@@ldmaxbreedte \fi % can be \hsize + \fi + \ifnum\@@ldn>1 + \setrigidcolumnhsize\hsize\@@ldafstand\@@ldn + \fi} -\def\placelegend% - {\bgroup - \dosingleempty\doplacelegend} +\def\afterbothpairedboxes% + {\setbox\secondpairedbox=\vbox + {\ifnum\@@ldn>1 \rigidcolumnbalance\nextbox \else \box\nextbox \fi}% + \ifnum\pairedlocationa<2\hbox\else\vbox\fi\bgroup % hide vsize + \forgetall + \ifnum\pairedlocationa<2 + \scratchdimen=\maxoftwoboxdimens\ht\firstpairedbox\secondpairedbox + \vsize=\scratchdimen + \ifdim\scratchdimen<\@@ldhoogte\relax % can be \vsize + \scratchdimen=\@@ldhoogte + \fi + \ifdim\scratchdimen>\@@ldmaxhoogte\relax + \scratchdimen=\@@ldmaxhoogte + \fi + \valignpairedbox\firstpairedbox \scratchdimen + \valignpairedbox\secondpairedbox\scratchdimen + \else + \scratchdimen=\maxoftwoboxdimens\wd\firstpairedbox\secondpairedbox + \halignpairedbox\firstpairedbox \scratchdimen + \halignpairedbox\secondpairedbox\scratchdimen + \scratchdimen=\ht\secondpairedbox + \vsize=\scratchdimen + \ifdim\ht\secondpairedbox<\@@ldhoogte\relax % can be \vsize + \scratchdimen=\@@ldhoogte\relax % \relax needed + \fi + \ifdim\scratchdimen>\@@ldmaxhoogte\relax % todo: totale hoogte + \scratchdimen=\@@ldmaxhoogte\relax % \relax needed + \fi + \ifdim\scratchdimen>\ht\secondpairedbox + \setbox\secondpairedbox\vbox to \scratchdimen + {\ifnum\pairedlocationa=3 \vss\fi + \box\secondpairedbox + \ifnum\pairedlocationa=2 \vss\fi}% + \fi + \fi + \ifcase\pairedlocationa + \box\secondpairedbox\hskip\@@ldafstand\box\firstpairedbox \or + \box\firstpairedbox \hskip\@@ldafstand\box\secondpairedbox\or + \box\secondpairedbox\par \@@ldtussen \box\firstpairedbox \or + \box\firstpairedbox \par \@@ldtussen \box\secondpairedbox\else + \fi + \egroup} -\def\doplacelegend[#1]% watch the hsize/vsize tricks - {\setuplegend[#1]% % and don't change them - \dowithnextbox - {\switchtobodyfont[\@@ldkorps]% split under same regime - \scratchdimen=\wd\nextbox - \doifelse{\@@ldplaats}{\v!rechts} - {\vsize=\ht\nextbox - \vsize=\@@ldhoogte - \hsize=\zetbreedte - \advance\hsize by -\scratchdimen - \advance\hsize by -\@@ldafstand - \plaatsnaastelkaar{\box\nextbox}\bgroup} - {\hsize\scratchdimen - \plaatsonderelkaar{\box\nextbox}\bgroup}% - \hsize\@@ldbreedte - \doif{\@@ldplaats}{\v!rechts}{\hskip\@@ldafstand}% - \ifnum\@@ldn>1 - \setrigidcolumnhsize\hsize\@@ldafstand\@@ldn - \fi - \dowithnextbox - {\doifelse{\@@ldplaats}{\v!rechts} - {\vbox to \vsize - {\ifnum\@@ldn>1 - \rigidcolumnbalance\nextbox - \else - \box\nextbox - \fi - \vfill}} - {\vbox - {\@@ldtussen - \ifnum\@@ldn>1 - \rigidcolumnbalance\nextbox - \else - \box\nextbox - \fi}}% - \egroup\egroup}% - \vbox - \bgroup - \forgetall - \tolerantTABLEbreaktrue % hm. - \blanko[\v!blokkeer]% - \everypar{\begstrut}% - \let\next=} - \hbox} +\def\insidesecondpairedbox% + {\forgetall + \steluitlijnenin[\@@lduitlijnen]% + \tolerantTABLEbreaktrue % hm. + \blanko[\v!blokkeer]% + \everypar{\begstrut}} + +\def\maxoftwoboxdimens#1#2#3% + {#1\ifdim#1#2>#1#3 #2\else#3\fi} + +\def\valignpairedbox#1#2% + {\setbox#1=\vbox to #2 + {\ifcase\pairedlocationb\or\or\or\vss\or\vss\fi + \box#1\relax + \ifcase\pairedlocationb\or\or\vss\or\or\vss\fi}} + +\def\halignpairedbox#1#2% + {\setbox#1=\hbox to #2 + {\ifcase\pairedlocationb\or\hss\or\or\or\hss\fi + \box#1\relax + \ifcase\pairedlocationb\hss\or\or\or\or\hss\fi}} + +\definepairedbox[\e!legenda] -%I n=Combinaties -%I c=\startcombinatie,\stelcombinatiesin -%I -%I Er kunnen meerdere tabellen, figuren enz. worden -%I gecombineerd. Dit gebeurt met het commando: -%I -%I \startcombinatie[n*m] -%I {inhoud 1}{ondertitel 1} -%I {inhoud 2}{ondertitel 2} -%I ..... -%I \stopcombinatie -%I -%I Eventueel kan volstaan worden met [n]. Vier inhouden -%I kunnen bijvoorbeeld worden gecombineerd als: -%I -%I [4*1] of [4] vier inhouden naast elkaar -%I [1*4] vier inhouden onder elkaar -%I [2*2] inhouden twee aan twee onder elkaar -%P -%I Dit commando is goed te combineren met \plaats-commando's: -%I -%I \plaatsfiguur[][]{} -%I \startcombinatie[2] -%I {\legefiguur}{a} -%I {\legefiguur}{b} -%I \stopcombinatie -%I -%I Rond \start-\stopcombineer hoeven geen {} te worden -%I geplaatst. -%I -%I De afstanden tussen de inhouden en de titels kunnen worden -%I ingesteld met: -%I -%I \stelcombinatiesin[voor=,na=,tussen=,afstand=, -%I uitlijnen=,hoogte=,breedte=] -%I -%I Waarbij de afstand betrekking heeft op de horizontale -%I afstand (een maat dus) en voor, na en tussen commando's -%I zijn (bijvoorbeeld \blanko). - -%T n=combinaties -%T m=com -%T a=c -%T -%T \startcombinatie -%T {?} {} -%T {} {} -%T \stopcombinatie - \newcount\horcombinatie % counter \newcount\totcombinatie @@ -396,24 +572,6 @@ \def\plaatsnaastelkaar% {\plaatsondernaastelkaar\valign\vss} -%I n=Files -%I c=\definieerfile -%I -%I De onderstaande commando's zijn beschikbaar, maar nog in -%I ontwikkeling. -%I -%I \gebruikexternefile [groep] [naam] [file] [instellingen] -%I -%I \gebruikexternefiles [groep] [korps=,file=] -%I \stelexternefilesin [groep] [korps=,file=] -%I -%I \naam{naam} of \naam -%I -%I Standaard zijn gedefinieerd: -%I -%I \gebruikexternefiles[pictex][korps=klein,file=pictex] -%I \gebruikexternefiles[table][file=table] - \def\dogebruikexternefiles[#1][#2]% {\getparameters [\??fi#1] @@ -453,24 +611,6 @@ \def\gebruikexternefile% {\doquadrupleargument\dogebruikexternefile} -%I n=Roteren -%I c=\roteer -%I -%I Er is een rotatiecommando beschikbaar: -%I -%I \roteer[rotatie=]{} -%I -%I Waarbij als rotatie 0, 90, 180 of 270 kan worden opgegeven. -%I Als extra instellingen kunnen de instellingen van -%I \omlijnd worden meegegeven. Er wordt gebruik gemaakt van -%I het \special commando en het rotatiemechanisme van -%I PostScript. Dit betekent dat in de previewer de tekst -%I niet (!) geroteerd wordt. Overigens draagt TeX zorg voor -%I de exacte plaatsing, uitlijnen enz. De afhankelijkheid -%I van PostScript is dus tot een minimum beperkt. -%I -%I Verder zijn dezelfde instellingen mogelijk als bij -%I \omlijnd. \presetlocalframed[\??ro] @@ -484,10 +624,11 @@ \vbox to #1\nextbox {#2\relax \hbox to #4\nextbox - {#5\relax + {#5\relax % \number removes leading spaces too + \edef\@@rorotatie{\number\@@rorotatie}% \doifelsenothing{\@@rorotatie} {\dostartrotation{90}} - {\dostartrotation{\@@rorotatie}}% + {\dostartrotation{\@@rorotatie}}% \wd\nextbox=\!!zeropoint \ht\nextbox=\!!zeropoint \box\nextbox @@ -496,6 +637,7 @@ #3}% \egroup} + \def\dostoproteer% {\!!counta=\@@rorotatie \divide\!!counta by 90 @@ -535,28 +677,54 @@ % schaal +\def\doscalelikeafigure% + {\doifsomething{\@@xyfactor\@@xyschaal\@@xyhfactor\@@xybreedte\@@xyhoogte} + {\let \@@efschaal \@@xyschaal + \let \@@effactor \@@xyfactor + \let \@@efbfactor\@@xybfactor + \let \@@efhfactor\@@xyhfactor + \let \@@efbreedte\@@xybreedte + \let \@@efhoogte \@@xyhoogte + \let \@@epx \!!zeropoint + \let \@@epy \!!zeropoint + \edef\@@epw {\the\wd\nextbox}% + \edef\@@eph {\the\ht\nextbox}% + \setfactorfiguresize + \setscalefiguresize + \setdimensionfiguresize + \convertfigureinsertscale\@@epx\figx\figxsca\scax + \convertfigureinsertscale\@@epy\figy\figysca\scay + \scratchdimen=\scax pt \divide\scratchdimen by 100 + \edef\@@xysx{\withoutpt\the\scratchdimen}% + \scratchdimen=\scay pt \divide\scratchdimen by 100 + \edef\@@xysy{\withoutpt\the\scratchdimen}}} + \def\doschaal[#1]% {\bgroup \forgetall - \getparameters[\??xy][\c!sx=1,\c!sy=1,#1]% + \getparameters + [\??xy] + [\c!schaal=,\c!breedte=,\c!hoogte=, + \c!factor=,\c!hfactor=,\c!bfactor=, + \c!sx=1,\c!sy=1,#1]% \dowithnextbox {\dontshowcomposition + \doscalelikeafigure \dimen0=\@@xysy\ht\nextbox \dimen2=\@@xysy\dp\nextbox \dimen4=\@@xysx\wd\nextbox - \dimen6=\dimen0\advance\dimen6 by \dimen2 + \dimen6=\dimen0\advance\dimen6 by \dimen2 \setbox\nextbox=\vbox to \dimen6 {\ht\nextbox=\!!zeropoint \dp\nextbox=\!!zeropoint \vfill % erbij - \dostartscaling\@@xysx\@@xysy\box\nextbox\dostopscaling - }% was \vfill}% + \dostartscaling\@@xysx\@@xysy\box\nextbox\dostopscaling}% \ht\nextbox=\dimen0 \dp\nextbox=\dimen2 \wd\nextbox=\dimen4 \box\nextbox \egroup} - \hbox} % was \vbox} + \hbox} \def\schaal% {\dosingleempty\doschaal} @@ -583,7 +751,8 @@ % %\spiegel{\ruledhbox{\copy0 \schaal{\box0}}} -% verdelen \hsize in fracties +% verdelen \hsize in fracties, wordt nog wat algemener, +% beetje vaag nu % % \fractie[n/m,elementen,afstand] % diff --git a/tex/context/base/meta-clp.tex b/tex/context/base/meta-clp.tex new file mode 100644 index 000000000..8b841e876 --- /dev/null +++ b/tex/context/base/meta-clp.tex @@ -0,0 +1,164 @@ +%D \module +%D [ file=meta-clp, +%D version=2000.07.06, +%D title=\METAPOST\ Graphics, +%D subtitle=Clipping, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D In this library, we define a bunch of clipping paths that +%D can be fed to \type {\clip}. + +\startMPclip{ellipse} + clip currentpicture to unitcircle + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{negellipse} + clip currentpicture to (unitcircle peepholed unitsquare) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{urellipse} + clip currentpicture to urcircle scaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{ulellipse} + clip currentpicture to ulcircle scaled 2 shifted (1,0) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{llellipse} + clip currentpicture to llcircle scaled 2 shifted (1,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lrellipse} + clip currentpicture to lrcircle scaled 2 shifted (0,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{tellipse} + clip currentpicture to tcircle shifted (.5,0) yscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{bellipse} + clip currentpicture to bcircle shifted (.5,.5) yscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lellipse} + clip currentpicture to lcircle shifted (.5,.5) xscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{rellipse} + clip currentpicture to rcircle shifted (0,.5) xscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{diamond} + clip currentpicture to unitdiamond + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{negdiamond} + clip currentpicture to (unitdiamond peepholed unitsquare) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{urtriangle} + clip currentpicture to urtriangle scaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{ultriangle} + clip currentpicture to ultriangle scaled 2 shifted (1,0) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lltriangle} + clip currentpicture to lltriangle scaled 2 shifted (1,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lrtriangle} + clip currentpicture to lrtriangle scaled 2 shifted (0,1) + xscaled \width yscaled \height ; +\stopMPclip + +% More efficient: +% +% \def\dosimpleMPclip#1 +% {clip currentpicture to (#1) xscaled \width yscaled \height ;} +% +% \def\simpleMPclip#1#2% +% {\startMPclip{#1}\dosimpleMPclip{#2}\stopMPclip} +% +% \simpleMPclip {ellipse} {unitcircle} +% \simpleMPclip {diamond} {unitdiamond} +% +% \simpleMPclip {negellipse} {unitcircle peepholed unitsquare} +% \simpleMPclip {negdiamond} {unitdiamond peepholed unitsquare} +% +% \simpleMPclip {urellipse} {urcircle scaled 2 shifted (0,0)} +% \simpleMPclip {ulellipse} {ulcircle scaled 2 shifted (1,0)} +% \simpleMPclip {llellipse} {llcircle scaled 2 shifted (1,1)} +% \simpleMPclip {lrellipse} {lrcircle scaled 2 shifted (0,1)} +% +% \simpleMPclip {tellipse} {tcircle shifted (.5,0) yscaled 2} +% \simpleMPclip {bellipse} {bcircle shifted (.5,.5) yscaled 2} +% \simpleMPclip {lellipse} {lcircle shifted (.5,.5) xscaled 2} +% \simpleMPclip {rellipse} {rcircle shifted (0,.5) xscaled 2} +% +% \simpleMPclip {urtriangle} {urtriangle scaled 2 shifted (0,0)} +% \simpleMPclip {ultriangle} {ultriangle scaled 2 shifted (1,0)} +% \simpleMPclip {lltriangle} {lltriangle scaled 2 shifted (1,1)} +% \simpleMPclip {lrtriangle} {lrtriangle scaled 2 shifted (0,1)} + +%D \in {Figure} [fig:clipping paths] shows which paths are +%D predefined. When applied to a whole picture, their usage +%D is: +%D +%D \starttypen +%D \clip[nx=1,ny=1,mp=ellipse]{some clippable content} +%D \stoptypen +%D +%D \startbuffer +%D \setupclipping [nx=1,ny=1,x=1,y=1] +%D \setupblackrules[width=2cm,height=1cm] +%D \startcombinatie[6*3] % \startcombination[6*3] +%D {\clip[mp=urellipse] {\blackrule}} {urellipse} +%D {\clip[mp=ulellipse] {\blackrule}} {ulellipse} +%D {\clip[mp=llellipse] {\blackrule}} {llellipse} +%D {\clip[mp=lrellipse] {\blackrule}} {lrellipse} +%D {\clip[mp=ellipse] {\blackrule}} {ellipse} +%D {\clip[mp=negellipse]{\blackrule}} {negellipse} +%D {\clip[mp=tellipse] {\blackrule}} {tellipse} +%D {\clip[mp=bellipse] {\blackrule}} {bellipse} +%D {\clip[mp=lellipse] {\blackrule}} {lellipse} +%D {\clip[mp=rellipse] {\blackrule}} {rellipse} +%D {} {} +%D {} {} +%D {\clip[mp=urtriangle]{\blackrule}} {urtriangle} +%D {\clip[mp=ultriangle]{\blackrule}} {ultriangle} +%D {\clip[mp=lltriangle]{\blackrule}} {lltriangle} +%D {\clip[mp=lrtriangle]{\blackrule}} {lrtriangle} +%D {\clip[mp=diamond] {\blackrule}} {diamond} +%D {\clip[mp=negdiamond]{\blackrule}} {negdiamond} +%D \stopcombinatie % \stopcombination +%D \stopbuffer +%D +%D \plaatsfiguur % \placefigure +%D [here][fig:clipping paths] +%D {The predefined clipping paths.} +%D {\haalbuffer} % {\getbuffer} + +\endinput diff --git a/tex/context/base/meta-fig.tex b/tex/context/base/meta-fig.tex new file mode 100644 index 000000000..c282f36c7 --- /dev/null +++ b/tex/context/base/meta-fig.tex @@ -0,0 +1,85 @@ +%D \module +%D [ file=meta-fig, +%D version=2000.09.07, +%D title=\METAPOST\ Graphics, +%D subtitle=Stand Alone Graphics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{MetaPost Graphics / Stand Alone Graphics} + +\unprotect + +%D This module implements a method for defining +%D stand||alone||graphics, that is, each graphic gets is own +%D page. Because graphics are wrapped in a \type {\framed}, +%D you can add overlays to the graphic directly, and since the +%D whole \CONTEXT\ machinery is available, you can also add +%D page backgrounds. +%D +%D \starttypen +%D \setupMPpage +%D [offset=1pt, +%D background=color, +%D backgroundcolor=green] +%D +%D \startMPpage +%D fill fullcircle scaled 10cm withcolor red ; +%D \stopMPpage +%D +%D \startMPpage +%D fill fullsquare rotated 45 scaled 8cm withcolor blue ; +%D \stopMPpage +%D \stoptypen +%D +%D Although this is hardly of any use, you can mix these +%D definitions with the text flow, since all settings are +%D kept local. The page is clipped to the image size. + +\presetlocalframed[\??mp] + +\def\setupMPpage% + {\dodoubleargument\getparameters[\??mp]} + +\def\startMPpage% + {\dosingleempty\dostartMPpage} + +\long\def\dostartMPpage[#1]#2\stopMPpage + {\page + \bgroup + \setbox\scratchbox=\hbox + {\localframed[\??mp][#1]{\startMPcode#2\stopMPcode}} + \edef\MPwd{\the\wd\scratchbox} + \edef\MPht{\the\ht\scratchbox} + \definepapersize + [\s!dummy] + [\c!breedte=\MPwd, + \c!hoogte=\MPht] + \startlocal % keep settings as local as can be + \setuppapersize + [\s!dummy][\s!dummy] + \setuplayout + [\c!breedte=\MPwd,\c!hoogte=\MPht, + \c!kopwit=\!!zeropoint,\c!rugwit=\!!zeropoint, + \c!snijwit=\!!zeropoint,\c!bodemwit=\!!zeropoint, + \c!hoofd=\!!zeropoint,\c!voet=\!!zeropoint] + \stoplocal % which saves us the trouble of push/pop + \startstandardmakeup + \centerbox{\box\scratchbox} + \stopstandardmakeup + \egroup} + +\setupMPpage + [\c!strut=\v!nee, + \c!uitlijnen=, + \c!offset=\v!overlay, + \c!breedte=\v!passend, + \c!hoogte=\v!passend, + \c!kader=\v!uit] + +\protect \endinput diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex new file mode 100644 index 000000000..1554c175d --- /dev/null +++ b/tex/context/base/meta-ini.tex @@ -0,0 +1,510 @@ +%D \module +%D [ file=meta-ini, +%D version=1999.07.10, +%D title=\METAPOST\ Graphics, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{MetaPost Graphics / Initializations} + +\unprotect + +\startmessages dutch library: metapost + title: metapost + 1: metapost bibliotheek -- wordt geladen +\stopmessages + +\startmessages english library: metapost + title: metapost + 1: loading metapost library -- +\stopmessages + +\startmessages german library: metapost + title: metapost + 1: loading metapost library -- +\stopmessages + +\startmessages czech library: metapost + title: metapost + 1: loading metapost library -- +\stopmessages + +\startmessages italian library: metapost + title: metapost + 1: caricamento della libreria metapost -- +\stopmessages + +\startmessages norwegian library: metapost + title: metapost + 1: metapost bibliotek -- blir lest inn +\stopmessages + +%D This module extends the functionality of the support module +%D \type {supp-mps}, the module that is responsible for +%D \METAPOST\ inclusion in \CONTEXT. Some basic macros will be +%D extended. Since some support is depends on \METAPOST\ +%D macros. so let's first preload a few auxiliary \METAPOST\ +%D files. + +\appendtoks + if unknown context_tool : input mp-tool ; fi ; + if unknown context_spec : input mp-spec ; fi ; +\to \MPinitializations + +%D Since we want lables to follow the document settings, we +%D also set the font related variables. + +\appendtoks + defaultfont := "\truefontname{Regular}" ; + defaultscale := \the\bodyfontsize/10pt ; % not good yet +\to \MPinitializations + +%D We save the number of graphics for the sake of \TEXEXEC. + +\newcounter\totalnumberofMPgraphics +\def\thecurrentMPgraphic{\the\currentMPgraphic} + +\appendtoks + \savecurrentvalue\totalnumberofMPgraphics\thecurrentMPgraphic +\to \everybye + +%D \macros +%D {setupMPvariables} +%D +%D When we build collections of \METAPOST\ graphics, like +%D background and buttons, the need for passing settings +%D arises. By (mis|)|using the local prefix that belongs to +%D \type {\framed}, we get a rather natural interface to +%D backgrounds. To prevent conflicts, we will use the \type +%D {-} in \METAPOST\ specific variables, like: +%D +%D \starttypen +%D \setupMPvariables[meta:button][size=20pt] +%D \stoptypen + +\def\@@meta{meta:} + +\def\setupMPvariables% + {\dodoubleempty\dosetupMPvariables} + +\def\dosetupMPvariables[#1][#2]% + {\ifsecondargument + \getrawparameters[#1:][#2]% + \else + \getrawparameters[\@@meta][#1]% + \fi} + +\let\@@framed\s!unknown + +\def\MPvariable#1% + {\getvalue{\ifundefined{\@@framed\@@meta#1}\else\@@framed\fi\@@meta#1}} + +\let\MPvar\MPvariable + +%D \macros +%D {startuniqueMPgraphic, uniqueMPgraphic} +%D +%D This macros is probably of most use to myself, since I like +%D to use graphics that adapt themselves. The next \METAPOST\ +%D kind of graphic is both unique and reused when possible. +%D +%D \starttypen +%D \defineoverlay[example][\uniqueMPgraphic{test}] +%D +%D \startuniqueMPgraphic {test} +%D draw unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D \stopuniqueMPgraphic +%D \stoptypen + +%D For educational purposes, we show the original version +%D first. This one used a rather simple method for determining +%D the uniqueness. +%D +%D \starttypen +%D \long\def\startuniqueMPgraphic#1#2\stopuniqueMPgraphic% +%D {\setvalue{MP:#1}% +%D {\startreusableMPgraphic{\overlaystamp:#1}#2\stopreusableMPgraphic +%D \reuseMPgraphic{\overlaystamp:#1}}} +%D +%D \def\uniqueMPgraphic#1% +%D {\getvalue{MP:#1}} +%D \stoptypen + +\def\overlaystamp% watch the \MPcolor, since colors can be redefined + {\overlaywidth:\overlayheight:\overlaydepth + :\MPcolor{\overlaycolor}:\MPcolor{\overlaylinecolor}} + +%D A better approach is to let additional variables play a role +%D in determining the uniqueness. In the next macro, the +%D second, optional, argument is used to guarantee the +%D uniqueness, as well as prepare variables for passing them to +%D \METAPOST. +%D +%D \starttypen +%D \startuniqueMPgraphic{meta:hash}{gap,angle,...} +%D \stoptypen +%D +%D The calling macro also accepts a second argument. For +%D convenient use in overlay definitions, we use \type {{}} +%D instead of \type {[]}. +%D +%D \starttypen +%D \uniqueMPgraphic{meta:hash}{gap=10pt,angle=30} +%D \stoptypen + +\def\handleuniqueMPgraphic#1#2#3% + {\def\@@meta{#1:}% + \extendMPoverlaystamp{#2}% incl prepare + %\startreusableMPgraphic{\overlaystamp:#1}#3\stopreusableMPgraphic + %\getvalue{MP:\overlaystamp:#1}} % no \reuseMPgraphic, else wrong \@@meta + \ifundefined{MP:\overlaystamp:#1}% + \enableincludeMPgraphics + \startMPgraphic#3\stopMPgraphic + \doifobjectssupportedelse{}{\useMPboxfalse}% + \ifuseMPbox + \douseMPbox{MP:\overlaystamp:#1}% + \else + \nouseMPbox{MP:\overlaystamp:#1}% + \fi + \fi + \getvalue{MP:\overlaystamp:#1}} + +\long\def\startuniqueMPgraphic% + {\dodoublegroupempty\dostartuniqueMPgraphic} + +\long\def\dostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic% + {\setvalue{MP:#1}{\handleuniqueMPgraphic{#1}{#2}{#3}}} + +\unexpanded\def\uniqueMPgraphic% + {\dodoublegroupempty\douniqueMPgraphic} + +\def\douniqueMPgraphic#1#2% +% {{\def\@@meta{#1:}\setupMPvariables[#2]\getvalue{MP:#1}{}}} + {{\setupMPvariables[#1][#2]\getvalue{MP:#1}{}}} + +\long\def\handleuseMPgraphic#1#2#3% + {\bgroup + \def\@@meta{#1:}% + \prepareMPvariables{#2}% + \enableincludeMPgraphics + \startMPgraphic#3\stopMPgraphic + \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% + \deallocateMPslot\currentMPgraphic + \placeMPgraphic + \egroup} + +\long\def\startuseMPgraphic% + {\dodoublegroupempty\dostartuseMPgraphic} + +\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic% + {\long\setgvalue{MP:#1}{\handleuseMPgraphic{#1}{#2}{#3}}} + +\long\def\handlereusableMPgraphic#1#2#3% + {\bgroup + \def\@@meta{#1:}% + \prepareMPvariables{#2}% + \enableincludeMPgraphics + \startMPgraphic#3\stopMPgraphic + \doifobjectssupportedelse{}{\useMPboxfalse}% + \ifuseMPbox + \douseMPbox{MP:#1}% + \else + \nouseMPbox{MP:#1}% + \fi + \getvalue{MP:#1}% + \egroup} + +\long\def\startreusableMPgraphic% + {\dodoublegroupempty\dostartreusableMPgraphic} + +\long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic% + {\ifundefined{MP:#1}% + \long\setgvalue{MP:#1}{\handlereusableMPgraphic{#1}{#2}{#3}}% + \fi} + +\unexpanded\def\useMPgraphic% + {\dodoublegroupempty\douseMPgraphic} + +\def\douseMPgraphic#1#2% + {{\setupMPvariables[#1][#2]\getvalue{MP:#1}{}}} + +\let\reuseMPgraphic\useMPgraphic + +\def\enableincludeMPgraphics% + {\let\handleuseMPgraphic \thirdofthreearguments + \let\handlereusableMPgraphic\thirdofthreearguments} + +%D One way of defining a stamp is: +%D +%D \starttypen +%D \def\extendMPoverlaystamp#1% +%D {\def\docommando##1% +%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}% +%D \processcommalist[#1]\docommando} +%D \stoptypen + +%D Since we need to feed \METAPOST\ with expanded dimensions, +%D we introduce a dedicated expansion engine. + +\def\prepareMPvariable#1% + {\ifundefined{\@@framed\@@meta#1}% + \doprepareMPvariable{\@@meta#1}% + \else + \doprepareMPvariable{\@@framed\@@meta#1}% + \fi} + +\def\doprepareMPvariable#1% + {\doifelsenothing{\getvalue{#1}} + {\setevalue{#1}{\MPcolor{black}}} + {\doifcolorelse{\getvalue{#1}} + {\setevalue{#1}{\MPcolor{\getvalue{#1}}}} + {\setbox\scratchbox=\hbox{\scratchdimen=\getvalue{#1}sp}% + \ifdim\wd\scratchbox=\!!zeropoint + \scratchcounter=\getvalue{#1}\relax + \setevalue{#1}{\the\scratchcounter}% + \else + \scratchdimen=\getvalue{#1}\relax + \setevalue{#1}{\the\scratchdimen}% + \fi}}} + +%D We redefine \type {\extendMPoverlaystamp} to preprocess +%D variables using \type {\prepareMPvariable}. + +\def\extendMPoverlaystamp#1% + {\def\docommando##1% + {\prepareMPvariable{##1}% + \edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}% + \processcommalist[#1]\docommando} + +\def\prepareMPvariables#1% + {\processcommalist[#1]\prepareMPvariable} + +%D \macros +%D {MPdatafile} +%D +%D We redefine a macro from \type {supp-mps.tex}: + +\def\MPdatafile% + {\bufferprefix mpd-\the\currentMPgraphic.mpd} + +%D We also have to make sure that \METAPOST\ knows this: + +\appendtoks + if not known _data_prefix_ : + string _data_prefix_ , _data_suffix_ ; + fi ; + _data_prefix_ := "\bufferprefix mpd-" ; + _data_suffix_ := ".mpd" ; +\to \MPinitializations + +%D \macros +%D {getMPdata} +%D +%D The current data is loaded with: + +\def\getMPdata% + {\readlocfile{\MPdatafile}{}{}} + +%D When we collect graphics in one file, we run into +%D troubles, since \METAPOST\ has a built in limit (of 4) +%D on the number of files it can handle. It's therefore +%D better to collect all data in one file and filter it. + +\def\getMPdata% + {\long\def\MPdata##1##2% + {\ifnum##1=\currentMPgraphic\relax##2\fi}% + \readlocfile{\MPgraphicfile.mpd}{}{}} + +%D We have to enable this mechanism with: + +\appendtoks + boolean collapse_data ; collapse_data := true ; + _data_suffix_ := ".mpd" ; % overloads previous one +\to \MPinitializations + +%D For the moment, the next one is a private macro: + +\def\processMPbuffer% + {\dosingleempty\doprocessMPbuffer} + +\def\doprocessMPbuffer[#1]% + {\doifelsenothing{#1} + {\doprocessMPbuffer[\jobname]} + {\bgroup + \let\par\empty + \!!toksa=\emptytoks + \def\copyMPbufferline{\expandafter\appendtoks\fileline\to\!!toksa}% + \def\dodoprocessMPbuffer##1% + {\doprocessfile\scratchread{\TEXbufferfile{##1}}\copyMPbufferline}% + \processcommalist[#1]\dodoprocessMPbuffer + \ifMPrun + \@EA\startMPrun\the\!!toksa\stopMPrun + \else + \@EA\startuseMPgraphic\@EA{\@EA\s!dummy\@EA}\the\!!toksa\stopuseMPgraphic + \useMPgraphic{\s!dummy}% + \fi + \egroup}} + +%D \macros +%D {startMPenvironment, resetMPenvironment} +%D +%D In order to synchronize the main \TEX\ run and the runs +%D local to \METAPOST, environments can be passed. + +\ifx\everyMPTEXgraphic\undefined + \newtoks\everyMPTEXgraphic +\fi + +\def\startMPenvironment% % second arg gobbles spaces, so + {\dodoubleempty\dostartMPenvironment} % that reset gives \emptytoks + +\long\def\dostartMPenvironment[#1][#2]#3\stopMPenvironment% + {\doif{#1}{\s!reset}{\resetMPenvironment}% + \appendtoks#3\to\everyMPTEXgraphic} + +\def\resetMPenvironment% + {\everyMPTEXgraphic=\emptytoks} % = is really needed ! + +%D This command takes \type {[reset]} as optional +%D argument. +%D +%D \starttypen +%D \startMPenvironment +%D \setupbodyfont[pos,14.4pt] +%D \stopMPenvironment +%D +%D \startMPcode +%D draw btex \sl Hans Hagen etex scaled 5 ; +%D \stopMPcode +%D \stoptypen +%D +%D The \type {\resetMPenvironment} is a quick way to erase +%D the token list. + +%D We don't want spurious files, do we? + +\def\initializeMPgraphics% \unlinkfile{\MPgraphicfile.mp} -> empty file + {%\ifx\bufferprefix\empty \else + \immediate\openout\MPwrite\MPgraphicfile.mp + \immediate\write\MPwrite{end.}% + \immediate\closeout\MPwrite + }%\fi} + +%D Loading specific \METAPOST\ related definitions is +%D accomplished by: + +\def\douseMPlibrary#1% + {\doifundefined{\c!file\f!javascriptprefix#1} + {\setvalue{\c!file\f!javascriptprefix#1}{} + \makeshortfilename[\f!metapostprefix#1] + \showmessage{\m!metapost}{1}{#1} + \startreadingfile + \readsysfile{\shortfilename}{}{} + \stopreadingfile}} + +\def\useMPlibrary[#1]% + {\processcommalist[#1]\douseMPlibrary} + +%D \macros +%D {setMPtext, MPtext, MPstring, MPbetex} +%D +%D To be documented: +%D +%D \starttyping +%D \setMPtext{identifier}{text} +%D +%D \MPtext {identifier} +%D \MPstring{identifier} +%D \MPbetex {identifier} +%D \stoptyping + +\def\@@MPT{@MPT@} + +\def\forceMPTEXgraphic% + {\long\def\checkMPTEXgraphic##1{\global\MPTEXgraphictrue}} + +\def\setMPtext#1#2% + {%\forceMPTEXgraphic + \convertargument#2\to\ascii + \setevalue{\@@MPT#1}{\ascii}} + +\def\MPtext #1{\getvalue{\@@MPT#1}} +\def\MPstring#1{"\getvalue{\@@MPT#1}"} +\def\MPbetex #1{btex \getvalue{\@@MPT#1} etex} + +%D In order to communicate conveniently with the \TEX\ +%D engine, we introduce some typesetting variables. + +\startuseMPgraphic{init data} + color OverlayColor, OverlayLineColor ; + % + OverlayWidth := \overlaywidth ; + OverlayHeight := \overlayheight ; + OverlayDepth := \overlayheight ; + OverlayColor := \MPcolor{\overlaycolor} ; + OverlayLineWidth := \overlaylinewidth ; + OverlayLineColor := \MPcolor{\overlaylinecolor} ; + % + BaseLineSkip := \the\baselineskip ; + LineHeight := \the\baselineskip ; + BodyFontSize := \the\bodyfontsize ; + % + StrutHeight := \strutheight ; + StrutDepth := \strutdepth ; + % + CurrentWidth := \the\hsize ; + CurrentHeight := \the\vsize ; + % + EmWidth := \the\fontdimen6\font ; + ExHeight := \the\fontdimen5\font ; + % + PageNumber := \the\realpageno ; + RealPageNumber := \the\pageno ; + LastPageNumber := \lastpage ; +\stopuseMPgraphic + +\appendtoks + \includeMPgraphic{init data} +\to \MPinitializations + +% this will become (more efficient) +% +% \startuseMPgraphic{init data} +% tx1 := \the\baselineskip ; +% tx2 := \the\baselineskip ; +% tx3 := \the\bodyfontsize ; +% tx4 := \strutheight ; +% tx5 := \strutdepth ; +% tx6 := \the\hsize ; +% tx7 := \the\vsize ; +% tx8 := \the\fontdimen6\font ; +% tx9 := \the\fontdimen5\font ; +% \stopuseMPgraphic +% +% def map_tx_variables = +% BaseLineSkip := tx1 ; +% LineHeight := tx2 ; +% BodyFontSize := tx3 ; +% StrutHeight := tx4 ; +% StrutDepth := tx5 ; +% CurrentWidth := tx6 ; +% Currentheight := tx7 ; +% EmWidth := tx8 ; +% ExHeight := tx9 ; +% enddef ; +% +% extra_begin_fig .... + +\protect \endinput + +% also: +% +% linecap := rounded ; +% linejoin := rounded ; +% drawoptions () ; diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex new file mode 100644 index 000000000..7252cf868 --- /dev/null +++ b/tex/context/base/meta-pag.tex @@ -0,0 +1,115 @@ +%D \module +%D [ file=meta-ini, +%D version=1999.07.10, +%D title=\METAPOST\ Graphics, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D These definitions used to be part of the old \type +%D {core-mps} file, later changed into \type {meta-ini}, but +%D keeping them separate is cleaner. + +\writestatus{loading}{MetaPost Graphics / Page Data Management} + +\unprotect + +\appendtoks + if unknown context_page : input mp-page ; fi ; +\to \MPinitializations + +%D The next few macros tell \METAPOST\ how the \CONTEXT\ +%D pagebody looks. + +\startuseMPgraphic{page data} + boolean PageStateAvailable ; PageStateAvailable := true ; + boolean OnRightPage ; OnRightPage := true ; + def LoadPageState = + OnRightPage := \MPonrightpage ; + PageNumber := \realfolio ; + PaperHeight := \the\papierhoogte ; + PaperWidth := \the\papierbreedte ; + PrintPaperHeight := \the\printpapierhoogte ; + PrintPaperWidth := \the\printpapierbreedte ; + TopSpace := \the\kopwit ; + BackSpace := \the\rugwit ; + MakeupHeight := \the\zethoogte ; + MakeupWidth := \the\zetbreedte ; + TopHeight := \the\bovenhoogte ; + TopDistance := \bovenafstand ; + HeaderHeight := \the\hoofdhoogte ; + HeaderDistance := \hoofdafstand ; + TextHeight := \the\teksthoogte ; + FooterDistance := \voetafstand ; + FooterHeight := \the\voethoogte ; + BottomDistance := \onderafstand ; + BottomHeight := \the\onderhoogte ; + LeftEdgeWidth := \the\linkerrandbreedte ; + LeftEdgeDistance := \linkerrandafstand ; + LeftMarginWidth := \the\linkermargebreedte ; + LeftMarginDistance := \linkermargeafstand ; + TextWidth := \the\tekstbreedte ; + RightMarginDistance := \rechtermargeafstand ; + RightMarginWidth := \the\rechtermargebreedte ; + RightEdgeDistance := \rechterrandafstand ; + RightEdgeWidth := \the\rechterrandbreedte ; + PageOffset := \MPpageoffset ; + PageDepth := \MPpagedepth ; + enddef ; +\stopuseMPgraphic + +\def\MPonrightpage{true} +\let\MPpageoffset \!!zeropoint +\let\MPpagedepth \!!zeropoint + +\def\freezeMPpagelayout% + {\doifelsevalue{\??ma\v!pagina\c!offset}{\v!overlay} + {\let\MPpageoffset\!!zeropoint} + {\edef\MPpageoffset{\getvalue{\??ma\v!pagina\c!offset}}}% + \edef\MPpagedepth{\getvalue{\??ma\v!pagina\c!diepte}}% + \freezedimenmacro\MPpageoffset + \freezedimenmacro\MPpagedepth + \doifbothsides + \def\MPonrightpage{true}% + \orsideone + \def\MPonrightpage{true}% + \orsidetwo + \def\MPonrightpage{false}% + \od} + +\def\freezeMPlayout% must be done more efficient + {\freezedimenmacro\bovenafstand + \freezedimenmacro\hoofdafstand + \freezedimenmacro\voetafstand + \freezedimenmacro\onderafstand + \freezedimenmacro\linkerrandafstand + \freezedimenmacro\linkermargeafstand + \freezedimenmacro\rechtermargeafstand + \freezedimenmacro\rechterrandafstand} + +%D We need to freeze the pagelayout before the backgrounds +%D are build, because the overlay will temporarily become +%D zero (overlay). + +\appendtoks + \freezeMPpagelayout +\to \everypagebody + +%D By freezing these value every graphic, we can use layout +%D variables that change halfways a page, whatever use that +%D has. + +\prependtoks + \freezeMPlayout % to be used grouped !!! +\to \everyMPgraphic + +\appendtoks + \includeMPgraphic{page data} +\to \MPinitializations + +\protect \endinput diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-txt.tex new file mode 100644 index 000000000..d39b20ef5 --- /dev/null +++ b/tex/context/base/meta-txt.tex @@ -0,0 +1,261 @@ +%D \module +%D [ file=meta-txt, +%D version=2000.07.06, +%D title=\METAPOST\ Graphics, +%D subtitle=Text Tricks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D In this library some handy text manipulations are defined + +\unprotect + +\appendtoks + input mp-text ; +\to \MPinitializations + +%%%%%%% + +% \def\newchar#1{\chardef#1=0 } + +\newdimen\parwidth +\newdimen\parheight +\newdimen\parvoffset +\newdimen\parhoffset +\newcount\parlines +\newtoks \partoks +\newbox \shapetextbox +\newif \ifparseries +\chardef \parfirst=0 + +\def\startshapetext[#1]% + {\global\newcounter\currentshapetext + \global\setbox\shapetextbox=\vbox\bgroup + \expanded{\switchtobodyfont[\@@shkorps]}% + \dontcomplain + \hsize\parwidth + \setuptolerance[\v!zeersoepel,\v!rek]% + \!!counta=0 + \!!toksa=\emptytoks + \def\docommando##1% + {\setbox\scratchbox=\hbox{\useMPgraphic{##1}}% + \global\chardef\parfirst=0 + \getMPdata % \readlocfile{\MPdatafile}{}{}% + \setshapecharacteristics + \advance\!!counta by \parlines + \expandafter\appendtoks\the\partoks\to\!!toksa}% + \processcommalist[#1]\docommando + \global\parseriestrue + \xdef\totalparlines{\the\!!counta}% + \global\partoks\!!toksa + \expanded{\parshape \the\!!counta \the\!!toksa}% + \setshapecharacteristics % extra dummy + \ifparseries\def\par{\endgraf\adaptparshape}\fi + \EveryPar{\begstrut}} + +\def\stopshapetext% + {\endstrut + %\removebottomthings + \egroup + \global\newcounter\currentshapetext + \getshapecharacteristics} + +\def\adaptparshape% + {\def\docommando##1% + {\ifcase\!!counta + \expandafter\appendtoks\space##1 \to\!!toksa + \else + \advance\!!counta by -1 + \fi}% + \!!counta=\prevgraf + \doglobal\decrement(\totalparlines,\!!counta)% + \multiply\!!counta by 2 + \!!toksa=\emptytoks + \expanded{\processseparatedlist[\the\partoks][\space]}\docommando + \global\partoks=\!!toksa + \expanded{\parshape\totalparlines\the\partoks}} + +\def\getshapecharacteristics% + {\doglobal\increment\currentshapetext + \doifdefinedelse{parlines:\currentshapetext} + {\global\parlines =\getvalue{parlines:\currentshapetext}% + \global\chardef\parfirst =\getvalue{parfirst:\currentshapetext}% + \global\parvoffset =\getvalue{parvoffset:\currentshapetext}% + \global\parhoffset =\getvalue{parhoffset:\currentshapetext}% + \global\parwidth =\getvalue{parwidth:\currentshapetext}% + \global\parheight =\getvalue{parheight:\currentshapetext}} + {\global\parlines =1 + \global\chardef\parfirst =0 + \global\parvoffset =\!!zeropoint + \global\parhoffset =\!!zeropoint + \global\parwidth =\hsize + \global\parheight =\vsize}} + +\def\setshapecharacteristics% + {\doglobal\increment\currentshapetext + \setxvalue{parlines:\currentshapetext }{\the\parlines}% + \setxvalue{parfirst:\currentshapetext }{\the\parfirst}% + \setxvalue{parvoffset:\currentshapetext}{\the\parvoffset}% + \setxvalue{parhoffset:\currentshapetext}{\the\parhoffset}% + \setxvalue{parwidth:\currentshapetext }{\the\parwidth}% + \setxvalue{parheight:\currentshapetext }{\the\parheight}} + +\def\getshapetext% option: unvbox + {\vbox\bgroup + \forgetall + \setbox\scratchbox\vbox to \parheight + {\expanded{\switchtobodyfont[\@@shkorps]}% evt strutheight en + \splittopskip=\strutheight % lineheight opslaan + \vskip\parvoffset % scheelt switch en + \ifcase\parfirst\or\vskip\lineheight\fi % is ook veiliger + \hskip\parhoffset + \hbox{\vsplit\shapetextbox to \parlines\lineheight}}% + \wd\scratchbox=\parwidth + \ht\scratchbox=\parheight + \dp\scratchbox=\!!zeropoint + \box\scratchbox + \getshapecharacteristics + \egroup} + +\def\setupshapetexts% + {\dodoubleempty\getparameters[\??sh]} + +\setupshapetexts% + [\c!korps=] + +%%%%%%% + +\doifundefined{RotFont}{\definefont[RotFont][RegularBold]} + +\def\processfollowingtoken#1% strut toegevoegd + {\appendtoks#1\to\MPtoks + \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}% + \startMPdrawing + n := n + 1 ; len[n] := \the\wd\MPbox ; + \stopMPdrawing + \startMPdrawing[-] + pic[n] := btex \RotFont\setstrut\strut#1 etex ; + \stopMPdrawing} + +\startuseMPgraphic{followtokens} + % we default to nothing +\stopuseMPgraphic + +\def\followtokens#1% + {\vbox\bgroup + \forgetall + \dontcomplain + \MPtoks\emptytoks + \resetMPdrawing + \startMPdrawing + \includeMPgraphic{followtokens} + picture pic[] ; numeric len[], n ; n := 0 ; + \stopMPdrawing + \handletokens#1\with\processfollowingtoken + \startMPdrawing + if unknown RotPath : path RotPath ; RotPath := origin ; fi ; + if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ; + if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ; + numeric al, at, pl, wid, pos ; pair ap, ad ; + al := arclength RotPath ; + if al=0 : + al := len[n] + ExtraRot ; + RotPath := origin -- (al,0) ; + fi ; + if al