3

I am wondering about the following: suppose we want to display an array of numbers (or other math expressions), where each column (or row) satisfies some particular rule. So we write down the first two or three items of the first two columns for instance, then we add dots and then, before displaying the final column, we add a generic rth column which exhibits the dependency of the numbers in column r on the variable r. Then some more dots and then the final column. An example of this would be arranging the first mn positive integers in an array of m columns with n integers per column.

I can do this as follows:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[
\begin{array}{cccccc}
1             & 2           & \cdots    & r             & \cdots & m        \\
m + 1         & m + 2       & \cdots    & m + r         & \cdots & 2 m      \\
2 m + 1       & 2 m + 2     & \cdots    & 2 m + r       & \cdots & 3 m      \\
\vdots        & \vdots      & \cdots    & \vdots        & \ddots & \vdots   \\
(n-1) m + 1   & (n-1) m + 2 & \cdots    & (n-1) m + r   & \cdots & n m
\end{array}
\]
\end{document}

enter image description here

What I am wondering about is whether this is the "best" way to do what I want. Is there anything better?

1 Answer 1

1

I find the right-alignment, achievable with aligned, to be preferable. But of course, it is all a matter of taste.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[
\begin{aligned}
&1             & &2           && \cdots    & &r             && \cdots & m        \\
m +{}& 1         & m +{}& 2       && \cdots    & m +{}& r         && \cdots & 2 m      \\
2 m +{}& 1       & 2 m +{}& 2     && \cdots    & 2 m +{}& r       && \cdots & 3 m      \\
\vdots       & & \vdots      & &&\cdots    && \vdots        && \ddots & \vdots   \\
(n-1) m +{}& 1   & (n-1) m +{}& 2 && \cdots    & (n-1) m +{}& r   & &\cdots & n m
\end{aligned}
\]
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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