On 8/7/06, Hans Hagen wrote:
(I'll spare you the fun with sections for some other time,) but since you reminded me that I might have some questions left, here you have another one: how do I replace hyphens, en-dashes and em-dashes with "spaces/line breaks"? \catcode`~=13\let~=\space does what I want, but none of the following works: \def\-{\space} \def-{\space} \let\-=\space
\catcode`-=\active \def-{ }
I tried that one already, but it didn't work. Now I figured out that it was because of nesting the definitions (perhaps even some interference with negative numbers?), not because of wrong definition on itself. I'm sorry. Mojca (But my fear is that the whole problem is too complex anyway (tables, ...) to be solved elegantly.) \long\def\startstatistics#1\stopstatistics {\setbox0\vbox\bgroup % \tracingall -) \forgetall \nohyphens \hsize1mm % treat non-breakable space as a normal one \catcode`~=13\let~=\space % treat en-dash as a normal one \catcode`-=\active \def-{ } % ERROR \bgroup#1\egroup\egroup \newcounter\NOfLines \beginshapebox \unvcopy0 \endshapebox \reshapebox{\doglobal\increment\NOfLines} #1\crlf\unvbox0\crlf words: \NOfLines\crlf} \starttext \startstatistics abc~def ghi-jkl -- mno --- prs \stopstatistics % works OK %abc-def -- ghi --- jkl % \catcode`-=\active \def-{ } %abc-def -- ghi --- jkl \stoptext