Discussion:
{bmatrix} and arrays
(too old to reply)
Kwaj
2004-01-27 01:30:24 UTC
Permalink
I am trying to build a set of four, (4*3) matrices, which are going to be
placed next to each other in my document. I am currently using the {bmatrix}
command but I find in a 2 column document, a set of 4 matrices ends up
taking up the entire column width. This is mainly due to there being large
gaps in between the columns in each matrix.

I am looking at a similarly formatted document in which the individuals
matrices are much smaller, such that six (4*3) matrices can be placed in a
single column of a two column document.

any ideas on how to fix this?

- Kwaj
Christian Ludwig
2004-01-27 17:01:44 UTC
Permalink
Hello,
Post by Kwaj
I am trying to build a set of four, (4*3) matrices, which are going to be
placed next to each other in my document. I am currently using the {bmatrix}
command but I find in a 2 column document, a set of 4 matrices ends up
taking up the entire column width. This is mainly due to there being large
gaps in between the columns in each matrix.
I am looking at a similarly formatted document in which the individuals
matrices are much smaller, such that six (4*3) matrices can be placed in a
single column of a two column document.
Looking for a new document? Or for a possiblility to get the matrices
smaller?

For the latter case: try \arraycolsep. Here a example with really litte
space (0pt) between the columns:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\arraycolsep0pt \begin{bmatrix}
0&1\cr
2&3\cr
\end{bmatrix}
\]

\end{document}


Bye
C. Ludwig
Enrico Gregorio
2004-01-28 09:27:51 UTC
Permalink
Post by Christian Ludwig
Hello,
Post by Kwaj
I am trying to build a set of four, (4*3) matrices, which are going to be
placed next to each other in my document. I am currently using the {bmatrix}
command but I find in a 2 column document, a set of 4 matrices ends up
taking up the entire column width. This is mainly due to there being large
gaps in between the columns in each matrix.
I am looking at a similarly formatted document in which the individuals
matrices are much smaller, such that six (4*3) matrices can be placed in a
single column of a two column document.
Looking for a new document? Or for a possiblility to get the matrices
smaller?
For the latter case: try \arraycolsep. Here a example with really litte
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\arraycolsep0pt \begin{bmatrix}
0&1\cr
2&3\cr
\end{bmatrix}
\]
\end{document}
I don't doubt that the construction you proposed is working.
However it is not using LaTeX syntax; and, when someone who is not
expert in LaTeX starts using \cr, every bad thing can happen.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\setlength{\arraycolsep}{0pt}
\begin{bmatrix}
0&1\\
2&3
\end{bmatrix}
\]

\end{document}

Ciao
Enrico
Christian Ludwig
2004-01-28 11:33:08 UTC
Permalink
Hello,
Post by Enrico Gregorio
Post by Christian Ludwig
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\arraycolsep0pt \begin{bmatrix}
0&1\cr
2&3\cr
\end{bmatrix}
\]
\end{document}
I don't doubt that the construction you proposed is working.
However it is not using LaTeX syntax; and, when someone who is not
expert in LaTeX starts using \cr, every bad thing can happen.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\setlength{\arraycolsep}{0pt}
\begin{bmatrix}
0&1\\
2&3
\end{bmatrix}
\]
\end{document}
Thank you for your remark. You are absolutely right. Sorry for not using
LaTeX conventions/syntax. I'll try to improve.


Just for info: Using \\ can give you some effects you don't like.

1. example: in the above case \\ expands to ${}${}\cr. Great!? And so
you get an extra \mathon \hbox(0.0+0.0)x0.0 \mathoff in your column. Of
course, because it has width 0pt you can't see it, but it's there.

2. example: Some days ago in de.comp.text.tex we had the question, why
using \\[10pt] inhibits hyphenation of the last word in the last column
in a tabular.
(Because an \vrule with width 0pt is inserted at the end of the last
word; using \cr\noalign{\vskip10pt} solved the problem in this case.)


Bye
C. Ludwig
Enrico Gregorio
2004-01-28 12:45:31 UTC
Permalink
Post by Christian Ludwig
[SNIP]
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\setlength{\arraycolsep}{0pt}
\begin{bmatrix}
0&1\\
2&3
\end{bmatrix}
\]
\end{document}
Thank you for your remark. You are absolutely right. Sorry for not using
LaTeX conventions/syntax. I'll try to improve.
Just for info: Using \\ can give you some effects you don't like.
1. example: in the above case \\ expands to ${}${}\cr. Great!? And so
you get an extra \mathon \hbox(0.0+0.0)x0.0 \mathoff in your column. Of
course, because it has width 0pt you can't see it, but it's there.
2. example: Some days ago in de.comp.text.tex we had the question, why
using \\[10pt] inhibits hyphenation of the last word in the last column
in a tabular.
(Because an \vrule with width 0pt is inserted at the end of the last
word; using \cr\noalign{\vskip10pt} solved the problem in this case.)
Those are `features', I guess ;-)

The definition of \\ inside an array has to cope with the
possibility of having * or [<dimen>] after it, with all the
problems concerning the balance of braces (\ifnum 0=`{\fi...).

Lamport's solution is not the best, it seems. Maybe LaTeX gurus
can offer a different point of view on the subject.

Anyway, it is best not to burden novices with such subtleties;
I think you'll agree on this.

Ciao
Enrico
Lars
2004-01-28 12:53:06 UTC
Permalink
Post by Christian Ludwig
2. example: Some days ago in de.comp.text.tex we had the question, why
using \\[10pt] inhibits hyphenation of the last word in the last
column in a tabular.
(Because an \vrule with width 0pt is inserted at the end of the last
word; using \cr\noalign{\vskip10pt} solved the problem in this case.)
Perhaps using \tabularnewline would be the proper thing (or was that
only with booktab?).

L.

Loading...