Re: Centering Text Cell
- To: mathgroup at smc.vnet.net
- Subject: [mg72345] Re: Centering Text Cell
- From: "David Reiss" <dbreiss at gmail.com>
- Date: Tue, 26 Dec 2006 07:18:59 -0500 (EST)
- References: <em8j2h$p71$1@smc.vnet.net>
The simplest thing would be to place the graphic and the caption one
aboe the other in a one-column, two-row GridBox.
here is an example:
pl=Plot[x^2, {x, -3, 3},DisplayFunction->Identity];
cell=Cell[BoxData[
GridBox[{{"Column I", "Column II"}, {"Row1", "Code1"},
{"Row2", "Code2"}}, ColumnAlignments -> {Right, Left}]
], "Text"];
Cell[BoxData[
GridBox[{{
Cell[GraphicsData["PostScript",DisplayString[pl]],"Text"]},
{cell}}]
],
"Text"
]//CellPrint
--David
Bruce Colletti wrote:
> Re Mathematica 5.2 under WinXP.
>
> In the code below, output cell #2 is the "caption" of output cell #1. How would I center the caption under the graphic, if it can be done at all?
>
> Tech support has crafted a clever solution that uses scaled coordinates and Epilog to create a single output cell.
>
> However, I wonder if this centering can be done while keeping the two output cells intact. If so, then "maintaining" the caption becomes easier.
>
> Thankx.
>
> Bruce
>
>
> Plot[x^2, {x, -3, 3}];
>
> CellPrint[Cell[BoxData[
> GridBox[{{"Column I", "Column II"}, {"Row1", "Code1"},
> {"Row2", "Code2"}}, ColumnAlignments -> {Right, Left}]
> ], "Text"]];