# How to mix symbols and text for labels in manipulate? [closed]

I'm creating a big manipulate box with several sliders, and each slider must have a small explication text (units, for example) after a mathematical symbol. As a simple example, here's the code I'm currently using for a slider :

{{phi, 0, Style[Subscript[\[CurlyPhi], 0] "(degrees)", Bold, 10]},
0, 360, 0.1,
ImageSize -> Large,
Appearance -> {"Labeled", "Closed"}
}


Currently, this isn't displayed correctly since it gives (degrees)phi_0, instead of phi_0 (degrees).

So what should I do to define a properly displayed symbol with text after it ?

• You have multiplied the subscript and the string, instead use Row to format expressions in a row, e.g. Row[{Subscript[φ, 0], "(degrees)"}] Feb 13 '16 at 21:21
• Remember to make all parts a String and to join them by <>.
– gwr
Feb 13 '16 at 21:21
• Now, which one is best ? String or Row ?
– Cham
Feb 13 '16 at 21:51
• Using Row, how do you change the font size ?
– Cham
Feb 13 '16 at 22:00
• Style[ToString[Subscript[\[CurlyPhi], 0], TraditionalForm] <> " (degrees)", Bold, 10] Feb 13 '16 at 22:51

I'd use BaseStyle with Row and use Style only on pieces which needed their own special style. I would also protect the φ with HoldForm. In general I wrap expressions that contain symbols and are used for labels with HoldForm. It's mainly a habit, because if the symbols happen to have, or later happen to get assigned, values, then the values will mess up the labels.

Manipulate[
phi,
{{phi, 0,
Row[{HoldForm@Subscript[φ, 0], "(degrees)"}, " ", BaseStyle -> {Bold, 10}]},
0, 360, 0.1, ImageSize -> Large,
Appearance -> {"Labeled", "Closed"}}]


• I'll mark this answer just because it is showing more options. These could be usefull.
– Cham
Feb 14 '16 at 15:02
• @Cham Thanks. Yes there's not much difference between them. One's preference is, I suppose, a matter of, um, style. ;-) Feb 14 '16 at 15:10

I would use Style with Row like this

Manipulate[
phi,
{{phi, 0, Style[Row[{Subscript[φ, 0] , " (degrees)"}], Bold, 10]}, 0, 360, 1,
ImageSize -> Large, Appearance -> {"Labeled"}}]


• Both answers are good and merit to be assigned "THE" answer. Which one should I mark ?
– Cham
Feb 14 '16 at 13:50