COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### 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

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

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

2 Replies
212 Views

Similiar Articles:

7/24/2012 12:05:51 AM