3

I want to define the following two functions:

\begin{align*}
    f_a:\mathbb{Q}[x,y]&\longrightarrow R_a\\
    x&\longmapsto x\\
    y&\longmapsto y\\
    xy&\longmapsto 0\\
\end{align*}
\begin{align*}
    f_b:\mathbb{Q}[x,y]&\longrightarrow R_b\\
    x&\longmapsto (x,x,x,\ldots)\\
    y&\longmapsto (y,y,y,\ldots)\\
    xy&\longmapsto (0,xy,xy,\ldots)\\
\end{align*}

However, rather than one being on top of the other, I would like them to be next to eachother. How can I do that?

Edit: I've tried using the gather environment, unsuccessfully

2
  • 1
    Have a look at the minipage environment. Nov 29, 2023 at 14:11
  • Off-topic: I think you should use \colon rather than : after f_a and f_b.
    – Mico
    Nov 29, 2023 at 20:43

3 Answers 3

7

Rewrite this in one align* environment:

\documentclass{article}
\usepackage{amsmath, amssymb}

\begin{document}
    \begin{align*}
f_a:\mathbb{Q}[x,y] & \longrightarrow R_a
     &  f_b:\mathbb{Q}[x,y] & \longrightarrow R_b\\
%
x & \longmapsto x
    &   x & \longmapsto (x,x,x,\ldots)\\
%
y & \longmapsto y\
    &   y & \longmapsto (y,y,y,\ldots)\\  
%
xy & \longmapsto 0
    &   xy & \longmapsto (0,xy,xy,\ldots)\\
\end{align*}
\end{document}

enter image description here

4

If the corresponding lines have the same height, it's simpler to use two aligned environments

\documentclass{article}
\usepackage{amsmath,amssymb}

\begin{document}

\begin{equation*}
\begin{aligned}[t]
    f_a:\mathbb{Q}[x,y]&\rightarrow R_a \\
    x&\mapsto x \\
    y&\mapsto y \\
    xy&\mapsto 0
\end{aligned}
\qquad\qquad
\begin{aligned}[t]
    f_b:\mathbb{Q}[x,y]&\rightarrow R_b \\
    x&\mapsto (x,x,x,\dotsc) \\
    y&\mapsto (y,y,y,\dotsc) \\
    xy&\mapsto (0,xy,xy,\dotsc)
\end{aligned}
\end{equation*}

\end{document}

I removed all long, but you're free to reinsert them (after observing that the output with them is not really nice). Note, however, \dotsc instead of \ldots. I'd use \colon instead of : but it's a stylistic decision you have to make.

enter image description here

If your corresponding lines might have different heights, use a single alignedat environment (with a more complicated input, though).

\documentclass{article}
\usepackage{amsmath,amssymb}

\begin{document}

\begin{equation*}
\begin{alignedat}{2}
  f_a:\mathbb{Q}[x,y]&\rightarrow R_a
  &\qquad\qquad
  f_b:\mathbb{Q}[x,y]&\rightarrow R_b \\
  x&\mapsto x &  x&\mapsto (x,x,x,\dotsc) \\
  y&\mapsto y &  y&\mapsto (y,y,y,\dotsc) \\
 xy&\mapsto 0 & xy&\mapsto (0,xy,xy,\dotsc)
\end{alignedat}
\end{equation*}

\end{document}
3

Hope this is useful for you, please excuse, if not.

\documentclass{book}
\usepackage{amsmath,amssymb,multicol}
\begin{document}

\begin{multicols}{2}
\begin{align*}
    f_a:\mathbb{Q}[x,y]&\longrightarrow R_a\\
    x&\longmapsto x\\
    y&\longmapsto y\\
    xy&\longmapsto 0\\
\end{align*}

\begin{align*}
    f_b:\mathbb{Q}[x,y]&\longrightarrow R_b\\
    x&\longmapsto (x,x,x,\ldots)\\
    y&\longmapsto (y,y,y,\ldots)\\
    xy&\longmapsto (0,xy,xy,\ldots)\\
\end{align*}
\end{multicols}

\end{document}

enter image description here

2
  • Thanks! I think I will stick to the other answer because this one doesn't aligb the text properly, however.
    – kubo
    Nov 29, 2023 at 14:20
  • @kubo Yes, Zarko's answer better than mine
    – MadyYuvi
    Nov 29, 2023 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .