15
$\begingroup$

I'd like to set Mathematica (8.0.4.0) up so it opens new notebooks with the "NaturalColor" stylesheet and with a WindowSize like {800,770}. I tried to change default stylesheet via:

OptionInspector -> Global Preferences -> Global Options\File Locations\Default Style Definition

and I get this ugly notebook instead of this one.

And when I Change the value of "WindowSize" from "Medium" to "{800,770}" under "Notebook Options\Window Properties", it just does nothing.

This is driving me crazy, any ideas ?

$\endgroup$

3 Answers 3

12
$\begingroup$

The default window size can be controlled from two different places. The first is the Global $FrontEnd WindowSize, set through the Option Inspector > Global Preferences or with:

SetOptions[$FrontEnd, WindowSize -> {300, 900}]

The second is the WindowSize of the style sheet itself. If it is defined, the WindowSize of the style sheet will overrule the setting above. You set the style sheet size through the Option Inspector > Selected Notebook or by evaluating this inside the style sheet itself:

SetOptions[EvaluationNotebook[], WindowSize -> {300, 900}]

To select the default style sheet, click the button to the right of the setting name, and use the file browser:

Mathematica graphics

$\endgroup$
5
  • 2
    $\begingroup$ window size and window position cannot be set globally for newly opened notebooks. Had this confirmed by Wolfram after a couple of other questions here asking similar. You can only set these at the notebook level, i.e. the notebook has to open first at its default position with default size before you can change these settings. $\endgroup$ Commented Feb 27, 2012 at 21:37
  • $\begingroup$ @Mike, I just tested this again to make sure I'm not blowing smoke. It works as I described. Are you sure the style sheet doesn't have a WindowSize setting embedded in it that is overriding the global setting? $\endgroup$
    – Mr.Wizard
    Commented Feb 28, 2012 at 0:11
  • 1
    $\begingroup$ Maybe we are talking apples and oranges -- what did you test? I was talking about an inability to globally set a window size for all notebooks via e.g. a global setting in the option inspector (or equivalent code). It is possible to set default sizes for various dialog boxes globally but not for notebooks. I am on Mac but when I asked Wolfram I also asked about Windows since it was originally a Windows question on here that alerted me to this absence. Ditto the WindowMargins. $\endgroup$ Commented Feb 28, 2012 at 7:15
  • $\begingroup$ @Mike your insistence caused me to look at this once again, and the situation is more complicated than I thought. I always create a new notebook with a button that calls NotebookCreate[StyleDefinitions -> . . .] and this produces different behavior than using File > New > Notebook. With this it is possible to get the specified Notebook WindowSize, and theoretically one could edit MenuSetup.tr to get the same result from the menu. I shall try to update my answer today with a more complete analysis of how this works. $\endgroup$
    – Mr.Wizard
    Commented Feb 28, 2012 at 16:00
  • 1
    $\begingroup$ Yes it would be possible to do it that way because you are setting the specific notebook option within the notebook you create. I guess I was referring to the current built in availability rather than buttons a user can create. $\endgroup$ Commented Feb 28, 2012 at 20:37
3
$\begingroup$

For the first part of your question: To change the style definition for the default notebook, youe need to change the value of the OptionInspector -> Global Preferences -> Global Options\File Locations\Default Style Definition to

 FrontEnd`FileName[{"Creative"}, "NaturalColor.nb"]

Screenshot:

enter image description here

enter image description here

Note: that you need to hit Enter after you type anything in an input field in the Options Inspector. Clicking on the Apply button or anywhere outside the input field without hitting Enter just resets the field value.

$\endgroup$
2
  • $\begingroup$ It worked for the Stylesheet but, the windows are still opened in {707, 639} whenever I hit Ctrl+N ... and the value under "Option Inspector > Selected Notebook >Window Properties" returns to : " {825, FEPrivateIf[FEPrivateSameQ[FEPrivate$OperatingSystem, "Unix"], 11, 0] + FEPrivateIf[FEPrivateSameQ[FEPrivateLess[FEPrivate`$DaysUntilExpiration, 15], True], 505, 451]} " upon restart $\endgroup$ Commented Feb 27, 2012 at 10:23
  • $\begingroup$ @user1234161, re window sizes for new notebooks please see Mike's comments on Mr.Wizard's answer. $\endgroup$
    – kglr
    Commented Feb 29, 2012 at 9:21
