2
$\begingroup$

This almost exclusively pertains to textual content, not Input. In my documents (Notebooks), I often have complicated expressions which involve square roots. I spend good time trying to format them to be readable (particularly readable by me). Unfortunately, Mathematica has other ideas of what my equations should look like. I've attached a screen-scrape showing the problem. When I entered the two lines shown, they were identical. For some reason the first line was reformatted to appear as shown.

I don't know when these changes happen. In other words, when saving the document as a Notebook; when evaluating the Notebook; when saving the notebook as PDF; when opening the Notebook; or when the stars aren't properly aligned.

Is there a way to prevent this from happening?

"10.4.0 for Microsoft Windows (64-bit) (February 26, 2016)"


Edit to add the copied cells from an older version exhibiting the same problem.

Edit 15 June 18 ~ 10:30 AM EST.

The Cell content I posted last edit wasn't what was asked for. When I attempted to Shift+Ctrl+R the Cell with the broken radical, Mathematica did nothing. So here is a new Notebook with only the broken Cell pasted into it. Cell with broken radical:


(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.4' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[      2622,         88]
NotebookOptionsPosition[      2247,         68]
NotebookOutlinePosition[      2700,         89]
CellTagsIndexPosition[      2632,         84]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 FormBox[
  RowBox[{
   RowBox[{"\[Tau]", "\[Congruent]", 
    RowBox[{
     SubsuperscriptBox["\[Integral]", 
      SuperscriptBox["\[ScriptCapitalE]", "1"], 
      SuperscriptBox["\[ScriptCapitalE]", "2"]], 
     RowBox[{"\[DifferentialD]", "\[Tau]"}]}]}], "=", 
   RowBox[{
    RowBox[{
     SubsuperscriptBox["\[Integral]", 
      SuperscriptBox["\[ScriptCapitalE]", "1"], 
      SuperscriptBox["\[ScriptCapitalE]", "2"]], 
     SqrtBox[
      RowBox[{
       RowBox[{"\[DifferentialD]", 
        SuperscriptBox["x", "\[Alpha]"]}], 
       RowBox[{"\[DifferentialD]", 
        SuperscriptBox["x", "\[Beta]"]}], 
       SubscriptBox["\[Eta]", 
        RowBox[{"\[Alpha]", "\[InvisibleComma]", "\[Beta]"}]]}]]}], "=", 
    RowBox[{
     SubsuperscriptBox["\[Integral]", 
      SuperscriptBox["\[ScriptCapitalE]", "1"], 
      SuperscriptBox["\[ScriptCapitalE]", "2"]], 
     RowBox[{"\[Sqrt]", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{"\[DifferentialD]", 
          SuperscriptBox["x", "4"]}], 
         RowBox[{"\[DifferentialD]", 
          SuperscriptBox["x", "4"]}], 
         SubscriptBox["\[Eta]", 
          RowBox[{"4", "\[InvisibleComma]", "4"}]]}], "+", 
        RowBox[{
         RowBox[{"\[DifferentialD]", 
          SuperscriptBox["x", "i"]}], 
         RowBox[{"\[DifferentialD]", 
          SuperscriptBox["x", "j"]}], 
         SubscriptBox["\[Eta]", 
          RowBox[{"i", "\[InvisibleComma]", "j"}]]}]}], ")"}]}]}]}]}], 
  TraditionalForm]], "Equation",
 CellChangeTimes->{{3.7380599537035913`*^9, 3.7380599903548117`*^9}, 
   3.7380600239399304`*^9, 3.7380601244571733`*^9, 3.738060476761531*^9},
 CellTags->"b:0.5.0"]
},
WindowSize->{1520, 805},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
FrontEndVersion->"10.4 for Microsoft Windows (64-bit) (February 25, 2016)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "b:0.5.0"->{
  Cell[558, 20, 1685, 46, 82, "Equation",
   CellTags->"b:0.5.0"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"b:0.5.0", 2541, 78}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 1685, 46, 82, "Equation",
 CellTags->"b:0.5.0"]
}
]
*)

(* End of internal cache information *)

Previous copy of Cell content removed.


