equal column width matrix?

  • Follow


My supervisor would like his matrices to have equal column
width.   That means that a 0 entry would be centred in 
enough blank space to make the column width as wide as
the widest entry in the matrix.   This can probably be
hacked by measuring the widest entry and having the
other entries centred in a hbox that wide.  But is there
a more elegant and automatic way to do this?

David
0
Reply David 2/3/2011 8:29:35 PM

In article <dalton-B09DCC.16593403022011@news.eternal-september.org>,
 David Dalton <dalton@nfld.com> wrote:

> My supervisor would like his matrices to have equal column
> width.   That means that a 0 entry would be centred in 
> enough blank space to make the column width as wide as
> the widest entry in the matrix.   This can probably be
> hacked by measuring the widest entry and having the
> other entries centred in a hbox that wide.  But is there
> a more elegant and automatic way to do this?

I forgot to mention that we are using the array
environment in LaTeX.

David
0
Reply David 2/3/2011 11:05:56 PM


Le 04/02/2011 00:05, David Dalton a �crit :
> In article<dalton-B09DCC.16593403022011@news.eternal-september.org>,
>   David Dalton<dalton@nfld.com>  wrote:
>
>> My supervisor would like his matrices to have equal column
>> width.   That means that a 0 entry would be centred in
>> enough blank space to make the column width as wide as
>> the widest entry in the matrix.   This can probably be
>> hacked by measuring the widest entry and having the
>> other entries centred in a hbox that wide.  But is there
>> a more elegant and automatic way to do this?
>
> I forgot to mention that we are using the array
> environment in LaTeX.
>
> David

You can try the tabu package as in:

\documentclass{article}
\usepackage[delarray]{tabu}

\begin{document}\makeatletter
{

$\begin{tabu}spread 1in|{*4{X[$c]}}|
     \alpha & \beta & \gamma & \delta \\
     \sum_i \frac{a_i}{x_i} & 0 & \cdot & \cdot \\
\end{tabu}$
}

\end{document}\endinput


But it still under development...

It's not possible to give standard l, c, r columns a specific width,
instead, embed your math content into a paragraph column

	>{$}m{width}<{$}

This is what tabu does, measuring the widths to make them
equal: "X[$c]" replaces
	">{\centering\arraybackslash}}>{$}p{some dimen}<{$}"

....
0
Reply GL 2/3/2011 11:33:37 PM

2 Replies
212 Views

(page loaded in 0.031 seconds)

Similiar Articles:










7/24/2012 12:05:51 AM


Reply: