ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Inside ConTeXt
@ 2009-05-07 17:55 Wolfgang Schuster
  2009-05-07 18:01 ` Wolfgang Schuster
  2009-05-08  9:33 ` Bostjan Vesnicer
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2009-05-07 17:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Inside ConTeXt
  2009-05-07 17:55 Inside ConTeXt Wolfgang Schuster
@ 2009-05-07 18:01 ` Wolfgang Schuster
  2009-05-08  9:33 ` Bostjan Vesnicer
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2009-05-07 18:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Inside ConTeXt
  2009-05-07 17:55 Inside ConTeXt Wolfgang Schuster
  2009-05-07 18:01 ` Wolfgang Schuster
@ 2009-05-08  9:33 ` Bostjan Vesnicer
  2009-05-08 13:51   ` Wolfgang Schuster
  1 sibling, 1 reply; 4+ messages in thread
From: Bostjan Vesnicer @ 2009-05-08  9:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 673 bytes --]

Hi Wolfgang,

I appreciate your solution, but it would be much more useful if the 
solution would be accompanied with a step-by-step explanation of what is 
going on behind the scenes.

A collection of such elegant solutions (together with explanations) 
would be an invaluable source of knowledge for those of us who want to 
learn the TeX programming.

Bostjan

Wolfgang Schuster wrote:
> 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 
>
>
> Wolfgang

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 4617 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Inside ConTeXt
  2009-05-08  9:33 ` Bostjan Vesnicer
@ 2009-05-08 13:51   ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2009-05-08 13:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 08.05.2009 um 11:33 schrieb Bostjan Vesnicer:

> Hi Wolfgang,
>
> I appreciate your solution, but it would be much more useful if the  
> solution would be accompanied with a step-by-step explanation of  
> what is going on behind the scenes.

It's magic and mages don't explain their tricks :)

> A collection of such elegant solutions (together with explanations)  
> would be an invaluable source of knowledge for those of us who want  
> to learn the TeX programming.

Can you please first take a look in a TeX manual (TeXbook, TeX by  
Topic or TeX for the impatient) and ask then what you don't  
understand, for my example look at the explanation of \afterassignment.

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-08 13:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-07 17:55 Inside ConTeXt Wolfgang Schuster
2009-05-07 18:01 ` Wolfgang Schuster
2009-05-08  9:33 ` Bostjan Vesnicer
2009-05-08 13:51   ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).