Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a document full of matrices, and many of them don't look very good, right now. Hunting for solutions, I found this post from two years ago.

I have the same problems mentioned there, and I'd also like to have better control over the amount of space between the outer-most columns and my delimiters (which are either brackets or lines). If it matters, my matrices are always either 3x3 or 4x4.

Has any progress been made in the last two years?

I would think that this would be a very common problem, and I'm amazed that there doesn't seem to be a package that addresses it.

Added

Two of the three problems I mentioned are well illustrated in the post cited above, so I don't see any point in repeating them here.

The third problem I mentioned is shown here:

matrix

I'd like to have more space before the first column and after the third column. The example above was produced with the following code

\documentclass[a4paper,10pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{fontspec}
\setmainfont{Latin Modern Roman}

\begin{document}

$$
\begin{bmatrix*}[r] 
  {1} & { 2}  & { \mathbf M}  \\
  {1} & {-3}  & { \mathbf M}  \\
  {1} & { 6}  & {-\mathbf M} 
\end{bmatrix*}
$$

\end{document}

I can fix the matrices one at a time, but that doesn't seem like the right solution. I'd like to have a new "matrix" command, but I don't have the expertise to create this myself, so I'm hoping that there is a package that provides one, now, after 2 years of progress.

Attempt at a Solution

Here is a neophyte's attempt at a solution, based on the one from Gonzalo Medina in the post cited above:

\newcommand\myfact{}
\newenvironment{Mybmatrix}[2][1.8]
  {\renewcommand\myfact{#2}\renewcommand{\arraystretch}{#1}\left[\;\begin{matrix}}
  {\\[-\myfact em]\mbox{}\end{matrix}\;\right]}

I don't understand much of it. Is this a good approach?

share|improve this question
2  
With the array package, define a Left and Right column as follows: \newcolumntype{L}{@{\hspace*{4\arraycolsep}}c} and \newcolumntype{R}{c@{\hspace*{4\arraycolsep}}}. This will give you 4 times the gap on either side of the matrix, between it and the delimiters you use. Then use \left(\begin{array}{L..R}...\end{array}\right). –  Werner May 2 '13 at 6:39
2  
I made a book about Linear Algebra, without changing anything regarding the typesetting of matrices. Can you please show an example of what doesn't satisfy you? –  egreg May 2 '13 at 7:34
    
@egreg -- the other post I cited has two obvious problems: fractions overlap each other and the delimiters are too short. –  bubba May 2 '13 at 7:50
4  
Why don't you show one of your problems? –  egreg May 2 '13 at 7:55
1  
@bubba One of the tasks of the "matrix" environments of amsmath is exactly to remove the bad space between the delimiters and the first and last column. –  egreg May 2 '13 at 10:50
show 2 more comments

closed as unclear what you're asking by Joseph Wright Aug 15 '13 at 19:02

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.