Creating and editing new stylesheets

I'm trying to create a stylesheet, but the process has become painful. I'm sure that this has to do something w ith resetting something in Mathematica everytime I make changes to the stylesheet. To explain my problem better I w ill describe the steps I take to create a very simple stylesheet w ith only one style defined. In a new notebook enter the follow ing:
CreateDocument[{ Cell[StyleData[StyleDefinitions -> "Core.nb"]], Cell[StyleData["Title"], ConversionRules -> { "TeX" -> {"\\title{", # &, "}"}, "HTML" -> {"<h1 class=\"Title\"\n>", # &, "\n</h1>"} }, FontSize -> 26, FontWeight -> "Bold", FontColor -> RGBColor[0, 0, 0] ] }, StyleDefinitions -> "StylesheetFormatting.nb", Editable -> True, Saveable -> True ]

The new notebook that appears w ill contain tw o cells. It w ill have the style as all the stylesheets that you have seen and you w ill be able to edit and save it. Save this notebook in $UserBaseDirectory/SystemFiles/FrontEnd/StyleSheets/ . I name this notebook Style01.nb . Once you have this enter this command:
MathLink`CallFrontEnd[FrontEnd`ResetMenusPacket[{Automatic, Automatic}]]

I found that command here, this command resets the menu so that Mathematica can list your stylesheet in the menu. At this point w e are ready to use the stylesheet. Open a new notebook and create a Title cell. Save this notebook as TestNb.nb in a directory of your choice. Go to Format > Stylesheet > Style01 .

Test 1:
The current view should be this:

Now w e select the Title cell in Style01.nb and w e show the expression by going to Cell > Show Expression . The next screenshot show s the view w ith the modifications:

I made a mistake (purposely made w hen I created the style sheet).nb"]. Test 2: Now lets see if our conversions rules w ork. let us correct this mistake: . Now w e see that the changes took effect. We can repeat this procedure to keep adjusting the Title cell.nb . In a mac w e can press command + shift + E . Lets create a new notebook called ExportNb.Now w e change back the title cell to how it w as originally by doing Cell > Show Expression again. "HTML". "FullDocument" -> False] This is w hat I obtained after evaluating those commands: The conversion rules took effect. No problem there. ExportString[nb. In any case. Put the follow ing in it: nb = NotebookOpen[NotebookDirectory[] <> "TestNb.nb in the same directory as TestNb. The angle bracket should have been on the top. But.

and save Style01. w e try to see if the new conversion rules w ill w ork.nb . Questions: Is there any w ay for Mathematica to know that there has been changes in the conversion rules? Is there something that w e need to restart other than the Kernel to see that this changes have been made? If restarting the kernel is the only w ay. I have found that if I quit the Kernel by going to Evaluation > Quit Kernel > local and then I run the commands again then it w orks: Conclusion and Questions: It seems that if w e w ant to the w ay your notebook looks like you can create styles and you w ill see how the changes take effect after you modify your stylesheet as I described in Test1.After w e revert back. – Alexey Popkov May 28 '12 at 5:27 @Alexey Popkov. front-end kernel conversion asked May 26 '12 at 21:38 jmlopez 1. then you better bew are of the ConversionRules . Unfortunately. – jmlopez May 28 '12 at 16:43 . is there a command to restart it? I'm getting tired of having turning it off and on all the time manually. Seems usef ul. I'm sure you w ill keep making many mistakes w hen you change the ConversionRules but you w ill not be able to see the change of this unless you restart the kernel. But. if you are to export your notebook as an HTML file or Tex. I'll look more into y our f unction later. I tried ClearSystemCache[] but that does not work. I guess at this point the best is to just ev aluate the quit command and then ev aluate the code I showed. the changes in the ConversionRules do not take effect.860 5 22 Hav e y ou tried ClearSystemCache[] ? If it does not help y ou could try to f ind af f ected sy mbols by monitoring the ByteCount (or ev en OwnValues and DownValues ) f or the all non-protected sy mbols in all contexts using something like the code I prov ided here.

– jmlopez May 27 '12 at 14:58 I answered this way because. but my imression is that Quit only closes one kernel. you simply type Quit and the kernel stops. then run the commands again in the new session. Other ideas? I also f ind strange that Quit and CloseKernels are not related in the documentation. but now it takes a f ew millisecs to restart the whole thing and hav e a clean slate. while CloseKernels closes all open kernels. – magma Oct 17 '12 at 22:41 @magma as f ar as I know Quit[] closes the master kernel and so also all slav e kernels. That's it! answered May 27 '12 at 13:42 magma 1. +1 f or answering. partly because PCs were comparativ ely slow back then.840 4 24 I f igured that much but it just seems like a little too much to restart ev ery thing when there's probably something else that takes care of the sty le def initions. so why bother? – magma May 28 '12 at 8:46 @magma may be here is not the right place to post a question. – RMMA Oct 17 '12 at 12:02 @Frink good question! I am not sure since I nev er really experimented with parallel computations. it seemed like y ou were not aware of the Quit command. But I just wondered if there is a dif f erence between Quit[] and CloseKernels[]. Any way. Quitting and restarting used to be a slow and painf ul process with the f irst v ersions of MMA. – RMMA Oct 19 '12 at 12:27 . f rom y our question.1 Answer Instead of going to Evaluation > Quit Kernel > local. In my opinion this is wrong.