A copy of Shift+Ctrl+R on a Cell containing the same equation the way I want the radical to appear.

TextCell[RawBoxes[Cell[BoxData[
     FormBox[RowBox[{RowBox[{"\[Tau]", "\[Congruent]", 
          RowBox[{SubsuperscriptBox["\[Integral]", 
             SuperscriptBox["\[ScriptCapitalE]", "1"], 
             SuperscriptBox["\[ScriptCapitalE]", "2"]], 
            RowBox[{"\[DifferentialD]", "\[Tau]"}]}]}], "=", 
        RowBox[{RowBox[{SubsuperscriptBox["\[Integral]", 
             SuperscriptBox["\[ScriptCapitalE]", "1"], 
             SuperscriptBox["\[ScriptCapitalE]", "2"]], 
            SqrtBox[RowBox[{RowBox[{"\[DifferentialD]", 
                SuperscriptBox["x", "\[Alpha]"]}], 
               RowBox[{"\[DifferentialD]", SuperscriptBox[
                "x", "\[Beta]"]}], SubscriptBox["\[Eta]", 
                RowBox[{"\[Alpha]", "\[InvisibleComma]", 
                "\[Beta]"}]]}]]}], "=", 
          RowBox[{SubsuperscriptBox["\[Integral]", 
             SuperscriptBox["\[ScriptCapitalE]", "1"], 
             SuperscriptBox["\[ScriptCapitalE]", "2"]], 
            SqrtBox[RowBox[{RowBox[{RowBox[
                {"\[DifferentialD]", SuperscriptBox["x", 
                "4"]}], RowBox[{"\[DifferentialD]", 
                SuperscriptBox["x", "4"]}], 
                SubscriptBox["\[Eta]", RowBox[
                {"4", "\[InvisibleComma]", "4"}]]}], "+", 
               RowBox[{RowBox[{"\[DifferentialD]", 
                SuperscriptBox["x", "i"]}], 
                RowBox[{"\[DifferentialD]", SuperscriptBox[
                "x", "j"]}], SubscriptBox["\[Eta]", 
                RowBox[{"i", "\[InvisibleComma]", 
                "j"}]]}]}]]}]}]}], 
      TraditionalForm]]]], "Text", 
  CellTags -> "b:0.5.0

Previous copy of Cell content removed.

Mangled radical sign

$\endgroup$
  • $\begingroup$ Please edit your question to include the Mathematica code for this expression in Raw InputForm $\endgroup$ – Bob Hanlon Jun 14 '18 at 19:03
  • $\begingroup$ I added what I believe you wanted. This happens a lot. I haven't figured out whether it is related to the Style of the Cell, or to any other factor. It always happens to longer expressions under the radical. Even worse, Mathematica doesn't always get the grouping correct. $\endgroup$ – Steven Thomas Hatton Jun 14 '18 at 20:19
  • $\begingroup$ See the menu Cell | Convert To | Raw InputForm. The expression that you pasted in as "the way I want the radical to appear" is incomplete. $\endgroup$ – Bob Hanlon Jun 14 '18 at 23:46
  • $\begingroup$ Mathematica refused to honor my <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>R</kbd> on the "broken" Cell. I pasted an entire one-Cell Notebook instead. </br> There are also cells which look fine to me, but refuse to <kbd>Shift</kbd>+<kbd>Ctrl</kbd>+<kbd>R</kbd>. $\endgroup$ – Steven Thomas Hatton Jun 15 '18 at 14:46
5
$\begingroup$

This is the effect of option MultilineFunction. It's not linked to from the SqrtBox or RadicalBox pages (perhaps it should be), but it does appear in their list of options. Presumably something is causing M- to think that it needs to line wrap so it's breaking the box.

I'm guessing you want MultilineFunction -> None, but read the docs for other options. This can be literally inserted in particular boxes, set in the stylesheet for particular styles, or set at the notebook or global level. For example,

SetOptions[EvaluationNotebook[], SqrtBoxOptions -> {MultilineFunction -> None}]

will set it for all SqrtBox's in the current noteook. There exist corresponding RadicalBoxOptions, FractionBoxOptions, etc.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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