![](https://secure.gravatar.com/avatar/d0dc1eaaae0f0b110cf8696b2ccad136.jpg?s=120&d=mm&r=g)
Hi, I try to define new command with typing in this way: \def\Command#1% { \framed[options] { \starttyping #1 \stoptyping } } and use it in this way: \Command{\getbuffer[name]} but I have an error: ! Argument of \copyverbatimline has an extra }. If I change to \def\Command#1#2% I have: ! Paragraph ended before \Command was complete. How I can do it - put ConTeXt code to own frame ?... -- Best regards Martin
![](https://secure.gravatar.com/avatar/6af1f724a401c9f6f746a973f33ff595.jpg?s=120&d=mm&r=g)
"^Nitram^"
I try to define new command with typing in this way: \def\Command#1% { \framed[options] { \starttyping #1 \stoptyping } }
Don't mess with verbatim stuff in commands. Don't ask why, just don't do it ;-) And: TeX != C. Don't write C-like TeX-braces: { \this { \that { This will give you a hard time looking for unwanted spaces. Use % or better: write \def\Command#1% {\framed[...]%
How I can do it - put ConTeXt code to own frame ?...
\definetyping [nitram] [before=\startframedtext, after=\stopframedtext] \starttext \startnitram crazy \stopnitram \stoptext Patrick -- Silent is the goldfish in its bowl
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
At 16:33 23/09/2003 +0200, you wrote:
Don't mess with verbatim stuff in commands. Don't ask why, just don't do it ;-)
use buffers instead has to do with tex collapsing spaces into one, lineendings being spaces, active characters etc
And: TeX != C. Don't write C-like TeX-braces:
{ \this { \that {
This will give you a hard time looking for unwanted spaces.
\unprotect \def\beginmacro{\catcode`\^^M=\@@ignore} \def\endmacro {\catcode`\^^M=\@@endofline} \protect \beginmacro \def\patrickneedsatexchallengeeachday#1 {Does he? (#1) Why's That?} \endmacro ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
![](https://secure.gravatar.com/avatar/6af1f724a401c9f6f746a973f33ff595.jpg?s=120&d=mm&r=g)
Hans Hagen
\unprotect
\def\beginmacro{\catcode`\^^M=\@@ignore} \def\endmacro {\catcode`\^^M=\@@endofline}
\protect
\beginmacro
\def\patrickneedsatexchallengeeachday#1 {Does he? (#1) Why's That?}
\endmacro
without trying it, I guess it will write "Does he?(...)Why's That" hmm, I'll try....... Yes :) OK, ready for the next challenge :) Patrick (Perhaps I *do* have built TeX into my brain one day)
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
At 16:00 23/09/2003 +0200, you wrote:
Hi,
I try to define new command with typing in this way: \def\Command#1% { \framed[options] { \starttyping #1 \stoptyping } } and use it in this way: \Command{\getbuffer[name]} but I have an error: ! Argument of \copyverbatimline has an extra }.
If I change to \def\Command#1#2% I have: ! Paragraph ended before \Command was complete.
How I can do it - put ConTeXt code to own frame ?...
definetyping [MyCode] [before=\startMyFrame, after=\stopMyFrame] \defineframedtext [MyFrame] [width=fit] \startMyCode \Command{\getbuffer[name]} \stopMyCode (btw, this kind of framed texts knwo quite well how to get rid of white space) Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
participants (3)
-
^Nitram^
-
Hans Hagen
-
Patrick Gundlach