8
$\begingroup$

Bug introduced in V10.4 or earlier and persists through V11.3


SetOptions[
  EvaluationNotebook[]
, DockedCells -> Flatten @ {
    Cell[
      BoxData @ ToBoxes[Framed[InputForm@#, Background -> White]]
    , CellFrameMargins -> 15
    , CellMargins -> {{0, 0}, {0, 0}}
    , Background -> #
    ] & /@ {
      Inherited, Red, GrayLevel[1.], None, GrayLevel[.99], Blue
    }}
]

Apparently you can not have White Background for a DockedCells.

And if you do not obey they will take your margins, too!

enter image description here

Any reasonable explanation?

Notice the None case is documented:

If Background->None is set, then the margins are only applied if a CellFrame is present. If the cell frame is not drawn on all sides, then the margin will only be applied to the sides with a frame setting.

V11.2 Win7

[CASE:3975061] was created

$\endgroup$
  • 1
    $\begingroup$ Not the same for me (OSX, mma 11.2.0) : background is white for GrayLevel[1.] and None. Why Inherited gives gray ? $\endgroup$ – SquareOne Nov 23 '17 at 8:05
  • $\begingroup$ @SquareOne Inherited inherits from "DockedCell" style even if it is not present explicitly in a docked cell, not really documented :) $\endgroup$ – Kuba Nov 23 '17 at 8:10
4
$\begingroup$

[...] It does appear as though DockedCells cannot have White as their Background specification. I have filed a report with our developers regarding this incorrect limitation so that they may investigate and look to address the issue in a future release. [...]

- WRI Support

The workaround is to use 'almost' white:

SetOptions[EvaluationNotebook[]
, DockedCells -> Cell[
    BoxData @ ToBoxes[Framed[InputForm@GrayLevel[.999]]]
  , CellFrameMargins -> 15
  , CellMargins -> {{0, 0}, {0, 0}}
  , Background -> GrayLevel[.999]
  ]
]
$\endgroup$

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.