MathGroup Archive 2004

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

Search the Archive

Re: Primed Variables in Mathematica

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

>-----Original Message-----
>From: David Park [mailto:djmp at]
To: mathgroup at
>Sent: Wednesday, September 15, 2004 7:50 AM
>To: mathgroup at
>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]. 
>x\[Prime] // Head
>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
>djmp at

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...

      "\[Placeholder]"]], "Input"]

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

In[10]:= \!\(a\^\[Prime]\)
  SuperscriptBox["a", "\[Prime]",

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

But using b for Prime for the same placeholder gives

In[12]:= \!\(a\^b\)
Out[12]= \!\(a\^b\)

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

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

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

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

Perhaps you might use Superscript for your application

In[4]:= Superscript[a, b]
    Superscript[ a, b],
In[5]:= % // FullForm
Out[5]//FullForm= Superscript[a, b]

In[6]:= Superscript[a, \[Prime]]
    Superscript[ a, \[Prime]],

In[7]:= % // FullForm
Out[7]//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.


  • 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