Take the 2-minute tour ×
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.

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

\begin{align*}
\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
\end{align*}

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
add comment

1 Answer

up vote 5 down vote accepted

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

\documentclass{article}
\usepackage[all,cmtip]{xy}
\begin{document}

\xymatrix@R=3pt{
  \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]
}

\end{document}

enter image description here

Here's the version with tikz-cd:

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}

\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}
\end{tikzcd}

\end{document}

enter image description here

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

Your Answer

 
discard

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.