MathGroup Archive 1998

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

Search the Archive

subscript subtleties II



I found the answer to my own question at

http://www.wri.com/support/FrontEnds/Typesetting/SubscriptsAsSymbols.html

Quoting from that URL, and contrary to what I interpret p. 176 of the
BOOK to say, 

"Subscripted expressions (like x"sub"n [typeset as such]) are not
symbols. They are expressions with the head of Subscript. For example,
x"sub"n is treated as Subscript[x,n] which is a normal expression (an
expression with a head and elements) rather than a symbol. 

One way to cause x"sub"n to be treated as a symbol is to use the
Symbolize function from the Utilities`Notation` package. 

      Needs["Utilities`Notation`"]

You can now use the Symbolize command to make the subscripted variable
Symbolize[x"sub"n]

In this example, Symbolize does two things: 

   1.Anytime x"sub"n is sent from the front end to the kernel, the
kernel recognizes this as the symbol x_Subscript_n. 

   2.Anytime the front end receives the symbol x_Subscript_n from the
kernel, it is displayed as x"sub"n. 

You don't have to worry exactly what symbol is being used; Symbolize
picks this for you automatically. If you want to control exactly which
symbol is used, you can use the Notation command (accessible from the
palette created when loading the package)."

At first blush this seems inconvenient, but I can see how it also allows
one to define other uses for subscripts, such as indexing lists.



  • Prev by Date: COMBINING LISTS
  • Next by Date: RE: Approximate
  • Prev by thread: Re: COMBINING LISTS
  • Next by thread: RE: Approximate