What I think is happening is that the SetOptions
statement in init.m
is executed during kernel initialization as expected, however when the notebook window is opened, the front-end sets PageWidth
to be WindowWidth
. Furthermore, the kernel value does get changed accordingly whenever the window is resized.
This being the front-end, I would not be surprised if there are other/better ways, but what seemed to work was
SetOptions[$FrontEnd, PrivateEvaluationOptions -> {"OutputFormPageWidth" -> 125}]
While it was not the culprit in this question, I would still mention that something similar may happen in a console kernel session, where PageWidth
can be reset by the terminal input library to be the width of the console at startup time. This can be avoided by either turning the terminal library off or using a scheduled task in init.m
, e.g.
task := SetOptions["stdout", PageWidth -> 125];
RunScheduledTask[task, {1}]
so that it runs after the terminal library is loaded.
Internal`NewInput=False;
toinit.m
. $\endgroup$SetOptions["stdout", PageWidth -> 125];
insideinit.m
does not change thePageWidth
setting:Options["stdout", PageWidth]
returns{PageWidth -> 32}
after launching Mathematica. $\endgroup$SetOptions["stdout", PageWidth -> 125];
andInternal`NewInput=False;
? $\endgroup$task := SetOptions["stdout", PageWidth -> 125]; RunScheduledTask[task, {1}]
. $\endgroup$PageWidth
toWindowWidth
and also change it dynamically on window resize. PerhapsSetOptions[$FrontEnd, {PrivateEvaluationOptions -> {"OutputFormPageWidth" -> 125}}]
will do the trick? $\endgroup$