MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Manipulating "non-meaningful" expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39609] Re: Manipulating "non-meaningful" expressions
  • From: Paul Abbott <paul at physics.uwa.edu.au>
  • Date: Wed, 26 Feb 2003 02:41:31 -0500 (EST)
  • Organization: The University of Western Australia
  • References: <b34qfg$gja$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <b34qfg$gja$1 at smc.vnet.net>,
 matija at scientist.com (Matija Pretnar) wrote:

> I am writing a program in Mathematica that would allow TeX-macro-like
> typesetting functions in front-end.
> I would for example enter
> defineMacro[list[item_], {item/.i->1, item/.i->2, ..., item/.i->n]
> and that would allow me to evaluate list[x_i,i] in place and to
> recieve
> {x_1, x_2, ..., x_n}, which would speed up typing a lot.
> 
> This case works, because Mathematica understands {...} as a list. On
> the other hand, I would like to define vec[x] to be (x_1, x_2, ...,
> x_n). But I can not convince Mathematica to process this kind of
> expression, although I would only like to manipulate boxes and not to
> evaluate their contents.
> 
> I can not simply do a string replace, because I would not enter my
> input pattern (item in list[item_]) as a string but as a collection of
> boxes.
> 
> Any ideas?

AddInputAlias in the Utilities`Notation` package will do what you want 
to do. Evaluate

  FrontEndExecute[FrontEnd`HelpBrowserLookup["AddOns", "Notation"]]

for more information.

Cheers,
Paul

-- 
Paul Abbott                                   Phone: +61 8 9380 2734
School of Physics, M013                         Fax: +61 8 9380 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au 
AUSTRALIA                            http://physics.uwa.edu.au/~paul



  • Prev by Date: Why Plot cannot run under package?
  • Next by Date: Re: How to use vector analysis without using suffix notation
  • Previous by thread: Manipulating "non-meaningful" expressions
  • Next by thread: TimeConstrained & Power cause segmentation fault