subscript subtleties II
- To: mathgroup@smc.vnet.net
- Subject: [mg12194] subscript subtleties II
- From: "Richard W. klopp" <klopprh@pacbell.net>
- Date: Fri, 1 May 1998 03:08:44 -0400
- Organization: SRI International
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.