MathGroup Archive 2004

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

Search the Archive

Re: Primed Variables in Mathematica

Dear Hartmut,

The point is: if I type


the quote character is positioned at the correct level. Of course, it has
its own syntactic meaning so we can't use it to represent primed variables.

If I type


I get a two character symbol but the \[Prime] sits on the floor, so to
speak, instead of being positioned at the correct level and thus defeating
easy access to nice looking primed variables.

What possible reason is there for this? The only reason I can think of is
that someone thought that these characters were to be inserted into a
SuperscriptBox and they didn't want them raised again. But is that ever
done? Are there many users, or any, that make primed variables that way?

I thought that Superscript was deprecated. So wouldn't it be much easier to

x esc ' esc    than

DisplayForm[SuperscriptBox[x, esc ' esc]]

especially considering that the first form is actually a Symbol and the
second form isn't.

I definitely think that a wrong choice was made here and it could be easily
corrected. If quote can be formatted correctly, so can \[Prime] and

I bet there are a lot of users who would like to have easy primed and double
primed variables as symbols.

David Park
djmp at

From: Wolf, Hartmut [mailto:Hartmut.Wolf at]
To: mathgroup at

>From: David Park [mailto:djmp at]
To: mathgroup at

>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: anyone else have same problems? partition grahics
  • Next by Date: Re: Primed Variables in Mathematica
  • Previous by thread: Re: Primed Variables in Mathematica
  • Next by thread: Re: Primed Variables in Mathematica