0

I would like to customize the array environment in such a way that I can write arrays with dashed delimiters that are internal to the arrays as in the figure below.

enter image description here

Question. How do I place the vertical and horizontal delimiters on the inside of the arrays? Is it possible to have control over the customization of the delimiters? Like can I control the delimiters so that they are dashed or continuous or colored?

Thanks in advance.

My attempt. The best I got was using the code below.

    \begin{center}
    \left[\begin{array}{c|c|c}
    \underline{\displaystyle{A}_{\vspace{5mm}}} 
    & 
    \underline{\displaystyle{B}_{\vspace{5mm}}} 
    & 
    \underline{\displaystyle{E}_{\vspace{5mm}}} 
    \\ 
    \underline{\displaystyle{C}_{\vspace{5mm}}}
    & 
    \underline{\displaystyle{D}_{\vspace{5mm}}}
    & 
    \underline{\displaystyle{F}_{\vspace{5mm}}}
    \\
    \underline{\displaystyle{G}_{\vspace{5mm}}}
    &
    \underline{\displaystyle{H}_{\vspace{5mm}}}
    & 
    \underline{\displaystyle{L}_{\vspace{5mm}}}
    \end{array}\right]
    \end{center}

And the result was somewhat unsatisfactory as can be seen in the figure below.

enter image description here

4
  • 1
    Take a look at the arydshln package.
    – leandriis
    Commented May 22, 2020 at 16:37
  • 1
    Does this solve your problem? tex.stackexchange.com/a/20141
    – antshar
    Commented May 22, 2020 at 17:12
  • @antshar Yes+1. Answer my question. It helped a lot. But is there an alternative without using the "arydshln" package? Commented May 22, 2020 at 17:16
  • @MathOverview: With nicematrix you can do that with dotted lines. And you can use both nicematrix and arydshln. Commented May 22, 2020 at 17:22

1 Answer 1

2

As from suggestion of the creator F. Pantigny of nicematrix package, I add the differents output considering also the comments.

\documentclass[a4paper,12pt]{article}
\usepackage{amssymb}
\usepackage{nicematrix}
\usepackage{arydshln}

\begin{document}
\setlength{\extrarowheight}{1mm}
\renewcommand{\arraystretch}{1}
\[\left[\,\begin{NiceArray}{c:c:c}
A & B & C  \\
\hdashline
D & E & F \\
\hdashline
G & H & O
\end{NiceArray}\,\right]
\]

\[\left[\,\begin{NiceArray}{c:c}
A & B   \\
\hdashline
D & E  \\
\end{NiceArray}\,\right]
\]

\[\left[\,\begin{NiceArray}{c}
A  \\
\hdashline
D   \\
\end{NiceArray}\,\right]
\]


\[\left[\begin{NiceArray}{c:c}
A  & V\\
\end{NiceArray}\right]
\]

\end{document}

enter image description here

You must log in to answer this question.

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