3

I want to write dots between two lines of a matrix. How can I do this?

I need this output:

enter image description here

with a single line of dots in the fifth column.

1
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – BambOo
    Oct 9, 2018 at 21:10

4 Answers 4

3

Nest a matrix in the pmatrix:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\begin{pmatrix}
\begin{matrix}
1 & 2 &  3  &  4 \\
1 & n & n-1 & n-2
\end{matrix}
& \cdots
\end{pmatrix}
\]

\end{document}

enter image description here

3

You can do that with a simple \multirow:

\documentclass{book}
\usepackage{amsmath, multirow}

\begin{document}

\[ \begin{pmatrix}
  1 & 2 & 3 & 4 & \multirow{1.5}{*}{$\!{\dots}$} \\
  1 & n & n-1 & n-2 
  \end{pmatrix}
\]

\end{document} 

enter image description here

2

Not necessarily the best approach, because it requires a \vcenter or, alternately, a \raisebox, but it is a different way to look at it.

\documentclass{article}
\usepackage{tabstackengine}
\setstacktabbedgap{2ex}
\begin{document}
\[
\def\stacktype{L}
\setstackgap{L}{1.2\normalbaselineskip}
\left(\vcenter{\hbox{\Matrixstack{
\stackanchor{1}{1}&
\stackanchor{2}{n}&
\stackanchor{3}{n-1}&
\stackanchor{4}{n-2}&
\dots
}}}\right)
\]
\[
\setstackgap{L}{1.2\normalbaselineskip}
\parenMatrixstack{1 & 2 & 3& 4& \\
  1 & n & n-1 & n-2 & \raisebox{.66\dimexpr\Lstackgap}{\dots}}
\]
\end{document}

enter image description here

0

With {pNiceMatrix} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

$\begin{pNiceMatrix}[right-margin=2em]
1 & 2 & 3 & 4 & \\
\cdottedline{5}
1 & n & n-1 & n-2 
\end{pNiceMatrix}$

\end{document}

Output of the above code

You must log in to answer this question.

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