diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-01-24 12:00:59 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-01-24 12:00:59 +0100 |
commit | 7ce2f30f31421eb46d07ff65cbf9fcbda1d6612a (patch) | |
tree | cb78bde46cd0939d74075a8047ec8d9bf0210a4a /tex/context/modules/mkiv | |
parent | 35a569ef13b42755e7469cf93d3e4982e12252d6 (diff) | |
download | context-7ce2f30f31421eb46d07ff65cbf9fcbda1d6612a.tar.gz |
2018-01-24 10:57:00
Diffstat (limited to 'tex/context/modules/mkiv')
-rw-r--r-- | tex/context/modules/mkiv/m-cweb.mkiv | 417 | ||||
-rw-r--r-- | tex/context/modules/mkiv/m-subsub.mkiv | 76 | ||||
-rw-r--r-- | tex/context/modules/mkiv/s-evohome.mkiv | 11 |
3 files changed, 218 insertions, 286 deletions
diff --git a/tex/context/modules/mkiv/m-cweb.mkiv b/tex/context/modules/mkiv/m-cweb.mkiv index eb2395e48..2bf4e967f 100644 --- a/tex/context/modules/mkiv/m-cweb.mkiv +++ b/tex/context/modules/mkiv/m-cweb.mkiv @@ -11,7 +11,8 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D This module has to be redone in the mkiv way. Stepwise. +%D This module has to be redone in the mkiv way and I do that stepwise so the +%D current code is not okay. % todo: % @@ -24,26 +25,24 @@ %D \gdef\CWEBquote#1.{{\em Quote :}\ #1.} % checks the . %D -%D This module (re)implements the \CWEB\ macros as defined in the file -%D \type{cwebmac.tex}. +%D This module (re)implements the \CWEB\ macros as defined in the file \type +%D {cwebmac.tex}. \CWEB\ uses short, often one character long, names for macros. +%D This is no real problem because no one is supposed to read and understand the +%D files generated by \CWEB. The standard macros are meant for \PLAIN\ \TEX\ users. +%D In \CONTEXT\ and other macro packages however, there is a potential conflict with +%D format specific or user defined commands. Furthermore, the \CWEB\ macros +%D implement their own output routines. When integrating \CWEB\ documents in another +%D environment, the \CWEB\ specific macros have to be made local. The first part of +%D this module is dedicated to this feature. %D -%D \CWEB\ uses short, often one character long, names for macros. This is no real -%D problem because no one is supposed to read and understand the files generated by -%D \CWEB. The standard macros are meant for \PLAIN\ \TEX\ users. In \CONTEXT\ and -%D other macro packages however, there is a potential conflict with format specific -%D or user defined commands. Furthermore, the \CWEB\ macros implement their own -%D output routines. When integrating \CWEB\ documents in another environment, the -%D \CWEB\ specific macros have to be made local. The first part of this module is -%D dedicated to this feature. -%D -%D Instead of using \type{\def} and \type{\let} for defining macros, we use: +%D Instead of using \type {\def} and \type {\let} for defining macros, we use: %D %D \starttyping %D \defCEBmacro arguments {meaning} %D \letCEBmacro arguments {meaning} %D \stoptyping %D -%D \CWEB files contain implicit calls to macros that generate the table of contents, +%D \CWEB\ files contain implicit calls to macros that generate the table of contents, %D the lists of sections and the index. Because we want to be much more flexible, we %D implemented our own alternatives, and therefore have to bypass the original ones. %D The next macro is used for defining these obsolete \CWEB\ macros. The dummies @@ -57,6 +56,10 @@ %D purposes. First it enables us to activate the \CWEB\ macros, which are saved %D under a different name, second it can be used to temporary restore the meanings, %D for instance when the output routine builds the page. +%D +%D We don't provide specific formatting commands. We just assume \CONTEXT\ being +%D used (so you can use all it provides) and|/|or that specific user macros are +%D implemented somewhere else. \unprotect @@ -69,7 +72,7 @@ %D \deactivateCWEB %D \stoptyping %D -%D Which are implemented as: +%D These are implemented as: \unexpanded\def\activateCWEB {\let\doCWEB\activateCWEBmacro @@ -80,7 +83,7 @@ \the\CWEBmacros} %D The three definition macros append the name of the macro to the list. The first -%D two macros save the meaning, the last one assigns \type{{}} to the macro and +%D two macros save the meaning, the last one assigns \type {{}} to the macro and %D gobbles original meaning. \installcorenamespace{newCWEB} @@ -99,7 +102,7 @@ \setuvalue{\??newCWEB\string#1}#2{}% \gobbleoneargument} -%D The macro \type{\defCWEBdummy} of course takes care of the argument. This leaves +%D The macro \type {\defCWEBdummy} of course takes care of the argument. This leaves %D the two (de|)|activating macros: \unexpanded\def\CWEBmacro#1% @@ -107,7 +110,7 @@ \unexpanded\def\activateCWEBmacro#1% {\letvalue{\??oldCWEB\string#1}=#1% - \unexpanded\def#1{\CWEBmacro#1}} % really \unexpanded here? + \unexpanded\def#1{\CWEBmacro#1}} \unexpanded\def\deactivateCWEBmacro#1% {\expandafter\let\expandafter#1\csname\??oldCWEB\string#1\endcsname} @@ -130,47 +133,15 @@ %D %D The next is based on the standard macros for CWEB listings (in addition to \type %D {plain.tex}) Version 3.1 --- September 1994. -%D -%D \macros{.}{} + +%D \macros{.} %D %D \CWEBquote preserve a way to get the dot accent (all other accents will still %D work as usual). \letCWEBmacro\: = \. -%D \macros{mc,sc,cmntfont,eightrm}{} -%D -%D The naming of the fonts in in line with those in \PLAIN\ \TEX. Although \CONTEXT\ -%D implements its own scheme, there is still support for the \PLAIN\ ones. We keep -%D the original names, but change their meaning. That way the macros obey switching -%D 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} font is not part of -%D the default mechanism. We make use of the \CONTEXT\ variables \type {\textface}, -%D \type {\scriptface} and \type {\scriptscriptface}, which hold the current sizes. - -\defCWEBmacro\tentex {\tttf} - -% \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 therefore have to -%D specify dimension in points a bit different. Specifications like .6pt are changed -%D to \type {.06} times \type {\bodyfontsize}. - -\defCWEBmacro\CWEBpt {\bodyfontsize} - -%D \macros{CEE,UNIX,TEX,CPLUSPLUS}{} +%D \macros{CEE,UNIX,TEX,CPLUSPLUS} %D %D Next come some logo's. It does not make much sense to use the \CONTEXT\ logo %D mechanism here, so we simply say: @@ -181,7 +152,7 @@ \defCWEBmacro\CPLUSPLUS/{{\tx C\PP\spacefactor1000}} \defCWEBmacro \Cee{\CEE/} % for backward compatibility -%D \macros{\ }{} +%D \macros{\ } %D %D Now we come to the real work: the short commands that make up the typography. %D @@ -191,7 +162,7 @@ {\dontleavehmode \hbox{\it#1\/\kern.05em}} -%D \macros{\string|}{} +%D \macros{\string|} %D %D \CWEBquote one letter identifiers look better this way. @@ -199,7 +170,7 @@ {\dontleavehmode \hbox{$#1$}} -%D \macros{\string\&}{} +%D \macros{\string\&} %D %D \CWEBquote boldface type for reserved words. @@ -207,39 +178,39 @@ {\dontleavehmode \hbox{\bf#1\/\kern.05em}} -%D \macros{.}{} +%D \macros{.} %D %D Here we use the previously saved period. This macro takes care of special %D characters in strings. \defCWEBmacro\.#1% {\dontleavehmode - \hbox - {\tttf % 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{)}{} + \hbox + {\tttf % 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{\tttf\BS}}{}{}} -%D \macros{AT}{} +%D \macros{AT} %D %D \CWEBquote at sign for control text (not needed in versions $>=$ 2.9). \defCWEBmacro\AT{@} -%D \macros{ATL,postATL,NOATL}{} +%D \macros{ATL,postATL,NOATL} %D %D A two step macro that handles whatever. @@ -251,16 +222,16 @@ \postATL} \defCWEBmacro\postATL#1 #2 % - {\bf letter \\{\WORD{\char"#1}} tangles as \tttf "#2"% + {\bf letter \\{\WORD{\char"#1}} tangles as \tttf \quotation{#2}% \egroup \par} \defCWEBmacro\noATL#1 #2 % {} -%D \macros{noatl}{} +%D \macros{noatl} %D -%D \CWEBquote suppress output from \type{@l}. +%D \CWEBquote suppress output from \type {@l}. \defCWEBmacro\noatl {\let\ATL\noATL} @@ -285,24 +256,28 @@ \letCWEBmacro\CF \letterhat % circumflex character in a string \letCWEBmacro\SP \textvisiblespace % (visible) space in a string +%D We're in mathmode, otherwise we could have: +%D +%D \starttyping +%D \defCWEBmacro\PP{\raise.15em\hbox{\tx\textplus \kern-.05em\textplus }} +%D \defCWEBmacro\MM{\raise.15em\hbox{\tx\textminus\kern .10em\textminus}} +%D \defCWEBmacro\MG{\raise.15em\hbox{\rightarrow}} +%D \stoptyping + \defCWEBmacro\PP % symbol for ++ - {\kern.05\CWEBpt - \raise.1\CWEBpt\hbox{$\scriptstyle+\kern-.1\CWEBpt+$}% - \kern.05\CWEBpt} + {\kern.05em + \raise.1em\hbox{$\scriptstyle+\kern-.1em+$}% + \kern.05em} \defCWEBmacro\MM % symbol for -- - {\kern.05\CWEBpt - \raise.1\CWEBpt\hbox{$\scriptstyle-\kern-.1\CWEBpt-$}% - \kern.05\CWEBpt} + {\kern.05em + \raise.1em\hbox{$\scriptstyle-\kern-.1em-$}% + \kern.05em} \defCWEBmacro\MG - {\kern-.2\CWEBpt - \lower.3\CWEBpt\hbox{$\rightarrow$}% - \kern .1\CWEBpt} - -% \defCWEBmacro\PP{\raise.15em\hbox{\tx\textplus \kern-.05em\textplus }} % symbol for ++ -% \defCWEBmacro\MM{\raise.15em\hbox{\tx\textminus\kern .10em\textminus}} % symbol for -- -% \defCWEBmacro\MG{\raise.15em\hbox{\rightarrow}} + {\kern-.2em + \lower.3em\hbox{$\rightarrow$}% + \kern .1em} \defCWEBmacro\MRL#1% {\mathrel{\let\K==#1}} @@ -336,28 +311,27 @@ \defCWEBmacro\3#1% optional break within a statement {\hfil - \penalty#10 + \penalty#10\relax \hfilneg} \defCWEBmacro\4% backspace one notch - {\hbox to -1em{}} + {\hpack to -1em{}} \defCWEBmacro\5% optional break {\hfil - \penalty-1 + \penalty\minusone \hfilneg \kern2.5em - \hbox to -2em{}% + \hpack to -2em{}% \ignorespaces} \defCWEBmacro\6% forced break - {\ifmmode - \else + {\ifmmode \else \par \hangindent\CWEBind em \noindent \kern\CWEBind em - \hbox to -2em{}% + \hpack to -2em{}% \ignorespaces \fi} @@ -372,9 +346,10 @@ \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 +\newcount\CWEBgdepth % depth of current major group, plus one +\newcount\CWEBsecpagedepth + +\CWEBsecpagedepth=3 % page breaks will occur for depths -1, 0, and 1 \defCWEBmacro\?% {\mathrel?} @@ -465,27 +440,27 @@ {\theCWEByskip} \letCWEBmacro\Z = \le -% \letCWEBmacro\ZZ = \let % now you can \write the control sequence \ZZ +\letCWEBmacro\ZZ = \relax \letCWEBmacro\* = * \defCWEBmacro\oct {\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} -\defCWEBmacro\hex% +\defCWEBmacro\hex {\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} \defCWEBmacro\vb#1% {\dontleavehmode \hbox - {\kern.2\CWEBpt + {\kern.2em \vrule \vtop {\vbox {\hrule - \hbox{\strut\kern.2\CWEBpt\.{#1}\kern.2\CWEBpt}} + \hbox{\strut\kern.2em\.{#1}\kern.2em}} \hrule}% \vrule - \kern.2\CWEBpt}} % verbatim string + \kern.2em}} % verbatim string \def\onmaybe {\let\ifon=\maybe} @@ -515,10 +490,10 @@ \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 \hskip 2em % depth 1 (@*1) + \or \hskip 4em % depth 2 (@*2) + \or \hskip 6em % depth 3 (@*3) + \or \hskip 8em % depth 4 (@*4) \or \hskip10em % depth 5 (@*5) \else \hskip12em \fi} % depth 6 or more @@ -551,55 +526,53 @@ \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\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\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\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\ET { and~} % conjunction between two section numbers +\defCWEBmacro\ETs {, and~} % conjunction between the last two of several section numbers -\defCWEBmacro\ETs % conjunction between the last two of several section numbers - {, and~} +\def\processCWEBsectionnumber#1% + {\bgroup + \def\[##1]{##1}% + \xdef\CWEBreference{#1}% + \egroup + \CWEBcomma{\goto{#1}[web:\CWEBreference]}} \unexpanded\def\processCWEBsectionnumbers[#1]% {\bgroup - \def\CWEBcomma% - {\def\CWEBcomma{, }}% - \def\docommand##1% - {\bgroup - \def\[####1]{####1}% - \xdef\CWEBreference{##1}% - \egroup - \CWEBcomma{\goto{##1}[web:\CWEBreference]}}% - \processlist{(}{)}{,}\docommand(#1) + \def\CWEBcomma{\def\CWEBcomma{, }}% + \processlist(),\processCWEBsectionnumber(#1)% \egroup} \unexpanded\def\processCWEBsectionnotes {\catcode`\s=12 \doprocessCWEBsectionnotes} +\def\doprocessCWEBsectionnote#1\ET#2#3.% + {\processCWEBsectionnumbers[#1]% + \if#2s% + {, and~\goto{##3}[web:#3]}% + \else + { and~\goto{##2##3}[web:#2#3]}% + \fi}% + \unexpanded\def\doprocessCWEBsectionnotes#1.% {\ifCWEBnotes - \def\next##1\ET##2##3.% - {\processCWEBsectionnumbers[##1]% - \if##2s% - {, and~\goto{##3}[web:##3]}% - \else - { and~\goto{##2##3}[web:##2##3]}% - \fi}% - \next#1.% + \doprocessCWEBsectionnote#1.% \else \goto{#1}[web:#1]% \fi \afterCWEBnote % inside group! \egroup} -\let\afterCWEBnote=\relax +\let\afterCWEBnote\relax \defCWEBmacro\note#1% {\bgroup @@ -613,7 +586,7 @@ {\ifmmode \gdef\XX{\null$\null}% \else - \gdef\XX{}% + \glet\XX\empty \fi % section name \XX$\langle\,${#2\tx\kern.5em#1}$\,\rangle$\XX} @@ -624,7 +597,7 @@ {\ifmmode \gdef\XX{\null$\null}% \else - \gdef\XX{}% + \glet\XX\empty \fi % section name \XX$\langle\,$% {#2\tx\kern.5em\processCWEBsectionnumbers[{#1}]}% @@ -633,10 +606,37 @@ \defCWEBmacro\X#1:#2\X% {\newCWEBmacroX#1:#2\X} -\definemarking[CWEBfilename] -\definemarking[CWEBsectiontitle] -\definemarking[CWEBsectionnumber] -\definemarking[CWEBsectiondepth] +%D The next code is a bit messy because there is skipping over content +%D and we have \type {\fi}'s in the source. + +\let\CWEBsecno\empty + +\definelist[cweb] + +\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\CWEBsecstar.\quad}[\CWEBsecno]% + \egroup} + +\defCWEBmacro\MN#1% + {\par % common code for \M, \N + \begingroup + \xdef\CWEBsecstar{#1}% + \let\*=\empty + \xdef\CWEBsecno{#1}% remove \* from section name + \endgroup + \ifx\CWEBsecno\CWEBsecstar + \onmaybe + \else + \ontrue + \fi} \defCWEBmacro\M#1% {\MN{#1}% @@ -648,15 +648,14 @@ \startsection \pagereference[web:#1]% \expanded{\marking[CWEBsectionnumber]{\secno}}% - \expanded{\marking[CWEBsectiondepth]{\the\gdepth}}% + \expanded{\marking[CWEBsectiondepth]{\the\CWEBgdepth}}% \ignorespaces} \defCWEBmacro\N#1#2#3.% - {\writestatus{cweb}{*\secno}% progress report - \gdepth=#1% + {\CWEBgdepth=#1% \MN{#2}% beginning of starred section \ifon - \ifnum#1<\secpagedepth + \ifnum#1<\CWEBsecpagedepth \page \else \vfil @@ -665,33 +664,16 @@ \theCWEBvskip \fi \fi -% \makesectionformat % context - \defconvertedargument\ascii{#3}% -% \edef\next% -% {\write\CWEBcont % write to contents file -% {\string\ZZ{\ascii}{#1}{\secno}% -% {\sectionformat::\noexpand\userfolio}{\noexpand\realfolio}}}% -% \next % \ZZ{title}{depth}{sec}{page} + \writedatatolist[cweb][section=\CWEBsecno,title={#3},depth=#1]% \ifon \startsection \pagereference[web:#2]% \marking[CWEBsectiontitle] {#3}% - \expanded{\marking[CWEBsectionnumber]{\secno}}% - \expanded{\marking[CWEBsectiondepth]{\the\gdepth}}% + \expanded{\marking[CWEBsectionnumber]{\CWEBsecno}}% + \expanded{\marking[CWEBsectiondepth]{\the\CWEBgdepth}}% {\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% @@ -713,22 +695,8 @@ \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} - \unexpanded\def\ignoreCWEBinput - {\let\normalinput=\input - \def\input ##1 % - {\let\input=\normalinput}} + {\def\input ##1 {\let\input\normalinput}} \unexpanded\def\loadCWEBmacros#1% {\let\oldN=\N @@ -739,25 +707,19 @@ \let\N=\oldN} \unexpanded\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 + {\catcode`\|=\othercatcode % used in context discretionaries + \everypar \emptytoks % used for context indentation and floats + \parskip \zeropoint % no stretch between cweb paragraphs + \parindent \emwidth} % is related to cweb backspace etc \unexpanded\def\processCWEBsource #1 % {\bgroup - \writestatus{cweb}{Source:} \resetCWEBcontext \activateCWEB \ignoreCWEBinput - \immediate\openout\CWEBcont=#1.toc - \write\CWEBcont{\noexpand\unprotect} + \let\end\relax \marking[CWEBfilename]{#1} \ReadFile{#1.tex}\relax - \write\CWEBcont{\noexpand\protect} - \closeout\CWEBcont \par \egroup} @@ -818,8 +780,10 @@ \unexpanded\def\theCWEBafterindex {\stopcolumns} \unexpanded\def\processCWEBindex #1 % - {\bgroup - \writestatus{cweb}{Index:} + {\par + \bgroup + \forgetall + \setupalign[verytolerant,flushleft,nothyphenated] \resetCWEBcontext \activateCWEB \resetCWEBindexentry @@ -828,23 +792,16 @@ \checkCWEBindexentry{##1}% \hangindent2em \noindent##1:\kern1em% - \def\next####1.% - {\processCWEBsectionnumbers[{####1}]}% + \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 \marking[CWEBfilename]{#1} \marking[CWEBsectiontitle]{index} \marking[CWEBsectionnumber]{} \marking[CWEBsectiondepth]{} - \loadCWEBmacros{#1} +% \loadCWEBmacros{#1} \theCWEBbeforeindex \ReadFile{#1.idx}\relax \theCWEBafterindex @@ -852,11 +809,12 @@ \egroup} \unexpanded\def\processCWEBsections #1 % - {\bgroup - \writestatus{cweb}{Section names:} + {\par + \bgroup + \forgetall \resetCWEBcontext \activateCWEB - \loadCWEBmacros{#1} + % \loadCWEBmacros{#1} \parfillskip = 0pt plus 1fil \parindent = 0pt \let\topsecno=\nullsec @@ -875,44 +833,45 @@ \marking[CWEBsectiontitle]{sections} \marking[CWEBsectionnumber]{} \marking[CWEBsectiondepth]{} - \loadCWEBmacros{#1} +% \loadCWEBmacros{#1} \ReadFile{#1.scn}\relax - \par \botofcontents \par \egroup} \unexpanded\def\processCWEBcontents #1 % - {\bgroup - \writestatus{cweb}{Table of contents:} + {\par + \bgroup + \forgetall \resetCWEBcontext \activateCWEB - \loadCWEBmacros{#1} - \rightskip = 0pt - \hyphenpenalty = 50 - \tolerance = 200 - \parindent = 0pt - \line{\hfil Section\hbox to3em{\hss Page}} - \let\ZZ=\contentsline \marking[CWEBfilename]{#1} \marking[CWEBsectiontitle]{table of contents} \marking[CWEBsectionnumber]{} \marking[CWEBsectiondepth]{} - \loadCWEBmacros{#1} - \ReadFile{#1.toc}\relax + \forgetall + \placelist[cweb][criterium=all,command=\CWEBlistentry] \par \egroup} -\unprotect - -\defCWEBmacro\contentsline#1#2#3#4#5% - {\ifnum#2=\zerocount - \blank[\v!small]% - \fi - \line{\consetup{#2}#1\rm\leaders\hbox to .5em{.\hfil}\hfil\ - {\goto{#3}[web:#3]}% below: \gotorealpage ? should be changed - \hbox to3em{\hss\gotorealpage{}{}{#5}{\translatednumber[#4]\presetgoto}}}} - -\protect +% {all} +% +% \structurelistuservariable +% \rawstructurelistuservariable +% +% \goto{#3}[web:#3] + +\installstructurelistprocessor{cweb} + {\begingroup + \advance\leftskip 3em + \advance\rightskip3em + \currentlistentrydestinationattribute + \dontleavehmode + \llap{\hbox \currentlistentryreferenceattribute{number} to 3em{\structurelistuservariable{section}\hss}}% + \structurelistuservariable{title}% + \hfill + \rlap{\hbox \currentlistentryreferenceattribute{page} to 3em{\hss\structurelistuservariable{depth}}}% + \par + \endgroup} \endinput diff --git a/tex/context/modules/mkiv/m-subsub.mkiv b/tex/context/modules/mkiv/m-subsub.mkiv index 88be11680..e0f6b1f27 100644 --- a/tex/context/modules/mkiv/m-subsub.mkiv +++ b/tex/context/modules/mkiv/m-subsub.mkiv @@ -12,65 +12,29 @@ \unprotect -\definesection[\s!section-8] -\definesection[\s!section-9] -\definesection[\s!section-10] -\definesection[\s!section-11] -\definesection[\s!section-12] +\writestatus\m!system{} +\writestatus\m!system{\the\maxstructuredepth\space levels sections are already predefined} +\writestatus\m!system{} -\definehead - [\v!subsubsubsubsubsection] - [\c!section=\s!section-8, - \c!default=\v!subsubsubsubsection] +\protect -\definehead - [\v!subsubsubsubsubsubsection] - [\c!section=\s!section-9, - \c!default=\v!subsubsubsubsubsection] +\continueifinputfile{m-subsub.mkiv} -\definehead - [\v!subsubsubsubsubsubsubsection] - [\c!section=\s!section-10, - \c!default=\v!subsubsubsubsubsubsection] +\starttext -\definehead - [\v!subsubsubsubsubsubsubsubsection] - [\c!section=\s!section-11, - \c!default=\v!subsubsubsubsubsubsubsection] + % \part {level 1 part} + \chapter {level 2 chapter} + \section {level 3 section} + \subsection {level 4 subsection} + \subsubsection {level 5 subsubsection} + \subsubsubsection {level 6 subsubsubsection} + \subsubsubsubsection {level 7 subsubsubsubsection} + \subsubsubsubsubsection {level 8 subsubsubsubsubsection} + \subsubsubsubsubsubsection {level 9 subsubsubsubsubsubsection} + \subsubsubsubsubsubsubsection {level 10 subsubsubsubsubsubsubsection} + \subsubsubsubsubsubsubsubsection {level 11 subsubsubsubsubsubsubsubsection} + \subsubsubsubsubsubsubsubsubsection {level 12 subsubsubsubsubsubsubsubsubsection} -\definehead - [\v!subsubsubsubsubsubsubsubsubsection] - [\c!section=\s!section-12, - \c!default=\v!subsubsubsubsubsubsubsubsection] + In case you wonder: level 1 part. -\definehead - [\v!subsubsubsubsubsubject] - [\c!coupling=\v!subsubsubsubsubsection, - \c!default=\v!subsubsubsubsubsection, - \c!incrementnumber=\v!no] - -\definehead - [\v!subsubsubsubsubsubsubject] - [\c!coupling=\v!subsubsubsubsubsubsection, - \c!default=\v!subsubsubsubsubsubsection, - \c!incrementnumber=\v!no] - -\definehead - [\v!subsubsubsubsubsubsubsubject] - [\c!coupling=\v!subsubsubsubsubsubsubsection, - \c!default=\v!subsubsubsubsubsubsubsection, - \c!incrementnumber=\v!no] - -\definehead - [\v!subsubsubsubsubsubsubsubsubject] - [\c!coupling=\v!subsubsubsubsubsubsubsubsection, - \c!default=\v!subsubsubsubsubsubsubsubsection, - \c!incrementnumber=\v!no] - -\definehead - [\v!subsubsubsubsubsubsubsubsubsubject] - [\c!coupling=\v!subsubsubsubsubsubsubsubsubsection, - \c!default=\v!subsubsubsubsubsubsubsubsubsection, - \c!incrementnumber=\v!no] - -\protect \endinput +\stoptext diff --git a/tex/context/modules/mkiv/s-evohome.mkiv b/tex/context/modules/mkiv/s-evohome.mkiv index 1b1dc2c81..26abcfb59 100644 --- a/tex/context/modules/mkiv/s-evohome.mkiv +++ b/tex/context/modules/mkiv/s-evohome.mkiv @@ -278,7 +278,16 @@ end presets = "c:/data/develop/domotica/evohome/evohome-presets.lua", } - moduledata.evohome.status (specification) + -- moduledata.evohome.status (specification) + moduledata.evohome.history(specification) + + local specification = { + year = 2018, + -- month = 11, + presets = "c:/data/develop/domotica/evohome/evohome-presets.lua", + } + + -- moduledata.evohome.status (specification) moduledata.evohome.history(specification) \stopluacode |