Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

I'm trying to display the text $y+\tau\theta$ using the following graphics directive inside a Show[] with several other graphics objects:

Graphics3D[{FontSize -> 28, Text[y + \[Tau]\[Theta], {1, 0.1, .5}]}]

However, the displayed text is shown as $\tau\theta+y$ instead of $y+\tau\theta$. This isn't a huge deal, but I'm trying to keep my notation consistent. If I enclose the text in quotes, it displays it in the correct order but in "text" font instead of "math" font. Any suggestions? I'm using version 8, if it makes a difference.

share|improve this question

marked as duplicate by Jens, Sjoerd C. de Vries, Ajasja, m_goldberg, Yves Klett Feb 11 '13 at 10:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers 2

up vote 10 down vote accepted

Generally, Mathematica likes to keep things in a canonical form by commuting any commutable operators to put things in lexicographic order. This greatly improves the speed with which it can determine whether two expressions are equivalent, but it can be annoying when you want things to appear exactly in the order you originally wrote them.

In this case, you can easily prevent this by using a Hold. Since we're most interested in keeping the display the same, we use HoldForm like so:

Graphics3D[{FontSize->28,Text[HoldForm[y+\[Tau]\[Theta]],{1,0.1,.5}]}]
share|improve this answer
    
Excellent, works great. Thanks! –  icurays1 Feb 10 '13 at 19:26
add comment

Use ToString:-

Graphics3D[{FontSize -> 28, 
  Text[ToString[y + \[Tau]\[Theta]], {1, 0.1, .5}]}]
share|improve this answer
    
Or use HoldForm –  Szabolcs Feb 10 '13 at 19:24
    
ToString[] seems to do the same thing as putting it in quotes - It makes the $y$ text font instead of math font. –  icurays1 Feb 10 '13 at 19:25
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.