How to apply tags to expression terms?

• To: mathgroup at smc.vnet.net
• Subject: [mg130493] How to apply tags to expression terms?
• From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
• Date: Tue, 16 Apr 2013 00:35:32 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net

```Dear Community members,

I often see on this site an at the StackExchange the repeating questions of how to rearrange some expression, that Mathematica "likes" to keep in one form, but the user prefers another one. It is like in this trivial example:

(x^2 - 1)/(x + 1) // Simplify

that Mathematica returns -1+x, rather than x-1 that might be wished by the user.

I have seen many answers to this questions, and gave few mine. The problem here is that the answers are non-universal: they strongly depend upon the expression in question. Besides, they require some additional programming, and the more complex is the formula to sort, the longer will be the part of the sorting code.

It seems that the problem of sorting terms of analytic expressions in the desired order might be solved, if one could assign tags to the terms to be sorted, and then sort the terms according to a specified list of such tags.

Now comes my question, do you know how to apply tags to expression terms?

I have seen an analogous functionality in the Presentation Master, the package of  David Park. There, however, the tags are used to be assigned to sub expressions, the held part of the expression in question. David, is it possible to assign tags to expressions that are not held?

Thank you in advance.
Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch at iee.lu

```

• Prev by Date: Turning a Sequence into a List?
• Next by Date: Re: Trying to suspend or pause execution of a program.(updated)
• Previous by thread: Re: Turning a Sequence into a List?
• Next by thread: Re: How to apply tags to expression terms?