Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a private stylesheet I'm using. I edit it by going to the menu Edit->Edit Stylesheet and then clicking on the private stylesheet cell. I can modify whatever I want but it never gets saved.

The notebook option Saveable can be set to True (is by default False) but that still doesn't change the fact that in order to save it I can only do it by going to Save AS, and making it replace itself. To do that I have to go to the $UserBaseDirectory, SystemFiles, FrontEnd, StyleSheets, not practical...

The question is implicit, can you help out?

share|improve this question
    
Can you upload and link this style sheet? –  Mr.Wizard Feb 12 '12 at 5:47
    
@Mr.Wizard, I thought wrongly it was something with all stylesheets but now I see I assumed wrong and the whole question seems stupid, I have. It seemed I had to save the notebook in order for the Saveable option to start working as usual, haha –  Rojo Feb 12 '12 at 5:58
    
I'll leave it... –  Rojo Feb 12 '12 at 6:03
1  
The decision to upvote and accept implied I had already decided to leave it –  Rojo Feb 12 '12 at 6:18
add comment

3 Answers 3

up vote 4 down vote accepted

Normal behavior is that simply closing the edited style sheet will transparently save it.

If you create a new private style sheet for a new notebook and you still do not have this behavior then you must have changed a global configuration setting.

If this problem is peculiar to a particular private style sheet then I suggest going over raw file looking for how it differs from the freshly created notebook described above.

Also, you describe having to save this private style sheet with Save As into $UserBaseDirectory; as far as I know this is not how private style sheets work. How did you create this "private" style sheet in the first place?

share|improve this answer
2  
I had edited the private stylesheet of a notebook, and then saved it AS in the $UserBaseb..... StyleSheets so it got recognised as a regular stylesheet. But it inherited the Saveable->False option and that option's behaviour confused me, as I explained in the comment to my question. Thanks –  Rojo Feb 12 '12 at 6:02
add comment

You can do all this programmatically like so:

SetOptions[EvaluationNotebook[], 
 StyleDefinitions -> 
  Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
    Cell[StyleData["MyStyle",StyleDefinitions -> StyleData["Text"]], Background->RGBColor[1,0,0]]},Saveable -> True,
   StyleDefinitions -> "PrivateStylesheetFormatting.nb"]
 ]

That adds the style "MyStyle" to your stylesheet. The private style sheet is based on Default.nb and MyStyle is based on "Text".

You can create the private style sheet separately:

CreateDocument@
 Notebook[{Cell[StyleData[StyleDefinitions -> "Default.nb"]], 
   Cell[StyleData["MyStyle", StyleDefinitions -> StyleData["Text"]], 
    Background -> RGBColor[1, 0, 0]]}, 
  StyleDefinitions -> "PrivateStylesheetFormatting.nb"]

This stylesheet can be saved, i.e. File > Save, or saved as a new filename, i.e. File > Save As

share|improve this answer
add comment

I have the same problem as well, ie I can modify whatever I want in the private stylesheet but it never gets saved.

I could solve this problem before, by reading this topic. Then after a long while I had this problem again and came back here. It took me a big while to read everything here again and figure out what to do. (I may just be stupid.) Please let me document here just what is to be done.

In brief, the private stylesheet has been set to be unsaveable. This has to be changed.

  1. While the Private Style Definitions window is active, choose Format > Option Inspector....
  2. In the Scope field, choose Selected Notebook.
  3. Search for Saveable
  4. Tick the only one checkbox that appears so that its Value is True.
  5. Choose File > Save
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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