2

I want to write something like

F : X ----> Y

x |---> 2x

in LaTeX where the

x |---> 2x

appears directly below

F : X ----> Y

Any suggestions on how to do this?

2 Answers2

5

This should be the right approach:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
F\colon & X \rightarrow Y \\
        & x \mapsto 2x
\end{align*}
\end{document} 

enter image description here

If you prefer a different alignment move the &:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
F\colon X & \rightarrow Y \\
        x & \mapsto 2x
\end{align*}
\end{document} 

enter image description here

If you also prefer longer arrows, use \longrightarrow and \longmapsto:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align*}
F\colon X & \longrightarrow Y \\
        x & \longmapsto 2x
\end{align*}
\end{document}

enter image description here

karlkoeller
  • 124,410
0

I am not sure what you mean by |, but for aligning equations, the align-environment is often used. Here it will align at the arrow since I put & right in front of the \Rightarrow. This is explained further in the documentation.

Note that you can always locate the documentation using the command-line/terminal by writing texdoc amsmath, and that works for any package. The documentation is also available at http://ctan.org/pkg/amsmath

It might sound tedious to look up the documentation for various small problems/features, but the package documentations tend to be well-written and easy to browse. Also, it will at the same time help you to understand how LaTeX works.

Output

enter image description here

Code

\documentclass[11pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{align}
    F: x &\Rightarrow Y\\
       x &\Rightarrow 2x
\end{align}
\end{document}
Runar
  • 6,082