Taco,

Just tried this and it is really cool!
But how can I make spaces without the special space character?

Thanks

On 7/29/05, Taco Hoekwater <taco@elvenkind.com> wrote:

Hi,

I saw this on the wiki:

   http://contextgarden.net/Verbatim_with_line_breaks

and it seemed like a fun idea to play with for a bit.
How's this?

Cheers, Taco


%
% BREAK is a special pretty handler that auto-wraps lines
% to fit the current hsize.

\gdef\BREAKsetspecials%
   {\dorecurse{256}{\setpretty\numexpr \recurselevel-1\relax=10 }}

\gdef\BREAKsethandlers%
   {\installprettyhandler 10 \BREAKtypeone  }

\newcount\BREAKcharcounter
\newcount\BREAKmaxcharcount

\def\BREAKtypeone#1%
   {\advance\BREAKcharcounter 1
    \ifnum\BREAKcharcounter > \BREAKmaxcharcount
       \hfil\break
       \BREAKcharcounter=1
    \fi
    \getpretty{#1}}

\def\BREAKsetcounters%
   {\setbox\scratchbox=\hbox{0}%
    \BREAKmaxcharcount=\hsize
    \divide\BREAKmaxcharcount \wd\scratchbox
    \def\flushrestofverbatimline{\BREAKcharcounter=0 }%
    \BREAKcharcounter=0 }

\gdef\setupprettyBREAKtype%
   {\def\prettyidentifier{BREAK}%
    \BREAKsetcounters
    \BREAKsethandlers
    \BREAKsetspecials}

\installprettytype [BREAK] [BREAK]

\starttext
\framed
    [width=8cm,
     align=flushleft]{%
\setuptyping[option=BREAK]
\starttyping
hööah:aloh/aa?lha llol!loh%lloh#allhal\lohhll;ohohal~loll ohalölo
\stoptyping
}
\stoptext

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context



--
Regards.
Eugene Toporov