From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/3957 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Calculator Programs for Texas Instruments TI-83 Date: Fri, 02 Feb 2001 11:15:31 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20010202111531.01b38ea0@server-1> References: <4.3.2.7.0.20010201163349.00baef08@mail.northcoast.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035394658 21598 80.91.224.250 (23 Oct 2002 17:37:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:37:38 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: David Arnold In-Reply-To: <4.3.2.7.0.20010201163349.00baef08@mail.northcoast.com> Xref: main.gmane.org gmane.comp.tex.context:3957 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:3957 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 -------------------------------------------------------------------------