TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using \hdashline from the arydshln package to draw a horizontal line inside a pmatrix:

How can I reduce the width of this line to prevent it from touching the outer parentheses?

share|improve this question
up vote 4 down vote accepted

One way to do this is to use an array environment and make use of the @{} intercolumn specifiers to put in some negative space. Here is one piece of example code.




      \hdashline 1


Sample output

share|improve this answer
You get the same result without all the \mkern commands and with \begin{array}{@{}c@{}} for the outer array. – egreg Sep 5 '12 at 17:44
Thanks to both of you! Are there any disadvantages of using array instead of pmatrix? Mostly I read that amsmath is recommended for anything concerning mathematics... – ph4nt0m Sep 5 '12 at 19:00
@ph4nt0m: In this instance, Andrew inserted some horizontal padding between the matrix and the parentheses, so using array is necessary; it requires a distinct placement of the parentheses. \pmatrix inserts the parentheses automatically, removing an "hook" into the location between the two constructs. – Werner Sep 6 '12 at 0:30
@Werner I understand that it is necessary to use array instead of pmatrix here. But when/why should I use ´pmatrix´ at all then? Is the fact that pmatrix already includes the parantheses really the only difference or are there any further advantages of the amsmath environments? – ph4nt0m Sep 6 '12 at 8:06
@ph4nt0m arydshln is desinged to work with array and tabular environments with the specific intent of making dashed rules that extend to out to the edges, and with various ways to tweak this. For mathematics pmatrix is the first choice, but (even with the mathtools enhancement) it does not have good facilities for dealing block matrices containing dividing lines. – Andrew Swann Sep 6 '12 at 21:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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