# conflict between kbordermatrix and arydshln

When I include arydshln, I get a conflict with kbordermatrix (from here):

\documentclass{article}
\usepackage{amsmath}
\usepackage{arydshln}
\usepackage{kbordermatrix}

\begin{document}

\begin{align}
\kbordermatrix{ &1 & 2 & 3\\
a&b & c & d}
\end{align}

\end{document}


\adl@@cr ...tempdima \xdef \adl@rowsL {\adl@rowsL
l.11 \end{align}


How can I use both packages without conflicts?

In case you don't need to use dashed lines inside a kbordermatrix, you can obtain the same result with the blockarray environment – in a less simple way (but you may define new commands/ environments), and it is compatible with arydshln as long as you don't use inside blockarray.

So I propose this code as a work-around:

\documentclass{article}
\usepackage{amsmath}
\usepackage{kbordermatrix}
\usepackage{array, blkarray} %

\usepackage{arydshln}

\newcolumntype{}{>{\global\let\currentrowstyle\relax}} \newcolumntype{^}{>{\currentrowstyle}} \newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}% #1\ignorespaces } \begin{document} \begin{align} \begin{blockarray}{*{3}{>{\scriptstyle}c}} 1 & 2 & 3\\ \begin{block}{\Left{ \scriptstyle a \enspace }{[\enspace}ccc\Right{. \enspace]}{}} b & c & d\\ \end{block} \end{blockarray} \end{align} \begin{align} \begin{array}{c*{3}{^c}}
\rowstyle{\scriptstyle} & 1 & 2 & 3\\
\hdashline
\scriptstyle a & b & c & d
\end{array}
\end{align}

\end{document}


• how can I use blockarray as a kbordermatrix substitute if I want to have multiple lines, e.g. a | b c d followed by e | f g h in the next line – m.s. Sep 7 '16 at 9:47

There are problems using arydshln and \kbordermatrix. Moreover you need to use the \kbordermatrix in the equation (According to the relevant document from Caltech). Having said that, it does not deny the conflict among these packages. you can try easybmat package instead of arydshln in some cases.

• I can't compile this code either. – Bernard Sep 5 '16 at 12:30