ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* passing arguments to commands while typing
@ 2004-07-08 17:18 Johan Sandblom
  2004-07-14 14:04 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Sandblom @ 2004-07-08 17:18 UTC (permalink / raw)


While documenting some Matlab code for barely computer literates I wish to use the positional graphics described in the MetaFun manual. Not sure if this is possible of course. I am not at all successful so far since I cannot get the escaping mechanism to accept my code. It appears that the /hpos works just fine but the {} generate problems. I have tried using <<>> in all ways I could think of but haven't been lucky yet. Is this possible?

Minimal example:

\setuppapersize[S6][S6]
\setuptyping[option=commands]
\starttext
\starttyping
test /hpos{word}{test} test
\stoptyping
\stoptext

-- 
Johan Sandblom  N8,MRC          "Good judgment comes              
                Karolinska sjh   from experience.
t +46851776108  17176 Stockholm  Experience comes
m +46735521477  Sweden           from bad judgment."

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

* Re: passing arguments to commands while typing
  2004-07-08 17:18 passing arguments to commands while typing Johan Sandblom
@ 2004-07-14 14:04 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2004-07-14 14:04 UTC (permalink / raw)


Johan Sandblom wrote:

>While documenting some Matlab code for barely computer literates I wish to use the positional graphics described in the MetaFun manual. Not sure if this is possible of course. I am not at all successful so far since I cannot get the escaping mechanism to accept my code. It appears that the /hpos works just fine but the {} generate problems. I have tried using <<>> in all ways I could think of but haven't been lucky yet. Is this possible?
>
>Minimal example:
>
>\setuppapersize[S6][S6]
>\setuptyping[option=commands]
>\starttext
>\starttyping
>test /hpos{word}{test} test
>\stoptyping
>\stoptext
>
>  
>

\setuppapersize[S6][S6]
\setuptyping[option=commands]

\starttext

\def\naturaltextext#1\relax
  {\bgroup
   \prettynaturalfont
   \def\ascii{#1}%
   \setnormalcatcodes
   \restorecatcodes
   \scantokens\expandafter{\ascii}\ifhmode\unskip\fi
   \egroup}

\let\texy\naturaltextext

\starttyping
test /naturaltextext\hpos{word}{test}/relax test
test /texy \rm is the word/relax test
\stoptyping

\MPxy{word}

\stoptext

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

end of thread, other threads:[~2004-07-14 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-08 17:18 passing arguments to commands while typing Johan Sandblom
2004-07-14 14:04 ` Hans Hagen

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).