2
$\begingroup$

From what I've read here on MSE, it is not possible to create a default WindowSize for new notebooks. To cope with this efficiently, I've created the following palette which others might find handy as well.

The result looks like this:

enter image description here

And the full code is:

(* Screen sizing buttons *)

fullscreen = 
 Button[Text[Style["Full Screen", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Full}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

autosize = Button[Text[Style["Auto Size", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Automatic}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

medsize = Button[Text[Style["Med size", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Medium}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

windowTwoThirds = 
 Button[Text[Style["2/3 width", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Scaled[2/3], Scaled[.98]},
   WindowMargins -> {{0, Automatic}, {Automatic, 0}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

windowOneHalf = 
 Button[Text[Style["1/2 width", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Scaled[1/2], Scaled[.98]},
   WindowMargins -> {{0, Automatic}, {Automatic, 0}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

windowOneThird = 
 Button[Text[Style["1/3 width", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Scaled[1/3], Scaled[.98]},
   WindowMargins -> {{0, Automatic}, {Automatic, 0}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

maxwindow = Button[Text[Style["Max size", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Scaled[1], Scaled[1]},
   WindowMargins -> {{0, Automatic}, {Automatic, 0}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

maxwidth = Button["\[LeftRightArrow]",
  SetOptions[SelectedNotebook[], 
   WindowSize -> {Scaled[1], Automatic}(*WindowMargins\[Rule]{{0,
   Automatic},{Automatic,0}}*)], BaseStyle -> {"GenericButton", 10}, 
  ImageSize -> Medium]

maxheight = 
 Button[Text[Style["\[UpDownArrow]", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], WindowSize -> {Automatic, Scaled[1]}
   (*WindowMargins\[Rule]{{0,Automatic},{Automatic,0}}*)], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

(* Screen movement buttons *)

movetopleft = 
 Button[Text[
   Style["\[UpperLeftArrow] Move", Small, FontFamily -> "Helvetica"]],
  SetOptions[SelectedNotebook[], 
   WindowMargins -> {{0, Automatic}, {Automatic, 0}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

movetopright = 
 Button[Text[
   Style["Move \[UpperRightArrow]", Small, FontFamily -> "Helvetica"]], 
  SetOptions[SelectedNotebook[], 
   WindowMargins -> {{Automatic, 0}, {Automatic, 0}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

movebottomright = 
 Button[Text[
   Style["Move \[LowerRightArrow]", Small, FontFamily -> "Helvetica"]], 
  SetOptions[SelectedNotebook[], 
   WindowMargins -> {{Automatic, 0}, {0, Automatic}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

movebottomleft = 
 Button[Text[
   Style["\[LowerLeftArrow] Move", Small, FontFamily -> "Helvetica"]], 
  SetOptions[SelectedNotebook[], 
   WindowMargins -> {{0, Automatic}, {0, Automatic}}], 
  BaseStyle -> {"GenericButton", 10}, ImageSize -> Medium]

(* Create palette *)

CreatePalette[Row@{
   (*Grid@{{unlockCell,quitKernel,redColor},{lockCell, "",clearColor}},*)

   Grid@{{fullscreen, maxwindow, autosize}, {windowTwoThirds, windowOneHalf, 
      windowOneThird}},
   Grid@{{maxheight}, {maxwidth}},
   Grid@{{movetopleft,
      movetopright},
     {movebottomleft,
      movebottomright}}
   },
 WindowTitle -> "Screen management"
 ]

One the palette has been shown up as a dialog window in Mathematica, you should use (menu) > Palettes > Install palette... to ensure it is always available under the Palettes menu.

$\endgroup$
1
  • $\begingroup$ I have never found this palette useful until I bought a 34-inch ultra wide screen couple weeks ago. It is a must have feature to have on such wide display. Thanks for sharing. $\endgroup$
    – yshk
    Commented Aug 22, 2019 at 19:18

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.