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.

How to set the column width in the align environment. I've got a align environment to demonstrate how to do division by hand so the columns always contain only one number, but the columns are much wider than this.

Following an example only showing the ugly result because of to wide columns:

\begin{align}
    &1&2&3&4&4\\
    & & & &2&4\\
\end{align}
share|improve this question
    
Not to sway you from what you're after, but why not just typeset this in an array? –  Werner Oct 9 '11 at 18:07
    
Oh that's a good hint. I did this now. But still I would like narrower columns. How to achieve this for array? –  Sebastian Oct 9 '11 at 18:12
add comment

2 Answers 2

up vote 4 down vote accepted

If the only reason for using align is to have elements aligned across columns, then an array environment would be an easier way to manage your situation. The column specification when using an array is straight-forward, and allows you to modify the width between columns very easily. Include the array package that provides the column separator specification @{} (as well as a host of other functionality). Here's an example:

\documentclass{article}
\usepackage{array}% http://ctan.org/pkg/array
\begin{document}
 Regular array with centered columns:
\[\begin{array}{ccccc}
    1&2&3&4&4\\
     & & &2&4
\end{array}\]

 Varied spacing between columns:
\[\begin{array}{c@{\hspace{2em}}c@{\hspace{2pt}}c@{\hspace{2ex}}c@{\hspace{2bp}}c}
    1&2&3&4&4\\
     & & &2&4
\end{array}\]

Varied column alignment:
\[\begin{array}{ccclr}
    111&222&333&444&444\\
       &   &   &  2&4
\end{array}\]
\end{document}

enter image description here

If you want to remove the intercolumn spacing completely, use @{}.

share|improve this answer
add comment

Increase the value to whatever you like:

\documentclass{article}
\begin{document}

$\arraycolsep=1.5pt%
\begin{array}{*6c}
    &1&2&3&4&4\\
    & & & &2&4\\
\end{array}$

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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