# Adjust spacing between a section title and the first contained cell

In my day-to-day work with Mathematica I use a stylesheet I have derived from Mathematica's default stylesheet. One modification I would like to make to my stylesheet is to reduce the spacing between a section title and the first cell inside the section. This is not controlled by the CellMargins option. Is there another notebook option that can be set to reduce this gap?

-
The spacing is controlled by the cell margin --Try this: CellMargins->{{27, Inherited}, {0, 34}}. What makes you say that it isn't? – Mike Honeychurch Oct 12 '12 at 2:09
bear in mind that the total spacing between a section cell and the next cell is the sum of the bottom margin for the section cell and the top margin for the subsequent cell. – Mike Honeychurch Oct 12 '12 at 2:12
@MikeHoneychurch -- it's a bit embarrassing, but I reached my conclusion that it was not controlled by CellMargins because I thought the margins list went {{left,right},{top,bottom}} and not {{left,right},{bottom, top}}. I was changing the wrong list element and thus not seeing the result I expected. – m_goldberg Oct 12 '12 at 6:54
we've all made mistakes like that. I've made worse. Just bear in mind though that for a consistent spacing you will need to have the same cell type (e.g. subsection) following your section cell because most cells types are configured by default to have different top margins. (and therefore the spacing between section->input will be different from section->text etc.) – Mike Honeychurch Oct 12 '12 at 8:32
This is a good question though, with a useful answer. Do you want to add it as an answer rather than a comment Mike? – Andrew Moylan Oct 13 '12 at 3:22

CellMargins->{{27, Inherited}, {0, 34}}