       Re: Primed Variables in Mathematica

• To: mathgroup at smc.vnet.net
• Subject: [mg50707] Re: [mg50652] Primed Variables in Mathematica
• From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
• Date: Fri, 17 Sep 2004 01:17:24 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```>-----Original Message-----
>From: David Park [mailto:djmp at earthlink.net]
To: mathgroup at smc.vnet.net
>Sent: Wednesday, September 15, 2004 7:50 AM
>To: mathgroup at smc.vnet.net
>Subject: [mg50707] [mg50652] Primed Variables in Mathematica
>
>
>Primed variables are in such common use in textbooks and
>papers that I don't understand why Mathematica doesn't allow them.
>
>Of course, x' represents a derivative, but there is a prime
>character that can be obtained by esc ' esc or by \[Prime].
>
>Symbol
>
>But the problem is that the \[Prime] character is not raised
>but sits at the same level as x. It would be much better if
>the \[Prime] character were raised to the normal level to give
>better looking expressions. I admit that there could be some
>visual confusion, but not Mathematica confusion, with
>derivatives, but it would usually be clear from context.
>
>I wish that WRI would fix the Prime, DoublePrime, ReversePrime
>and ReverseDoublePrime characters so they displayed at the
>correct vertical level in expressions.
>
>David Park
>
>
>

Dear David,

this seems to be one of the cases where parsing and semantic action on input (expression formation) come across.

If you use from the basic input palette...

Cell[BoxData[
SuperscriptBox["\[Placeholder]",
"\[Placeholder]"]], "Input"]

...and insert a and Prime into the placeholders you get

In:= \!\(a\^\[Prime]\)
Out=
\!\(\*
SuperscriptBox["a", "\[Prime]",
MultilineFunction->None]\)

In:= % // FullForm
Out//FullForm= Derivative[a]

But using b for Prime for the same placeholder gives

In:= \!\(a\^b\)
Out= \!\(a\^b\)

In:= % // FullForm
Out//FullForm= Power[a, b]

But for linear input the "substitution" is not being made

In:= Power[a, \[Prime]]
Out= \!\(a\^\[Prime]\)

In:= % // FullForm
Out//FullForm= Power[a, \[Prime]]

Perhaps you might use Superscript for your application

In:= Superscript[a, b]
Out=
\!\(\*
InterpretationBox[\(a\^b\),
Superscript[ a, b],
Editable->False]\)
In:= % // FullForm
Out//FullForm= Superscript[a, b]

In:= Superscript[a, \[Prime]]
Out=
\!\(\*
InterpretationBox[\(a\^\[Prime]\),
Superscript[ a, \[Prime]],
Editable->False]\)

In:= % // FullForm
Out//FullForm= Superscript[a, \[Prime]]

Where the behavior is uniform
(Perhaps create a palette for that. This may have to be symbolized, though, for your application in mind.)

But I fully agree with your quest.

--
Hartmut

```

• Prev by Date: Re: Primed Variables in Mathematica
• Next by Date: Re: Re: Package and options, subroutines Mathematica programming 3GL function procedure
• Previous by thread: Re: Primed Variables in Mathematica
• Next by thread: anyone else have same problems? partition grahics