Am 07.05.2009 um 19:55 schrieb Wolfgang Schuster:

After reading the following code [1] from the wiki again I will present here my solution:

\def\TextWithSpaces{\framed\bgroup\afterassignment\obeyspaces\let \next}

[1] 
http://wiki.contextgarden.net/Inside_ConTeXt#Passing_verbatim_text_as_macro_parameter

With a small modification optional arguments are possible.

\def\TextWithSpaces#1#{\framed#1\bgroup\afterassignment\obeyspaces \let\next}

This allows:

  \TextWithSpaces{A gap from here to there!}

and

  \TextWithSpaces[foregroundstyle=bold]{A gap from here to there!}

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to