17

I was googling the way of adding 3 dots between two equations, I found this question> (Vertical alignment of dots in equation)

What I want:

  • Three equations.
  • Between equation 2 and 3 I want 3 dots.

When I implemented their way into my equation, I got a really funny equation:

\begin{alignat}{1}
x_{0} = y + m_{0} \\
x_{1} = y + m_{1} \\
\vdotswithin{x_{1} = y + m_{1}}
x_{n} = y + m_{n}
\end{alignat}

the result:

enter image description here

questions:

  1. how do i make these dots above the third equation and in the center?

  2. why do I have to write the equation twice, once with
    \vdotswithin{equation} and once without it? is there another way?

  3. how do I only get equation numbers for the actual equations without the dots? because when i implement it the dots are numbered as an equation.

Edit 1: Replaying to @Thomas's answer this:

\begin{align*}
   x_{0} &= y + m_{0} \\
   x_{1} &= y + m_{1} \\
   &\vdots\\
   x_{n} &= y + m_{n}
\end{align*}

produces this:

enter image description here

the dots are still not aligned to the equal sign or at least the middle of the equation. How can i modify that?

2
  • See the modified answer.
    – Thomas
    Apr 23, 2016 at 11:53
  • 4
    You have to use &\vdotswithin{=}.
    – Manuel
    Apr 23, 2016 at 12:12

3 Answers 3

21

I think you can simplify a bit and use something like this (from the amsmath package):

\begin{align}
   x_{0} &= y + m_{0} \\
   x_{1} &= y + m_{1} \\
   &\;\;\vdots \notag \\
   x_{n} &= y + m_{n}
\end{align}

The notag command removes the equation numbering from the line with the vertical dots. I am sure there is a way of adding the exact amount of white space (equal to half the width of the equals sign) to center the dots under the =, but this does the job in a rather simple manner.

EDIT (with inspiration from Manuel's comment)

The mathtools package provides two versions of the vdotswithin command (notice the missing \\ in the short version).

\begin{align}
   x_{0} &= y + m_{0} \\
   &\shortvdotswithin{=}
   x_{1} &= y + m_{1} \\
   &\vdotswithin{=} \notag \\
   x_{n} &= y + m_{n}
\end{align}

Resulting in:

enter image description here

7

You don't have to write the equation twice: you have to write the relation symbol w.r.t. which the dots will be centred. Illustration with \vdotswithin and \shortvdotswithin:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{align}
  x_{0} & = y + m_{0} \\
  x_{1} & = y + m_{1} \\
        & \vdotswithin{ = }\notag \\
  x_{n} & = y + m_{n}
\end{align}

\begin{align}
  x_{0} & = y + m_{0} \\
  x_{1} & = y + m_{1} \\
        & \shortvdotswithin{ = }\notag \\[-3.5ex]
  x_{n} & = y + m_{n}
\end{align}

\end{document} 

enter image description here

5
  • I am sorry for the overlap, but I was editing my answer while you posted yours so I didn't notice. What is the reason for \\[-3.5ex] after the short version?
    – Thomas
    Apr 23, 2016 at 12:27
  • 1
    It's to get the vdots vertically centred between eqs (5) and (6)
    – Bernard
    Apr 23, 2016 at 12:31
  • @Thomas: It seems there's a detail I hadn't seen in the use of \shortvdotswithin… I've learnt something today :o)
    – Bernard
    Apr 23, 2016 at 12:34
  • It looks like it. Although I think including the linebreak (without adjusting space afterwards) would add to the consistency of the notation.
    – Thomas
    Apr 23, 2016 at 12:37
  • What I couldn't find is how to change the vertical spacing in \shortvdotswithin – a little too tight for my taste. It works with a system key=value, but when I write modifications in my preamble, the compiler complains…
    – Bernard
    Apr 23, 2016 at 12:53
-1

What about using an addiitonal column of &:

\begin{align*}
   x_{0} &=& y + m_{0} \\
   x_{1} &=& y + m_{1} \\
         &\vdots& \\
   x_{n} &=& y + m_{n}
\end{align*}
1
  • The question was already answered in 2016 with the correct use of ONE alignment symbol per line. Creating an extra column in the middle of an equation would add some serious strange white space. Jan 2, 2021 at 19:31

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.