Column makes fonts smaller
There is an option for Column
or Grid
to avoid this: AllowScriptLevelChange
cell = Framed[Style[(2*x^(3/2))/3, FontSize -> 14],
FrameMargins -> 10,
FrameStyle -> {AbsoluteThickness[1], LightGray},
RoundingRadius -> 3];
{cell, Column[{cell}, AllowScriptLevelChange -> False]}
UPDATE
Honestly, I don't know why Panel
doesn't respect AllowScriptLevelChange
. As a workaround you can use ScriptLevel -> 0
inside Style
to fix the size of Panel
with the title
cell2 = Framed[Style[(2*x^(3/2))/3, FontSize -> 14, ScriptLevel -> 0],
FrameMargins -> 10,
FrameStyle -> {AbsoluteThickness[1], LightGray},
RoundingRadius -> 3];
Panel[Column[{Item[cell]}], "Hello"]
Panel[Column[{Item[cell2]}], "Hello"]
Another approach is to set AllowScriptLevelChange -> False
via GridBoxOptions
:
{cell, Style[
Panel[Column[{cell}], "Hello", DefaultBaseStyle -> None],
GridBoxOptions -> {AllowScriptLevelChange -> False}]}
For curiosity, here is a low-level workaround based on AllowScriptLevelChange -> False
:
{cell,
RawBoxes@Replace[ToBoxes[
Panel[Column[{cell}], "Hello", DefaultBaseStyle -> None]],
gb_GridBox :>
RuleCondition@Append[gb, AllowScriptLevelChange -> False], -1]}
Honestly, I don't know why
Panel
doesn't respectAllowScriptLevelChange
.
Actually PanelBox
doesn't change the ScriptLevel
, but when labeled Panel
is used, label is added by wrapping the contents of the panel by GridBox
which doesn't inherit AllowScriptLevelChange -> False
(what I would count as a bug) and hence changes the ScriptLevel
. The same is true for Labeled
and the same workaround works:
{cell, Labeled[cell, "Hello", Top],
RawBoxes@Replace[ToBoxes[
Labeled[cell, "Hello", Top]],
gb_GridBox :> RuleCondition@Append[gb, AllowScriptLevelChange -> False], -1]}