TransWikia.com

Matrix with top just top indexes

TeX - LaTeX Asked by Zarathustra on September 28, 2020

I’m trying to write a matrix which has the indexes on top of the actual matrix, ie. something like:

enter image description here

This is similar to this question here, but I haven’t managed to avoid the indexes on the sides of the matrix – I just want them up top.

2 Answers

You can do that with nicematrix:

documentclass{article}
usepackage{nicematrix}

begin{document}

setcounter{MaxMatrixCols}{15}

$begin{bNiceMatrix}[first-row]
x & x^2 & x^3 & x^4 & x^5 & x^6 & x^7 & x^8 & x^9 & x^{10} 
r & -r  & 0     & 0    & 0     & 0     & 0      & 0      & 0    & 0    & ldots 
0 & r^2 & -2r^2 &      & 0     & 0     & 0      & 0      & 0    & 0    & ldots 
0 & r^3 & -3r^3 & 3r^3 & r^3   & 0     & 0      & 0      & 0    & 0    & ldots 
0 & 0   & 0     & r^4  & -4r^4 & 6r^4  & -4r^4  & r4     & 0    & 0    & ldots 
0 & 0   & 0     & 0    & r^5   & -5r^5 &  10r^5 & -10r^5 & 5r^5 & -r^5 & ldots 
vdots & vdots & vdots & vdots & vdots & vdots & vdots & vdots & vdots & vdots & ddots 
end{bNiceMatrix}$

end{document}

Ouput of the above code

Answered by F. Pantigny on September 28, 2020

Just omit the final entries on each row in the blockarray that otherwise serve to label the rows (but do not omit the & preceding them.

To do a slightly simpler example than yours (since you didn't provide any source code, I didn't want to laboriously type all the entries of your 11-column matrix:

documentclass[11pt, a4paper]{article}
usepackage{amsmath,blkarray, bigstrut}

begin{document}

 [
     begin{blockarray}{*{5}{>{scriptstyle}c}}
       x & x^{2}& x^{3} &  
        begin{block}{[cccc] >{scriptstyle}c}
         bigstrut[t]  r & -r & 0 & cdots &          
          0 & r^{2} & -2 r^{2} & cdots & 
          0 & 0 & r^{3} & cdots & 
          0 & 0 & 0 & cdots & 
          vdots & vdots & vdots &ddots
        end{block}
      end{blockarray}
 ]

 end{document} 

Block array

Answered by murray on September 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP