Guest User

Untitled

a guest
Dec 10th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. ol = ToFileName[{$InstallationDirectory, "SystemFiles", "FrontEnd",
  2. "StyleSheets", "Utility"}, "Outline.nb"];
  3. stylnbk = Import[ol];
  4.  
  5. insertToToolbar = {" | ", TooltipBox[ButtonBox["7", ButtonFunction :>
  6. (SelectionMove[ButtonNotebook[], After, Cell];
  7. NotebookWrite[ButtonNotebook[], Cell["XXXX", "Outline7"], All];
  8. SelectionMove[ButtonNotebook[], All, CellContents]),
  9. BaseStyle -> "ToolbarButton",
  10. Appearance -> None, ButtonFrame -> None,
  11. Evaluator -> Automatic,
  12. ImageSize -> Automatic, Method -> "Queued"],
  13. "Insert outline level 7.", ActionDelay -> 0.35`]};
  14.  
  15. level7CellGroup = Cell[CellGroupData[{Cell[StyleData["Outline7"],
  16. CellMargins -> {{320, 10}, {7, 7}},
  17. ReturnCreatesNewCell -> True,
  18. StyleKeyMapping -> {"Backspace" -> "Outline6",
  19. KeyEvent["Tab", Modifiers -> {Shift}] -> "Outline6"},
  20. CellGroupingRules -> {"SectionGrouping", 110},
  21. DefaultNewCellStyle -> "Outline7",
  22. DefaultReturnCreatedCellStyle -> "Outline7",
  23. ParagraphIndent -> 0, CounterIncrements -> "Outline7",
  24. MenuSortingValue -> 1500,
  25. MenuCommandKey -> "7",
  26. FontFamily -> "Verdana",
  27. FontSize -> 10,
  28. CounterBoxOptions -> {CounterFunction :> (CharacterRange[
  29. "[GothicA]", "[GothicZ]"][[#1]] &)}],
  30. Cell[StyleData["Outline7", "Numbered"],
  31. CellDingbat -> StyleBox[RowBox[{CounterBox["Outline7"], "."}],
  32. FontFamily -> "Verdana", TextAlignment -> Right]],
  33. Cell[
  34. StyleData["Outline7", "PreviewNumbered",
  35. StyleDefinitions -> StyleData["Outline7", "Numbered"]]],
  36. Cell[StyleData["Outline7", "Bulleted"],
  37. CellDingbat -> "[FilledVerySmallSquare]"],
  38. Cell[
  39. StyleData["Outline7", "PreviewBulleted",
  40. StyleDefinitions -> StyleData["Outline7", "Bulleted"]]],
  41. Cell[StyleData["Outline7", "Presentation"],
  42. CellMargins -> {{350, 10}, {10, 10}}, FontSize -> 20]},
  43. Closed]];
  44.  
  45. newStylSht = (stylnbk /.
  46. HoldPattern[DockedCells -> {Cell[BoxData[StyleBox[
  47. GridBox[{lst : {StyleBox["Outline Level: ", FontWeight -> "Bold"],
  48. PatternSequence[TooltipBox[__], " | "] ..,
  49. TooltipBox[__]}}, gbopts__], sbopts__]], cellopts__]}] :>
  50. DockedCells ->
  51. {Cell[BoxData[StyleBox[GridBox[{Join[lst, insertToToolbar]}, gbopts],
  52. sbopts]], cellopts]} /.
  53. HoldPattern[CounterAssignments -> cas : {{_, 0} ..}] :>
  54. CounterAssignments -> Insert[cas, {"Outline7", 0}, -1] /.
  55. HoldPattern[DefaultReturnCreatedCellStyle-> "Outline6"] :>
  56. Sequence[DefaultNewCellStyle -> "Outline7",
  57. DefaultReturnCreatedCellStyle-> "Outline6",
  58. CounterAssignments -> {{"Outline7", 0}}] /.
  59. HoldPattern[StyleKeyMapping -> skm:{"Backspace" -> "Outline5",
  60. KeyEvent["Tab", Modifiers -> {Shift}] -> "Outline5"}] :>
  61. StyleKeyMapping -> Insert[skm, "Tab" -> "Outline7", 1] /.
  62. HoldPattern[Cell[CellGroupData[
  63. cgd:{Cell["Styles for Outline Documents", "Section"], ___}, opt___]]] :>
  64. Cell[CellGroupData[Insert[cgd, level7CellGroup, -1], opt]]);
  65.  
  66. flNm = ToFileName[{$InstallationDirectory, "SystemFiles", "FrontEnd",
  67. "StyleSheets", "Utility"}, "Outline7Levels.nb"];
  68. NotebookSave[newStylSht, flNm]
Add Comment
Please, Sign In to add comment