Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Preventing In-line Math Typesetting From Being Scaled Down in Text

20 views
Skip to first unread message

Gregory Lypny

unread,
Jul 27, 2011, 6:15:06 AM7/27/11
to
Hello Mr. Fultz,

Tried but it didn't work. I executed the command in the stylesheet notebook corresponding to the notebook I'm working with. Perhaps I've misunderstood. Also, not sure where to find Core.nb. Is it in the application
package?


Gregory Lypny

> On Fri, 22 Jul 2011 19:46:07 -0400 (EDT), Gregory Lypny wrote:
> > Hi everyone,
> >
> > When I include fractions as inline math typesetting, they are scaled down
> > to fit the effective line height of the cell. How can I prevent this or,
> > I guess, make the line height automatically expand to accommodate the
> > math? If my regular text in the cell is 12-point times, I'd like all
> > math variables that are not subscripts or superscripts to be 12-point as
> > well.
> >
> > Incidentally, other big typeset objects like matrices are not scaled
> > down, or at least they down't appear to be.
> >
> > Sincerely,
> >
> > Gregory
>
> If you look in Core.nb, you'll find a style called "InlineCell". This style is
> automatically applied to all inline cells everywhere. One of the options it has
> set is:
>
> ScriptLevel->1
>
> This is what's causing the behavior you're seeing. You can override this with a
> custom stylesheet. For example, in a given notebook, you can make a private
> override by doing Format->Edit Stylesheet..., and pasting and interpreting the
> following cell expression at the end of the resulting stylesheet notebook:
>
>
> Cell[StyleData["InlineCell"], ScriptLevel->0]
>
>
> Sincerely,
>
> John Fultz
> jfu...@wolfram.com
> User Interface Group
> Wolfram Research, Inc.
>

John Fultz

unread,
Jul 27, 2011, 6:15:37 AM7/27/11
to
Looks like there's a minor bug in the updating mechanism. Perhaps this is what you ran into. If, after following my procedure, you save, close, and reopen the notebook, you'll see that the change has taken effect.

Core.nb is inside the Mathematica layout, but it's generally not a good idea to be changing things there. If you're hoping to make the change globally for all notebooks on your system, let me know and I can walk you through that procedure. However, doing so will not change the notebook when viewed on somebody else's system, where as the Format->Edit Stylesheet... change will persist with the notebook regardless of which system it's viewed on.

Sincerely,

John Fultz
jfu...@wolfram.com
User Interface Group
Wolfram Research, Inc.

blamm64

unread,
Jul 30, 2011, 6:12:28 AM7/30/11
to
> >> Wolfram Research, Inc.- Hide quoted text -
>
> - Show quoted text -

Thanks John! Is there anything similar for Input cells
(StandardForm)? Often, I prefer to enter math Input in 2D, and if I
enter a 2D Piecewise, and one or more lines of the Piecewise have
fractions and/or square roots, the font ends up being really tiny (for
me). So some similar setting for Input (StandardForm) to force the
font size to be the same regardless of position would be helpful to
me.

-Brian L.

John Fultz

unread,
Jul 31, 2011, 7:32:29 AM7/31/11
to

Here's a little tutorial on what's going on:

There are three options which control how scripts and fractions shrink.

* ScriptMinSize - this is the minimum size (in points) of the font which will
ever be used inside of a script/fraction.
* ScriptSizeMultipliers - this is the multiplier is used each time you add a
script/fraction level. I.e., by default, fonts shrink by a factor of .71 for
each script level.
* ScriptLevel is the option which determines how deep the script is. This is
set by Mathematica automatically, but it is possible to override it via the
Option Inspector or in a stylesheet.

So, the resulting font size is going to be:

Min[
Max[ScriptMinSize, ScriptSizeMultipliers^Max[ScriptLevel-1,0] *
currentFontSize], currentFontSize]

Which means ScriptLevels of 0 and 1 never shrink, but 2 and greater do. It's a
bit more complicated than this because you can pass ScriptSizeMultipliers a
list...see the documentation for details...but this describes the default case
accurately.

ScriptLevel is 0 in Input cells and 1 in inline cells (the latter behavior being
determined from the stylesheet). In nested fractions it always increments by 1.
In nested scripts, it always starts at least at 2 in the outermost script, and
then increments by 1.

ScriptLevel can also get set automatically by Mathematica a few other times.
One of them, as you're running into, is inside of a GridBox. The front end
allows the ScriptLevel to be incremented from 0 to 1 (but not greater than 1)
when inside of a GridBox. That's why you're seeing Piecewise behave the way it
does.

This means that first-level fractions, by default, don't shrink in Input cells
because their ScriptLevel is 1, but first-level fractions in inline cells and
grids shrink because their scriptLevel is 2.

Possibilities...

* You could get rid of shrinking entirely by setting
ScriptSizeMultipliers->{1.}, or stop the first-level shrinking by using
ScriptSizeMultipliers->{1.,.71}. You can also set ScriptMinSize to an
outrageously large value. You could set this at global scope, or on the
StandardForm style.
* It's possible to target Piecewise specifically by changing the "Piecewise"
style.

Devising a solution for this was slightly tricky, as I wanted to preserve
shrinking behavior, but not for top-level fractions. Here's what I came up
with:

Cell[StyleData["Piecewise"],
FractionBoxOptions->{BaseStyle->{ScriptLevel->1}}]

This doesn't shrink nested fractions, but it does shrink scripts, and itacts
pretty reasonably with fractions inside of scripts.

John Fultz

unread,
Jul 31, 2011, 7:33:01 AM7/31/11
to
[Fixing an error to my last email. -jf]

On Sat, 30 Jul 2011 13:16:47 -0500, John Fultz wrote:
> Devising a solution for this was slightly tricky, as I wanted to preserve
> shrinking behavior, but not for top-level fractions. Here's what I came
> up with:
>
> Cell[StyleData["Piecewise"],
> FractionBoxOptions->{BaseStyle->{ScriptLevel->1}}]

Sorry, that should have been...

Cell[StyleData["Piecewise"],
FractionBoxOptions->{BaseStyle->{ScriptLevel->0}}]

0 new messages