Search code examples
wolfram-mathematicamathematica-8

Style dynamic value


Can I apply Style to the output of "Labeled" in the below ?

Manipulate[\[Lambda],
Control@{{\[Lambda], 401,
Style["     \[Lambda]", Black, Bold, 24]},
Range[401, 570, 1],
ControlType -> Slider,
ControlPlacement -> Bottom,
Appearance -> "Labeled",
ImageSize -> 200}]

That is on the right part of the Slider :

enter image description here


Solution

  • You want the option BaseStyle (which appears in Options[Slider]). E.g.

    Manipulate[
     Plot[Cos[k x], {x, 0, 2 Pi}, PlotLabel -> "Cosine"], 
     {{k, 1, Style["x", Black, Bold, 24]}, 0, 4, 
      ControlType -> Slider, Appearance -> "Labeled", 
      ControlPlacement -> Bottom, ImageSize -> 200, 
      BaseStyle -> {Red, Large, Italic, FontFamily -> "Times"}}]
    

    cosine

    When looking at this I noticed that you can also use the almost undocumented ControlType -> LabeledSlider, just for something different.