# Text formatting with different wrappers

Formatting text in Mathematica should be a punishment for serious crimes.

I've face another frustrating feature, and I don't know how to get rid of it.

tekst = StringJoin @@ Array["tekst " &, 15];

Composition[
Grid[{{#, Graphics[Inset@#]}}, Frame -> All] &,
Panel[#, ImageSize -> {150, 100}] &,
Style[#, LineIndent -> 0] &
][tekst]


Those texts should look the same imo. The only difference is that the one in Graphics is not formatted as it should be.

Boxes look well and I don't know what causes that:

...
PanelBox[
StyleBox["\<\"tekst tekst ... tekst \"\>", StripOnInput->False, LineIndent->0],
ImageSize->{150, 100}],
GraphicsBox[InsetBox[
PanelBox[
StyleBox["\<\"tekst ... tekst \"\>", StripOnInput->False, LineIndent->0],
...


I was trying to set FormatType for Insetor BaseStyle for Graphics or ParagraphIndent -> 0. But with no avail :/.

• For me they look the same, but a bit uglier than yours. v8.0.4 linux – ssch Oct 25 '13 at 13:42
• Try adding TextAlignment -> Left to the Style. I think the default for graphics is to centre text. – Simon Woods Oct 25 '13 at 13:54
• @SimonWoods I don't know how I've missed that. I suppose I was shocked and in rage of trying all those options on all levels I forgot it somehow :) Thanks – Kuba Oct 26 '13 at 7:05
• It's easy to miss I think, because the text is centre aligned within itself, but the text block itself is not centred in the panel. It makes it look like an indent. – Simon Woods Oct 26 '13 at 8:48

Center is the default alignment for text in Graphics, so
Composition[