5

I'm trying to put vertical dots into a matrix, and I can only get it to align with one of the elements - as shown in:

    $$ \begin{pmatrix} 1 & -1 & 0 & 0 & \hdots & 0\\
    0 & 1 & -1 & 0 & \hdots & 0\\
    &  &  & \vdots &          \\
    0 & \hdots & 1 & -1 & 0 & 0
    \end{pmatrix} 
    $$

I was wondering if there was a way to centering the dots? I reviewed "Centering \vdots in a sparse matrix with an even number of rows" but unfortunately couldn't implement the solution.

Any help would be much appreciated.

4
  • 1
    Whare would you like to have them? Unrelated: don't use $$ … $$ for displayed equations: it is plain TeX syntax and can lead to bad vertical spacing.
    – Bernard
    Apr 23, 2017 at 22:27
  • Hi Bernard! Ideally, I would have them in the middle of the third line - is there a way to do this without introducing more terms to the matrix? Thanks for the tip. Apr 23, 2017 at 22:31
  • You mean\vdots?
    – Bernard
    Apr 23, 2017 at 22:39
  • That's right, I don't have a strong preference, it's just that's the syntax I have seen. Apr 23, 2017 at 22:43

1 Answer 1

7

Like this?

enter image description here

\documentclass[margin=3mm,preview]{standalone}
\usepackage{amsmath, amsfonts, amssymb}

\begin{document}
\[ 
    \begin{pmatrix} 
1 & -1      &  0 & 0    & \dotsm & 0\\
0 &  1      & -1 & 0    & \dotsm & 0\\
\multicolumn{6}{c}{$\vdots$}     \\
0 & \dotsm  &  1 & -1   & 0      & 0
    \end{pmatrix} 
\]
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .