3

Using the nicematrix package and the following code,

\begin{document}
\documentclass{article}
\usepackage{amsmath}[![enter image description here][1]][1]
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{nicematrix}
$\begin{bNiceMatrix}
1 & -\dfrac{1}{a} & -\dfrac{1}{b} & & \Cdots & -\dfrac{1}{c} \\
-\dfrac{1}{d} & 1 & -\dfrac{1}{e} & \Ddots & & \Vdots \\
-\dfrac{1}{f} & -\dfrac{1}{g} & 1 & \Ddots & & \\
& \Ddots & \Ddots & \Ddots & & -\dfrac{1}{h} \\
\Vdots & & & & & -1/n \\
-\dfrac{1}{i} & \Cdots & &   -\dfrac{1}{j} & -\dfrac{1}{k} & 1
\end{bNiceMatrix}$
\end{document}

I get the following image

enter image description here

The idea was to create long dotted lines between certain numbers, but the dotted lines keep going all over the place every time I try running the code. I'm not sure how to fix this. Any help would be appreciated.

1
  • The working example code you have posted is incomplete. The bNicematrix environment code should be inside begin{document} ... \end{document}.
    – Tanvir
    Commented Sep 13, 2020 at 21:23

1 Answer 1

2

Just rewriting the code you have posted in the correct way as an answer, instead of a comment.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{nicematrix}
\begin{document} % should start after all packages have been introduced
$\begin{bNiceMatrix}
1 & -\dfrac{1}{a} & -\dfrac{1}{b} & & \Cdots & -\dfrac{1}{c} \\
-\dfrac{1}{d} & 1 & -\dfrac{1}{e} & \Ddots & & \Vdots \\
-\dfrac{1}{f} & -\dfrac{1}{g} & 1 & \Ddots & & \\
& \Ddots & \Ddots & \Ddots & & -\dfrac{1}{h} \\
\Vdots & & & & & -1/n \\
-\dfrac{1}{i} & \Cdots & &   -\dfrac{1}{j} & -\dfrac{1}{k} & 1
\end{bNiceMatrix}$
\end{document}

Nicematrix-

You must log in to answer this question.

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