# How to make a control label display traditional form notation

How do you make a control label display notation in tradition form? I would like the label to display the function "f(x)= (1/2)x+1" but in traditional form. How could I modify this code so it works? I realize I am using a string, so I would need to change that but don't know what to do.

Manipulate[Plot[If[f, .5 x + 1], {x, -3, 6},
PlotRange -> {{-1, 6}, {-1, 5}},
Ticks -> {Range[-3, 6], Range[-1, 5]},
GridLines -> Automatic, GridLinesStyle -> Opacity[.03],
AxesStyle -> Arrowheads[.03]],

{{f, False, "f(x)=(1/2)x+1"}, {True, False}}]


## 2 Answers

Manipulate[
Plot[If[f, .5 x + 1], {x, -3, 6},
PlotRange -> {{-1, 6}, {-1, 5}},
Ticks -> {Range[-3, 6], Range[-1, 5]},
GridLines -> Automatic,
GridLinesStyle -> Opacity[.03],
AxesStyle -> Arrowheads[.03]],
{{f, False, TraditionalForm[Style["f", Italic][x] == (1/2) x + 1]}, {True, False}}] I fiddled a little and this works too. I went into the Option Inspector and changed the "InputInline" Cell option to Traditional Form. The code below works so long as I use an Inlinecell inside the quotation marks. One of the positives of doing it this way is that Mathematica doesn't simplify the (1/2)x to x/2.

Manipulate[
Plot[If[f, .5 x + 1], {x, -3, 6}, PlotRange -> {{-1, 6}, {-1, 5}},
Ticks -> {Range[-3, 6], Range[-1, 5]}, GridLines -> Automatic,
GridLinesStyle -> Opacity[.03],
AxesStyle -> Arrowheads[.03]], {{f, False, "f(x) = 1/2x+1"}, {True, False}}] 