22

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?

25

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

  • 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. – Jonas Teuwen Oct 19 '11 at 12:17
  • 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 '11 at 12:24
10

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

  • Sorry for resurrecting the post. But, found this code really shorter. – kan Aug 9 '12 at 15:37
  • Thanks. This a nice answer. I use mathtools already, so I will remember this. – Jonas Teuwen Aug 9 '12 at 15:44
  • 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. – Dylan Thurston Feb 27 '16 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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