# Problem with align alignment

I have written the following code:

\mathbb{R}^n\times\cdots\times\mathbb{R}^n&\rightarrow
\mathbb{R}^m\times\cdots\times\mathbb{R}^m \rightarrow \mathbb{R}\\
(v_1,\cdots,v_k)&\mapsto (f_*(v_1),\cdots,f_*(v_k))\mapsto
\eta(f_*(v_1),\cdots,f_*(v_k))


I am using & symbol two times..

I want output for (v_1,\cdots,v_k) to come under

\mathbb{R}^n\times\cdots\times\mathbb{R}^n


and (f_*(v_1),\cdots,f_*(v_k)) to come under

\mathbb{R}^m\times\cdots\times\mathbb{R}^m


and \eta(f_*(v_1),\cdots,f_*(v_k)) to come under

\mathbb{R}


First two steps are coming perfectly, but

\eta(f_*(v_1),\cdots,f_*(v_k))


is not coming under

\mathbb{R}


There is some gap. What am i supposed to do to clear this gap?

The following is what i have in my tex file

\documentclass[article]{amsart}
\renewcommand{\baselinestretch}{1.5}
\textheight 9.3in \textwidth 6.5in \topmargin -1cm
\oddsidemargin-.05cm \evensidemargin -.1cm \topmargin .1cm
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage[all]{xy}
\usepackage{xypic}
\author{..}
\title{..}
\begin{document}
\maketitle

\begin{align*}
\mathbb{R}^n\times\cdots\times\mathbb{R}^n &\rightarrow     \mathbb{R}^m\times\cdots\times\mathbb{R}^m &\rightarrow \mathbb{R}\\
(v_1,\cdots,v_k) &\mapsto (f_*(v_1),\cdots,f_*(v_k)) &\mapsto \eta(f_*   (v_1),\cdots,f_*(v_k))
\end{align*}
\end{document}

• You need 2n-1 &'s, one for each alignment sets, and one between each alignment. BTW: On this site we prefer users to post full minimal examples including document class and preamble. It makes it a lot easier to help. BTW2: replace ,\cdots, with ,\dots, – daleif Feb 5 '16 at 8:01
• @daleif I have edited it.. Please see if you can help me with this – kk lm Feb 5 '16 at 8:15
• First of, it might be a good idea to look at your own code. It does not even compile. – daleif Feb 5 '16 at 8:17
• Now it works... :) – kk lm Feb 5 '16 at 8:22

I'd use a different construction, and I'd not even align them because of the vast size difference.

\documentclass{amsart}
\begin{document}

\begin{alignat*}{2}
\mathbb{R}^n\times\cdots\times\mathbb{R}^n
& \rightarrow
\mathbb{R}^m\times\cdots\times\mathbb{R}^m
&& \to \mathbb{R}
\\
(v_1,\dots,v_k)&\mapsto (f_*(v_1),\dots,f_*(v_k))
&&\mapsto \eta(f_ (v_1),\dots,f_*(v_k))
\end{alignat*}

Better
\begin{gather*}
\mathbb{R}^n\times\cdots\times\mathbb{R}^n
\rightarrow
\mathbb{R}^m\times\cdots\times\mathbb{R}^m
\to \mathbb{R}
\\
(v_1,\dots,v_k)\mapsto (f_*(v_1),\dots,f_*(v_k))
\mapsto \eta(f_ (v_1),\dots,f_*(v_k))
\end{gather*}

\end{document}


• Ok, so it is not possible to get that third arrow right above third arrow that is below due to size difference.. – kk lm Feb 5 '16 at 8:24
• I can not upvote as i do not have 15 reputation... Once i get that i will do upvote your answer – kk lm Feb 5 '16 at 8:29
• @kklm in the first part of the image the two arrows are above each other, but it looks strange – daleif Feb 5 '16 at 8:47
• Updated with a fix of the wrongly used \cdots – daleif Feb 5 '16 at 8:49

For the utmost in flexibility and programmability, you may want to set up an array environment to display the two rows. The following code right-aligns the material in the first group, centers the material in the middle group, and left-aligns the material in the final group; the \rightarrow and \mapsto symbols are center-set in columns of type C.

\documentclass{amsart}
\usepackage{array} % for "\newcolumntype" macro
\newcolumntype{C}{>{{}}c<{{}}}
\newcommand\R{\mathbb{R}}
\begin{document}
$\setlength\arraycolsep{0pt} \begin{array}{ rCcCl } \R^n\times\dots\times\R^n & \rightarrow & \R^m\times\dots\times\R^m & \rightarrow & \R \\ (v_1,\dots,v_k) & \mapsto & \bigl(f_*(v_1),\dots,f_*(v_k)\bigr) & \mapsto & \eta\bigl(f_*(v_1),\dots,f_*(v_k)\bigr) \\ \end{array}$
\end{document}


If you'd like to center-set the material in all three groups instead, simply replace \begin{array}{ rCcCl } with \begin{array}{ cCcCc }.