6
\documentclass[12pt,letterpaper]{article}
\usepackage[margin=1.1in]{geometry}
\usepackage{amsmath}
\usepackage{mathdots}
\usepackage{amssymb}
\usepackage{fancyhdr}
\usepackage{pgfplots}
\usepackage{nicematrix}
\NiceMatrixOptions{transparent,nullify-dots}
\usepackage[utf8]{inputenc}
\pgfplotsset{compat=1.16}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\begin{document}
$\begin{bmatrix}
d_1 &  \ast&  \ast&  \ast&  \ast&  \ast\\ 
 c_1&  d_2&   \ast&   \ast&   \ast&   \ast\\
 0&  c_2&  d_3&   \ast&   \ast&   \ast\\
 0  &   0&   c_3&   d_4   &   \ast&    \ast\\
 0   &0   &0   &\ddots   &\ddots   &\ast\\  
 0&0&0&0&c_{n-1}&d_n
\end{bmatrix}$
\end{document}

enter image description here

  • please fix your example code so that it is a complete document that produces the image shown. – David Carlisle Nov 25 '20 at 18:12
  • Your dots is caused by use of the nicematrix package and set its option \NiceMatrixOptions{transparent,nullify-dots} in preamble. I suggest to insert this option in group` where is used nicematrix, where you like to have such format of dots. – Zarko Nov 25 '20 at 19:01
  • Not related: You don't need any longer \usepackage[utf8]{inputenc} with recent LaTeX versions. – F. Pantigny Nov 26 '20 at 6:13
10

(I'm the author of nicematrix).

I recommend to use the option transparent only when one has a whole document with many matrices with dotted lines and want to use quickly the dotted lines provided by nicematrix (without changing the code of the document for each matrix with dotted lines).

For new documents, I recommend to use {pmatrix} of amsmath and to use {pNiceMatrix} only when one of the features provided by nicematrix is needed.

The recent versions of nicematrix provides other features than the dotted lines and that's why I have written in the documentation that the key transparent is now obsolete (the name of that key is no longer meaningful with the recent versions of nicematrix). However, the keys renew-dots and renew-matrix are not obsolete and will still be available for the interested users...

  • 1
    Thank you for explanation (+1). Your package recently (a year or so) fast evolved, so it is difficult to follows to all novelties regardless to good documentation which become larger with any new package version :-). Thank you for this interesting and usable package! – Zarko Nov 25 '20 at 21:20
  • @Zarko ...is in continuous evolution but we also vote positively his answer :-) – Sebastiano Nov 25 '20 at 22:40
7

Let me extend my comment:

  • Cause of your problem is \NiceMatrixOptions{transparent,nullify-dots} which you put in preamble, so it influence on all matrices in document.
  • You should move it to where is needed so that it has effect only locally
  • As mentioned in nice @muzimuzhi Z answer option transparent is obsolete in the recent version of nicematrix package.

MWE, which demonstrate, how you can write your matrices is:

\documentclass[12pt,letterpaper]{article}
\usepackage[margin=1.1in]{geometry}
\usepackage{amsmath, amssymb}
\usepackage{mathdots}
%\usepackage{fancyhdr}
%\pagestyle{fancy}
%\renewcommand{\headrulewidth}{0pt}
%\renewcommand{\footrulewidth}{0pt}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{nicematrix}
%\NiceMatrixOptions{transparent,nullify-dots}


\begin{document}
Standard `bmatrix`, the final result is visible already after one compilation
\[
\begin{bmatrix}
d_1 &  \ast&  \ast&  \ast&  \ast&  \ast\\
 c_1&  d_2&   \ast&   \ast&   \ast&   \ast\\
 0&  c_2&  d_3&   \ast&   \ast&   \ast\\
 0  &   0&   c_3&   d_4   &   \ast&    \ast\\
 0   &0   &0   &\ddots   &\ddots   &\ast\\
 0&0&0&0&c_{n-1}&d_n
\end{bmatrix}
\]
Use of `bNiceMatrix`, the final result is visible already after two compilations
\[\NiceMatrixOptions{nullify-dots}
\begin{bNiceMatrix}
d_1 &  \ast&  \ast&  \ast&  \ast&  \ast\\
 c_1&  d_2&   \ast&   \ast&   \ast&   \ast\\
 0&  c_2&  d_3&   \ast&   \ast&   \ast\\
 0  &   0&   c_3&   d_4   &   \ast&    \ast\\
 0   &0   &0   &\Ddots   &\Ddots   &\ast\\
 0&0&0&0&c_{n-1}&d_n
\end{bNiceMatrix}
\]
\end{document}

enter image description here

4

What you get is exactly the effect of transparent and nullify-dots, two nicematrix options set by \NiceMatrixOptions{<options>}.

  • transparent is an obsolete option. It is the conjunction of options renew-dots and renew-matrix. See doc of nicemtrix, sec. 9.3.
    • renew-dots redefines dots commands like \ddots (used in nicematrix environments) to act like their nicematrix continuous variant like \Ddots.
    • renew-matrix redefines matrix environment, the base of every other matrix env with delimiters like pmatrix, to act like nicematrix env NiceMatrix.
    • The total effect is that using \ddots in pmatrix will get continuous dots (normally more than three), according to the space for dots.
  • nullify-dots sets both the height and width of continuous dots to zero, so that they will not enlarge the whole matrix. See doc of nicematrix, sec. 9.1.
    • This gives you only six dots per \ddots in your example, otherwise you get more.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.