2
$\begingroup$

I've run into a problem with a private stylesheet that I'm struggling to understand and resolve. The issue is that my notebook does not appear to always respect the values for CellMargins that are specified in my style definition for numbered Sections, numbered Subsections, numbered Subsubsections, etc...

To help illustrate the issue, I've prepared two notebooks named StylesheetProblem01.nb and StylesheetProblem02.nb which can be accessed from https://geoconsultlimited-my.sharepoint.com/:u:/g/personal/ian_geoconsult_ltd/EeQ1a3zqG15Gom2Fr9k6-XoB8hfdG2DGAk0whhGYesHYlA?e=Namxc2.

The notebook named StylesheetProblem01.nb shows how I intend my numbered section and subsection headings to appear. In this notebook the numbers of the subsection heading are aligned with the text of the preceding Section Heading (such that the subsection numbers are indented relative to the section numbers). For this notebook, my private stylesheet definitions work as intended (see screenshot below).

enter image description here

However, when I introduce private style definitions for the standard (un-numbered) Section, Subsection, etc. styles, as is done in the notebook named StylesheetProblem02.nb, the specified left margin of my numbered Subsection style is no longer respected by the notebook (see screenshot below).

enter image description here

What appears to happen is that the left margin retains the value of the un-numbered Section style. Manually changing the value of the cell's left margin using the Options Inspector rectifies the problem. But that's obviously not a practicable fix.

I suspect the issue may be something to do with option inheritance, but am not sure. I also note that the cells in the private stylesheet of my notebook "StylesheetProblem02.nb" appear to have been randomly grouped per the following screenshot.

enter image description here

Again, I'm not sure why this happens or whether it's a factor in the behaviour I'm seeing.

I've hit a wall trying to fix the problem so any suggestions would be much appreciated.

Thanks in anticipation,

Ian

$\endgroup$
2
$\begingroup$

Your syntax is off. You need

StyleData[
  "SubsectionNumbered","Working", StyleDefinitions -> StyleData["Subsection"]
]

not

StyleData[
  "SubsectionNumbered", StyleDefinitions -> StyleData["Subsection"], "Working"
]

which made "Working" being ignored and specific styles for Subsection + Working took precedence.

$\endgroup$
  • $\begingroup$ Thanks. That's fixed the problem I was having. Much appreciated. $\endgroup$ – Ian Mar 22 '19 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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