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 need a command as \hdotsfor and use it in align environment.

\begin{align*}
X&=a_{11} + a_{12} + \cdots + a_{1n}\\
&\qquad{}+ a_{21} + a_{22} + \cdots + a_{2n}\\
&\text{\multido{}{33}{$\cdot$}}\\
&\qquad{}+ a_{m1} + a_{m2} + \cdots + a_{mn}
\end{align*}

The spacing between dot is not correct. While

\begin{align*}
X&=a_{11} + a_{12} + \cdots + a_{1n}\\
&\qquad{}+ a_{21} + a_{22} + \cdots + a_{2n}\\
&\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\cdot\\
&\qquad{}+ a_{m1} + a_{m2} + \cdots + a_{mn}
\end{align*}

is correct. So I think may be the math environment take a bad effect.

share|improve this question
    
Welcome to tex.sx! It's not necessary to begin your questions with a greeting. –  lockstep Apr 12 '11 at 5:34
add comment

3 Answers

\begin{align*}
X &= a_{11} + a_{12} + \cdots + a_{1n}\\
  & \qquad{}+ a_{21} + a_{22} + \cdots + a_{2n}\\
  & \makebox[5cm]{\dotfill}\\
  & \qquad{}+ a_{m1} + a_{m2} + \cdots + a_{mn}
\end{align*}
share|improve this answer
add comment

Try this:

\begin{align*}
\MoveEqLeft 
X=a_{11} + a_{12} + \cdots + a_{1n}\\
&+ a_{21} + a_{22} + \cdots + a_{2n}\\
&\text{\multido{}{23}{$\cdot\,$}}\\
&+ a_{m1} + a_{m2} + \cdots + a_{mn}
\end{align*}
share|improve this answer
add comment

Well, \multido works in math mode, so removing \text and the dollars from your example gives the correct spacing, except for the last dot. This is fixed by adding an empty math atom at the end (with {}). Complete example:

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

\begin{align*}
X&=a_{11} + a_{12} + \cdots + a_{1n}\\
&\qquad{}+ a_{21} + a_{22} + \cdots + a_{2n}\\
&\multido{}{33}{\cdot} {}\\
&\qquad{}+ a_{m1} + a_{m2} + \cdots + a_{mn}
\end{align*}

\end{document}

I would say, though that using \vdots in this case is probably a better idea.

share|improve this answer
add comment

Your Answer

 
discard

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