2

I am modifying several StyleSheets to adapt them to convenient use at school. Now I am working on the StyleSheet for Mathematics classes. I would like to make several types of default headings on the level of Subsections and Subsubsections. I would like to make them in such a way that upon opening such a Cell it opens already with a certain title. For example "Homework". In addition it would be nice, if it is possible to evaluate DateString[] there.

Any idea?

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96
  • 1
    Do you want DateString[] to be evaluated when the cell is created? Dynamically updated? Neither seems convenient to the way I imagine using the stylesheet to create documents, but what do you have in mind? – Michael E2 Oct 23 '19 at 17:15
  • 1
    Something like CellDingbat->"Section", CellMargins->{{120, Inherited}, {8, 18}}? – Michael E2 Oct 23 '19 at 17:21
  • @ Michael E2 I had in mind that as soon as one makes a cell with such a style one gets the text: "Homework 23.10.12". So the DateString[] I would like to be evaluated once as soon as the cell is first time created. Further, another cell appears with the text: "Exercise Nr." so that the student only needs to enter the number of the exercise. – Alexei Boulbitch Oct 23 '19 at 19:39
  • You can adapt this: 129021 to whatever fits your need, right? Also related: 189164 – Kuba Oct 24 '19 at 05:58
  • @Kuba Thank you. Most part of my aims I achieved with that. Now I would like also to develop a cell style which will evaluate DateString[] as soon as such a style is addressed from Menu. I tried this Cell[StyleData["DateString"], "Input", CellDingbat->BoxData[ToBoxes[DateString[]]], FontSize->16, MenuSortingValue->10000] and several other variations, but no of them worked. Could you think of something like that? – Alexei Boulbitch Oct 25 '19 at 14:22
  • @AlexeiBoulbitch how about CellDynamicExpression :> Refresh[SetOptions[EvaluationCell[], CellDingbat -> ...]; (*and drop CellDynamicExpression*),None] – Kuba Oct 25 '19 at 14:35
  • @Kuba Thank you. I made it as follows and it seems to work: Cell[StyleData["Klassenarbeit"], CellDynamicExpression:>SetOptions[ EvaluationCell[], CellDingbat ->TextData[{StyleBox[" Klassenarbeit ", FontColor -> RGBColor[0.7, 0, 0], FontSize -> 40], StyleBox[DateString[{"Day", ".", "Month", ".", "Year"}], FontSize -> 24, FontSlant->"Italic", FontColor -> RGBColor[0., 0, 0]]}]], ShowGroupOpener->True, TextAlignment->Left, MenuSortingValue->1480, FontFamily->"Helvetica", FontSize->30, FontWeight->"Plain", FontSlant->"Plain", Magnification->1.5] – Alexei Boulbitch Oct 25 '19 at 16:28

0 Answers0