3

I want my vdots to fall under the expressions and not at the end as its now.

enter image description here

I found solutions online for equations by using &=, but this is not applicable for me because I don't use the equal sign. My code is

\begin{equation*}
\begin{aligned}
(U_1^{(1)},U_2^{(1)}, \dots U_k^{(1)}) \\
(U_1^{(2)},U_2^{(2)}, \dots U_k^{(2)}) \\
\vdotswithin{=} \\
(U_1^{(N)},U_2^{(N)}, \dots U_k^{(N)})
\end{aligned}
\end{equation*}

How can I change this??

3

The ampersand symbol (&) is not limited to being used in conjunction with the equals sign.

Try this:

    \begin{align*}
    (U_1^{(1)},U_2^{(1)}, &\dots U_k^{(1)}) \\
    (U_1^{(2)},U_2^{(2)}, &\dots U_k^{(2)}) \\
    & \vdots \\
    (U_1^{(N)},U_2^{(N)}, &\dots U_k^{(N)})
    \end{align*}

which produces this:

enter image description here

You can place the & symbol wherever you want the alignment to occur.

  • 1
    Thank you. I've used &= so many times and always believed it had to be used together. So many new possibilities opened up now. – Orongo Apr 3 '16 at 16:50
2

Use this for an automatic placement (ans a simpler code):

\documentclass[border=2pt]{book}
\usepackage{mathtools}

\begin{document}

\begin{align*}
  (U_1^{(1)},U_2^{(1)}, & \dots U_k^{(1)}) \\
  (U_1^{(2)},U_2^{(2)}, & \dots, U_k^{(2)}) \\[-0.5ex]
                        & \vdotswithin{ \dots } \\[-0.5ex] % change the 120 mu value for appropriate position
  (U_1^{(N)},U_2^{(N)}, & \dots, U_k^{(N)})
\end{align*}

\end{document}

enter image description here

  • This is the correct answer. I remove an unnecessary space ;) There's also \shortvdotswithin if anyone prefers it. – Manuel Apr 6 '16 at 13:33
  • shortvdots withingives a bad vertical spacing for me (too tight above, too large below), but maybe I miss something. – Bernard Apr 6 '16 at 14:25
0

If you're going to use an environment such as align, you should provide indications where the alignment should take place. No natural optimal alignment point appears to be available, so I suggest you make the first , (comma) the common alignment point. Your \vdotswithin{=} directive seems to be a bit out of place, as there is no = symbol to align on. I suggest you use a simple &\vdots construct instead.

Separately, there seems to be no need to nest an aligned environment inside an equation* environment; I suggest you use a single align* environment instead.

enter image description here

\documentclass{article} 
\usepackage{amsmath} % for 'align*' environment
\begin{document}
\begin{align*}
(U_1^{(1)}&,U_2^{(1)}, \dots, U_k^{(1)}) \\
(U_1^{(2)}&,U_2^{(2)}, \dots, U_k^{(2)}) \\
&\vdots \\
(U_1^{(N)}&,U_2^{(N)}, \dots, U_k^{(N)})
\end{align*}
\end{document}
0

I found a solution using \mspace command, but it requires manulally adjusting the position of \vdots.

\documentclass[border=2pt]{book} 
\usepackage{mathtools}

\begin{document} 
\begin{equation*}
\begin{aligned}
(U_1^{(1)},U_2^{(1)}, \dots U_k^{(1)}) \\
(U_1^{(2)},U_2^{(2)}, \dots U_k^{(2)}) \\
\vdotswithin{\mspace{120mu}} \\ % change the 120 mu value for appropriate position
(U_1^{(N)},U_2^{(N)}, \dots U_k^{(N)})
\end{aligned}
\end{equation*}
\end{document}

enter image description here

0

If you want the vertical dots to be horizontally centred under the equations, rather than being aligned with any particular alignment point, then the environment you need is not {align*} or {aligned}, but rather {gather*}, another one of the displayed equation structures offered by the amsmath package:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
(U_1^{(1)},U_2^{(1)}, \dots U_k^{(1)}) \\
(U_1^{(2)},U_2^{(2)}, \dots U_k^{(2)}) \\
\vdots \\
(U_1^{(N)},U_2^{(N)}, \dots U_k^{(N)})
\end{gather*}
\end{document}
  • For novice users of the math environments of the amsmath package, you may want to add that with the gather and gather* environments, all rows will be centered, not just the row that contains the \vdots instruction. – Mico Apr 6 '16 at 14:51

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.