ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Calculator Programs for Texas Instruments TI-83
       [not found] <4.3.2.7.0.20010201163349.00baef08@mail.northcoast.com>
@ 2001-02-02 10:15 ` Hans Hagen
  0 siblings, 0 replies; only message in thread
From: Hans Hagen @ 2001-02-02 10:15 UTC (permalink / raw)
  Cc: ntg-context

At 05:19 PM 2/1/01 -0800, David Arnold wrote:
>Hans,
>
>I'd like to typeset some calculator programs I've written for my Integral 
>Calculus class. I have five of them (one below), that I'd like to typeset 
>on a single page. Any good ideas? I'd like some sort of computer font look, 
>but the symbols I have to use worry me.
>
>ClrHome
>Prompt A
>Prompt B
>Prompt N
>If int(N/2) <> N/2  %I don't have a not equals (\ne) symbol on my keyboard
>Then
>Disp "N MUST BE EVEN"
>Stop
>End
>(B-A)/N->H
>A->X
>0->S
>For(K,1,N/2,1)
>S+Y1(X)+4*Y1(X+H)+Y1(X+2*H)->S   %These ones are supposed to be subscripts
>X+2*H->X
>End
>S*H/3->S
>Disp "METHOD: SIMPSON"
>Disp "SUM:"
>Disp S

Well, i'm not saying that the next solution is the best or most beautiful,
but it works: 

\definetyping[XXX]
\setuptyping[option=commands,escape=@]

\def\XXXne         {\hsmash{/}=\gobbleoneargument}
\def\XXXsup#1endsup{\high{\ttx\gobbleoneargument#1}}
\def\XXXsub#1endsub{\low{\ttx\gobbleoneargument#1}}

\startXXX
If int(N/2)@XXXne N/2  %I don't have a not equals (\ne) symbol on my keyboard
S+Y1(X)+4*Y1@XXXsub (X+H)endsub+Y1@XXXsup (X+2*H)endsup->S   %These ones are
\stopXXX

Watch the space after the @command and also watch the \gobble to get rid of
that space. 

Now, is this ugly or not? 

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-02-02 10:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4.3.2.7.0.20010201163349.00baef08@mail.northcoast.com>
2001-02-02 10:15 ` Calculator Programs for Texas Instruments TI-83 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).