Matrix Labels

Hi, I was wondering if it was possible to label the columns and rows of a matrix in Math, exactly like the way shown in the following picture.

Thanks very much!

(The same request was posted in another forum: http://en.libreofficeforum.org/node/12094.

If you post a request/question in more than one forum, please always cross-link the posts. Edited by Lupp)

Seems possible,

Math documentation:

https://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Math_Guide

We have another image-attacher?

And another suggestion:

stack{" "#left none phantom stack{f#g#h#i#j} right (}
matrix{
a#b#c#d#e##
1#2#3#4#5##
6#7#8#9#10##
-110#0#0#0#0##
-1#-2#-3000#-4#-5##
-6#-7#-8#-9#-100}
stack{" "#left ) ~stack{f#g#h#i#j} right none}

I have put the horizontal label into the matrix, so that they align with different column widths. The “phantom” is needed to get the bracket scaled.

Edit:
Indeed, “matrix” and “stack” have different vertical spacing.
87348 – stack-like objects (matrix - binom - stack) should be vertically aligned the same way. So here a solution with label as matrix.
image description

@Regina : I had suggested a sulution(?) in the other forum (link above!). Therefore I also tested yours. It is promising, using a construct I did not know till today. However I find two flaws (LibO5.0.3 on Win8): (1) The vertical “label” column does not align correctly with respect to the rows of the matrix. (2) If i prefix a alignr to everything the numbers >=0 get right aligned as I intended. Negative numbers are misaligned 1 digit width to the left. Do you know the reason?

For the wrong alignment of negative numbers see 120304 – Bad alignment inside math matrices and https://bugs.documentfoundation.org/show_bug.cgi?id=47813