# Column makes fonts smaller

When you use Column (or Grid) a previously styled element with explicit font-size setting appears much smaller. Here is an example

cell = Framed[Style[(2*x^(3/2))/3, FontSize -> 14],
FrameMargins -> 10,
FrameStyle -> {AbsoluteThickness[1], LightGray},
{cell, Column[{cell}]}


I looked through the options of Column, Grid, and GridBox but I couldn't find how I can prevent this when I output an expression with nested columns or grids. And setting the font-size larger, so that it appears to be non-scaled sounds like a bad idea.

Can anyone give me some insight?

# Update

With the help of Roman's answer, I could fix my layout. However, there seems to be a bug in Panel which does not respect the settings. Please compare the two usages of Panel without and with a title:

Column[{Item[cell, AllowScriptLevelChange -> False]}]
Panel[Column[{Item[cell, AllowScriptLevelChange -> False]}]]
Panel[Column[{Item[cell, AllowScriptLevelChange -> False]}], "Hello"]


Three different font-sizes. I simply removed the Panel as it was not extremely important.

• I guess it's like "display math" vs "inline math" in LaTeX but I can't recall the controlling option. In other words, it's the same thing that makes the fonts smaller in the denominator of a fraction. – Szabolcs Jun 16 '18 at 21:49
• @Szabolcs I only found ScriptSizeMultipliers but that's not it. ImageSizeMultipliers sounded good but I couldn't make it work.. hmmm. Waiting for Kuba :) – halirutan Jun 16 '18 at 22:23

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},
{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},

Panel[Column[{Item[cell]}], "Hello"]
Panel[Column[{Item[cell2]}], "Hello"]


• Ohh, that deserves a big upvote. Thank you very much for the hint! – halirutan Jun 16 '18 at 22:33
• It is completely beyond my imagination how on earth I should get this working with nested Grid, Panel, Item, ... Look at this {cell, Panel[Column[{cell}, AllowScriptLevelChange -> False]]} and here is the image for that. Oh my.. – halirutan Jun 16 '18 at 23:06
• @halirutan I'm not sure what result you're trying to achieve. Could you explain? or upload an image? – roman465 Jun 17 '18 at 0:56
• I simply kicked the Panel out, but if you are interested, you can have a look at my updated question. – halirutan Jun 17 '18 at 1:12
• Yep, strange. Thanks for the update. – halirutan Jun 17 '18 at 2:23

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 respect AllowScriptLevelChange.

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]}