32

I have the following diagram:

Diagram

However, this looks a bit ugly, I would like a version that looks a little bit better. For example, size the last arrow such that the T_\phi is moved to the right.

This is the code which I am using to do this:

\begin{align*}
  \xi \colon &\lb \to \mathcal{L}(\hh)\\
  &\phi \mapsto T_\phi.
\end{align*}

Where \lb and \hh just give the names for those spaces. Does anybody have a suggestion how I would improve the look of this function definition?

2 Answers 2

36

Personaly, I think it is better to use:

enter image description here

\begin{align*}
  \xi \colon L^\infty(T) &\to \mathcal{L}(H^2)\\
  \phi &\mapsto T_\phi.
\end{align*}

Anyway, you can obtain what you want through

\documentclass{article}

\usepackage{amsmath}

\newcommand\phantomarrow[2]{%
  \setbox0=\hbox{$\displaystyle #1\to$}%
  \hbox to \wd0{%
    $#2\mapstochar
     \cleaders\hbox{$\mkern-1mu\relbar\mkern-3mu$}\hfill
     \mkern-7mu\rightarrow$}%
  \,}

\begin{document}

\begin{align*}
  \xi \colon &L^\infty(T) \to \mathcal{L}(H^2)\\
  &\phantomarrow{L^\infty(T)}{\phi} T_\phi.
\end{align*}

\end{document}

enter image description here

2
  • Thanks. You're right, the first suggestion looks the best (at least to me). I will try to figure out how the second one works, might turn out to be useful.
    – JT_NL
    Oct 19, 2011 at 12:17
  • 1
    The second one is rather tricky. You needn't know how it works if you don't want to become a developer of LaTeX packages. For more information for this, see the implementation of \xrightarrow in amsmath package, and the definition of \mapsto.
    – Leo Liu
    Oct 19, 2011 at 12:24
15

You may also want to try mathtools:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{align*}
      \xi \colon &L^\infty(T) \to \mathcal{L}(H^2)\\
       &\phi \xmapsto{\phantom{L^\infty(T)}} T_\phi
\end{align*}

\end{document}

The output looks like:

mathtools output

3
  • Sorry for resurrecting the post. But, found this code really shorter.
    – kan
    Aug 9, 2012 at 15:37
  • Thanks. This a nice answer. I use mathtools already, so I will remember this.
    – JT_NL
    Aug 9, 2012 at 15:44
  • 1
    It looks to me like the arrow is not quite the right length here. There's a coincidence (that $\phi$ and $\rightarrow$ are about the same width) that makes it look close. Feb 27, 2016 at 14:15

You must log in to answer this question.

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