TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is a typical example of what I am talking about:

\mathcal{L}                        &\simeq     O^{-1}(T, S) \\
V                                  &\mapsto    f_V := \pi_S \circ \left(\pi_T |_V\right)^{-1} \\
V_f := \{t + f(t) | t \in T\} &\leftarrow f

The result looks messy in my opinion. I would like everyting to be aligned in the center, and the arrows to extend accordingly --- something that would look like the following:

    X ----------> Y
    x |------> yyyyyyy
xxxxxxxxx <----| yyy

I suppose I could use the array environment, but how to typeset extensible arrows? A similar question was answered in Dynamically size arrow \mapsto in function definition ; but I do not understand that piece of code, so I do not know how to adapt it (and if it is at all possible).

Thank you for your help!

share|improve this question
Welcome to TeX.SX! Please, don't show code that needs guessing at the definitions of the commands used. Either simplify it or provide the definitions. – egreg May 18 '12 at 15:05
My mistake. Sorry about that! These macros are unessential for the point I wanted to make, I just removed them. – Ilia Smilga May 19 '12 at 21:26
up vote 5 down vote accepted

You need a "diagram making" package. I know Xy-pic, but also tikz-cd can be used:


  \mathcal{L} \ar@{<->}[r]^{\sim} &  O^{-1}(T, S) \\
  V \ar@{|->}[r] & f_V := \pi_S \circ (\pi_T|_V)^{-1} \\
  V_f := \{t + f(t)\mid t \in T\} & f \ar@{|->}[l]


enter image description here

Here's the version with tikz-cd:



\begin{tikzcd}[row sep=tiny]
\mathcal{L} \arrow[leftrightarrow]{r}{\sim} & O^{-1}(T, S) \\
V \arrow[mapsto]{r} & f_V := \pi_S \circ (\pi_T|_V)^{-1} \\
V_f := \{t + f(t)\mid t \in T\} & f \arrow[mapsto]{l}


enter image description here

share|improve this answer
OK, I will look into it. Thank you! – Ilia Smilga May 23 '12 at 7:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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