2

This question already has an answer here:

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?

marked as duplicate by egreg amsmath Jul 3 '16 at 18:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Jul 3 '16 at 17:49
  • @SAM English is not my native language, hope now it's better. – karlkoeller Jul 3 '16 at 18:10
4

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

  • You can also substitute \rightarrow with \to. – karlkoeller Jul 3 '16 at 18:03
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}

Not the answer you're looking for? Browse other questions tagged or ask your own question.