On Fri, Sep 21, 2001 at 11:04:57AM +0200, Hans Hagen wrote:
> At 09:45 PM 9/20/2001 +0200, Johannes Huesing wrote:
> 
> \starttext
> 
[deletia]
> 
> \stoptext
> 

This works, as long as I don't try to refer to these heads. An example
which leads to an error is included.

Moreover, I am still uncertain why my minimal example doesn't work. 
If I replace the head with an enumeration I get an error too.

Greetings


Johannes
-- 
Johannes H�sing  | Terrorism treats the ending of a 
[EMAIL PROTECTED] | state as damage, and routes around it 
%%% Counter that resets with every page
\newcounter\MyHeadCounter
\newcounter\MyPageCounter

\definieernummer[TestNumber]
\definehead[TestHead][section]
\setuphead[TestHead][ownnumber=yes]

\def\MyTestHead%
   {\dosingleempty\doMyTestHead}

\def\doMyTestHead[#1]%
   {\doglobal\increment\MyHeadCounter
    \doifreferencefoundelse{pnm:\MyHeadCounter}
      {\ifnum\currentrealreference>\MyPageCounter\relax
         \global\let\MyPageCounter\currentrealreference
         \resetnummer[TestNumber]%
       \fi}
      {}
    \verhoognummer[TestNumber]%
    \expanded{\TestHead[pnm:\MyHeadCounter,#1]{\ruwenummer[TestNumber]}}}
%%%


\starttext
\MyTestHead[ch:tufte]{Tufte}
\input tufte

\page
\MyTestHead[ch:knuth]{Knuth}
\input knuth

\MyTestHead[ch:zapf]{Zapf}
\input zapf
see also \in[ch:knuth] on page \at[ch:knuth].


\stoptext
\setupoutput[pdftex]
\def\NWmargintag#1{\inmargin{\tfx #1}}
\def\NWprevnextdefs#1#2{\ifx\relax#1\else%
  \goto{$\triangleleft$}[#1]~\fi\ifx\relax#2\else%
  \goto{$\triangleright$}[#2]\fi}
\def\NWalsodefined#1{also defined in \at[#1]\crlf}

\definehead[NWcodechunkhead][section]
% Comment out the previous line and uncomment the next line to cause error
%\defineenumeration[NWcodechunkhead]%
%                   [conversion=character]
%\appendtoks \resetNWcodechunkhead \to \aftereverypage

\defineframedtext[NWcodechunk][frame=off, 
                               leftframe=on,
                               background=screen, 
                               width=\textwidth]

\def\NWtagstyle{\it}

\defineframedtext[NWdeflinemarkup][frame=on, 
                                   background=none]


\setuptype[space=on]
\setupinteraction[state=start]

\starttext
\startNWcodechunk
\NWcodechunkhead[NWlont-*-1]{*~{\NWtagstyle{}\at[NWlont-*-1].\in[NWlont-*-1]}}
\NWmargintag{{\NWtagstyle{}\at[NWlont-*-1].\in[NWlont-*-1]}}\crlf
\startNWdeflinemarkup\NWprevnextdefs{\relax}{NWlont-*-2}\stopNWdeflinemarkup
function calculating the probability of a subsequence of length k out of n~{\NWtagstyle{}\at[NWlont-fun1C-1].\in[NWlont-fun1C-1]}\type{}\crlf
\stopNWcodechunk{}
\stoptext


Reply via email to