Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like use rounded rectangles for my cell style, but I'm not sure if this is possible. Perhaps it can be faked with an image as a background for it?

share|improve this question
Framed has the option RoundingRadius. This is not for cell frames though, but it may lead the way to a solution. – Szabolcs Mar 1 '13 at 18:42
up vote 8 down vote accepted

I don't think this is possible. One can set the four sides of the cell frame to various different styles using the undocumented option CellFrameStyle which you have to prefix with the System` context to get it to work (syntax coloring won't recognize it as a valid option):

   StringTake[ExampleData[{"Text", "AliceInWonderland"}], {200, 1000}], 
   CellFrame -> True, 
   System`CellFrameStyle -> 
    { Directive[Red, Thickness[5] ], 
      Directive[Green, Thickness[10], Dashed ], 
      Directive[Blue, Thickness[5] , Dotted], 
      Directive[Gray, Thickness[5] , Dashing[{20, 3}]]
   CellMargins -> {{100, 50}, {5, 5}}]]

Mathematica graphics.

The fact that you can specify it as four separate frame parts make me believe rounded corners are not possible. With sides specified separately I don't think an option like RoundingRadius would work.

share|improve this answer
On my system (v9 Linux), the System context is not required, and Dashed and Dotted do not seem to work the same as your example (but Dashing does). CapForm or JoinForm might be useful for producing rounding but also do not work. – Xerxes Mar 1 '13 at 23:45
@xerxes interesting. On Windows, using it without context, doesn't do anything. Upon inspection of the cell code (ctrl shift E) I see an extra $CellContext tagged to CellFrameStyle. Tagging it with System prevents this. – Sjoerd C. de Vries Mar 2 '13 at 9:00

You might work around the limitations of CellFrame by framing the content. Framed allows for a RoundingRadius.

ExampleData[{"Text", "AliceInWonderland"}], {200, 1000}], "Text", 
CellMargins -> {{100, 50}, {5, 5}}], RoundingRadius -> 15, 
FrameStyle -> Red]]

enter image description here

share|improve this answer
Sorry, Szabolcs. I only noticed your comment after answering the question. Really. – DavidC Mar 1 '13 at 23:44
You notice the artefacts this yields in the text? – Sjoerd C. de Vries Mar 1 '13 at 23:49
Thanks. Placing Framed around the TextCell seems to take care of it. – DavidC Mar 2 '13 at 0:00
Much better. Though not really a cell frame as asked by the OP, I think this is the closest to what it would look like. – Sjoerd C. de Vries Mar 2 '13 at 8:56
Yes but this won't work in a style sheet :/ – M.R. Mar 4 '13 at 9:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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