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.

I have a system of equations with an arbitrary number of equations (k). I'd like to use \vdots to compactly describe the system, like so:

\begin{align*}
  R(-1) &= \sum_{i=1}^m A(i)R(i-1) \\
  R(-2) &= \sum_{i=1}^m A(i)R(i-2) \\
        &\vdots                    \\
  R(-k) &= \sum_{i=1}^m A(i)R(i-k)
\end{align*}

LaTeX output of above code with only minimal.cls and amsmath.sty

I'd like the dots, however, to be centered with = or the entire equation. Is there an elegant way of centering a column or row with AMSMath? I'm currently using an unholy combination of whitespace operators (\; \, etc.) to get the job done.

share|improve this question

3 Answers 3

up vote 30 down vote accepted
\documentclass{article}
\usepackage{amsmath,calc}
\begin{document}

\begin{align*}
  R(-1) &= \sum_{i=1}^m A(i)R(i-1) \\
  R(-2) &= \sum_{i=1}^m A(i)R(i-2) \\
        &\mathrel{\makebox[\widthof{=}]{\vdots}} \\
  R(-k) &= \sum_{i=1}^m A(i)R(i-k)
\end{align*}

\end{document}
share|improve this answer
2  
You beat me to it … anyhow, in case there is a wish to avoid using the calc package, here is my version: \setbox0\hbox{=}\mathrel{\makebox[\wd0]{\hfil\vdots\hfil}}. –  Harald Hanche-Olsen Dec 23 '10 at 15:18
    
I like it! I had been looking at this answer, but I didn't like the need for all the temporary width definitions. \widthof is a great new tool for me. I'll leave the question open for a bit longer, but I think this is the answer. –  Matt B. Dec 23 '10 at 15:18
    
@Harald the \hfil are not needed –  Herbert Dec 23 '10 at 15:49
    
Thanks, Herbert! –  Matt B. Dec 23 '10 at 20:19
    
You're right; instead of \makebox[\wd0] I had \hbox to \wd0 and then I forgot to remove the \hfil after I changed it. –  Harald Hanche-Olsen Dec 23 '10 at 20:39

Consider the package mathtools, which provides several corrections for and additions to amsmath.

\usepackage{mathtools}

It also provides a comfortable solution for your problem. You can even choose between a normal (\vdotswithin) and a short (\shortvdotswithin) distance.

\begin{align*}
  a &= b \\
  & \vdotswithin{=} \\
  & = c \\
  \shortvdotswithin{=}
  & = d
\end{align*}

The result convinces.

Example showing vdotswithin and shortvdotswithin

More details can be found in the documentation of the package, section "Centered \vdots", where also the example above is taken from.

share|improve this answer

Here is another option (not very popular among TeXans):

\begin{eqnarray}
  R(-1) &=& \sum_{i=1}^m A(i)R(i-1) \\
  R(-2) &=& \sum_{i=1}^m A(i)R(i-2) \\
        &\vdots& \\
  R(-k) &=& \sum_{i=1}^m A(i)R(i-k)
\end{eqnarray}
share|improve this answer
2  
the spacing is lousy in an eqnarray environment. You can it improve wit \arraycolsep=1.4pt –  Herbert Dec 25 '10 at 9:30
    
Yes, I know... this is why I said it is not a popular option... –  user1999 Dec 25 '10 at 13:55

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.