2

I am having some problems with arydshln and multicolumn. The following document:

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

\begin{document}
\[
        \begin{pmatrix}
        \multicolumn{1}{|c|}{1}  & \multicolumn{1}{|c|}{2}   & \multicolumn{1}{|c|}{3} & \multicolumn{1}{|c|}{4}\\[5ex] \cline{1-4}
        \end{pmatrix}
\]
\end{document}

generates this output:

enter image description here

with the vertical lines too short. If I remove the \usepackage{arydshln} line, the output is fine:

enter image description here

So arydshln doesn't seem to work well with multicolumn and the [5ex] height spec, it seems.

The same happens if I use multicolumn with {:c:} for alignment (which is actually what I wanted, and won't work):

\multicolumn{1}{:c:}{1}  & \multicolumn{1}{:c:}{2}   & \multicolumn{1}{:c:}{3} & \multicolumn{1}{:c:}{4}\\[5ex] \cdashline{1-4}

So is there a way to get the second result? Am I using the packages the wrong way?

Thank you!

2

In my point of view it's better to provide a real tabular environment inside of the pmatrix environment -- it works out of the box then!

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

\begin{document}
\[
\begin{pmatrix}
  \begin{tabular}{:*{4}{c:}}
    1 & 2 & 3 & 4 \tabularnewline
    &   &   &   \tabularnewline[4ex]
    \cdashline{1-4} % or \hdashline
  \end{tabular}
\end{pmatrix}
\]
\end{document}

enter image description here

| improve this answer | |
1

It's not really clear what your aim is, but you should use a regular array environment:

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

\begin{document}
\[
\left(\,
\begin{array}{:*{4}{c:}}
1 & 2 & 3 & 4 \\[5ex]
&   &   &   \\
\cdashline{1-4}
\end{array}
\,\right)
\]
\end{document}

enter image description here

| improve this answer | |

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.