# Gridbox alignment problem

I write my own stylesheet. I use GridBox and GridBoxOption to edit the environment of EquationNumbered, in which, I set

Cell[StyleData["EquationNumbered"],
TextAlignment->Center,
FontSize->14,
GridBoxOptions->{AllowScriptLevelChange->False,
GridBoxAlignment->{
"Columns" -> {{"\[AlignmentMarker]"}},
"Rows" -> {{"\[AlignmentMarker]"}}}}]


Now, when I choose the style of EquationNumbered, the multi-line formula will align to the alignmentmarker that I set.
But,when I do not set the alignmentmarker, they will aligned to the right instead of the center as usual. How can I fix this problem.

• Want to know the solution too. But I suspect it's just not possible... (Or maybe there is a undocumented usage to specify the priorities of alignments?) Nov 22, 2014 at 9:15

Extended comment.

1 You need to show the Grid/Matrix so we can see what you are trying to do.

2 If you want to align to the right you do not need to use alignment markers (hence point #1).

3 There is this example in the docs:

Grid[{{1.234, 12.34}, {123.4, 1234.}, {1234, 1.234}},Alignment -> "."]


where you would obviously replace "." with alignment marker

4 An alternative to programmatic generation of alignments is simply to create your grid/matrix and insert alignment markers Esc am Esc, then Format > Text Alignment > On Alignment Marker. e.g

Cell[TextData[Cell[BoxData[{
FormBox[
RowBox[{"x", "=", "\[AlignmentMarker]", "y"}], TraditionalForm], "\[IndentingNewLine]",
FormBox[
RowBox[{
RowBox[{"x", "+", "7"}], "=", "\[AlignmentMarker]",