6
$\begingroup$

A persistent problem I've run into is that certain character decorations within the text of a paragraph will often add extra line spacing even if there is already plenty of space between lines. This happens with things like vectors $\vec r$, overdots $\dot y$, and roots $\sqrt x$ but not to superscripts or subscripts. It is most apparent if one of these is in the middle of a large Text paragraph. The uneven line spacing looks rather unsightly and unprofessional.

enter image description here

I tried adding the option LineSpacing -> {1.25, 0, 1.25} to the Text cell but that doesn't seem to do anything. Even if I add more line spacing with something like LineSpacing -> {1.5, 0, 1.5} the character decorations still add height even though there is plenty of room for them.

I would like to keep the special characters in TraditionalForm so they match the style used in InlineFormula fields if possible.

$\endgroup$

1 Answer 1

2
$\begingroup$

One quick idea would be to wrap a StyleBox around the FormBox'es (of the inline cells). I just do this here once "by hand", but you can easily write a little program to do this.

   Manipulate[fs = s, {{s, 10, "fontsize"}, 9, 14, 1}]
CellPrint@Cell[TextData[{
     "Lorem ipsum dolor sit amet, consectetur \
    adipisicing elit, sed do eiusmod tempor incididunt \
    ut labore et dolore magna aliqua. Ut enim ad minim \
    veniam, quis nostrud exercitation ullamco laboris \
    nisi ut aliquip ex ea commodo consequat. Duis ",
     Cell[BoxData[StyleBox[
         FormBox[
           SqrtBox["S"], TraditionalForm], FontSize -> Dynamic@fs]],
       FormatType -> "TraditionalForm"],
     "aute irure dolor in reprehenderit in voluptate \
    velit esse cillum dolore eu fugiat nulla pariatur. \
    Excepteur sint occaecat cupidatat non proident, sunt \
    in culpa qui officia deserunt mollit anim id est \
    laborum."
    }], "Text"]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.