1

i would like to reproduce this exact diagramme lambda

i used the xymatrix package put the scaling was awful this is the script

\xymatrix{
&(\lambda x. x x) ((\lambda x. y) z ) \ar[dl]_{} \ar[dr]^{} &\\
((\lambda x. y) z) ((\lambda x. y) z)   & &(\lambda x.x x) y \ar[dl]_{}\\
&y y&}
}
2

The main point is @C-2pc@R+1pc that decreases the space between columns and increases the space between rows. The \hphantom and \makebox trick is for getting it more symmetric.

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

\[
\hphantom{((\lambda x. y) z)}
\xymatrix@C-2pc@R+1pc{
&(\lambda x. x x) ((\lambda x. y) z ) \ar[dl]_{} \ar[dr]^{} &\\
\makebox[0pt][r]{$((\lambda x. y) z)$} ((\lambda x. y) z)   & &(\lambda x.x x) y \ar[dl]_{}\\
&y y&
}
\]

\end{document}

enter image description here

  • hmmm. those arrows aren't quite perpendicular to one another. might not "narrowing" the expression on the first line (with an equal negative \hspace* on either side of the expression) remedy that? – barbara beeton Apr 4 '16 at 13:35
1

Here is a solution with tikz-cd. The arrow declaration in the preamble is optional of course.

% arara: pdflatex

\documentclass{article}
\usepackage{tikz-cd}
\tikzset{%
    ,commutative diagrams/.cd
    ,arrow style=tikz
    ,diagrams={>=LaTeX}
    }

\begin{document}
\[
\begin{tikzcd}[sep={2cm,between origins}]
    & (\lambda x. x x) ((\lambda x. y) z ) \arrow{dl}\arrow{dr} & \\
    ((\lambda x. y) z) ((\lambda x. y) z) & & (\lambda x.x x) y \arrow{dl} \\
    & yy\vphantom{)} &
\end{tikzcd}
\]  
\end{document}

enter image description here

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.