1

Does anybody know how to make this type of diagram in LaTeX with arrows and notations? (Example diagram is from Wikipedia).

enter image description here

2 Answers2

9

With tikz-cd:

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

% based on \binom \newcommand{\stirlingi}[2]{\genfrac[]{0pt}{}{#1}{#2}} \newcommand{\stirlingii}[2]{\genfrac{}{0pt}{}{#1}{#2}} \newcommand{\tstirlingi}[2]{\genfrac[]{0pt}{1}{#1}{#2}} \newcommand{\tstirlingii}[2]{\genfrac{}{0pt}{1}{#1}{#2}}

\begin{document}

[ \begin{tikzcd}[row sep=8em,column sep=4em] & x^n \arrow[dl,bend right=20,"(-1)^{n-k}\tstirlingii{n}{k}"'] \arrow[dr,"\tstirlingii{n}{k}"'] \ x^{(n)} \arrow[ur,"\tstirlingi{n}{k}"'] \arrow[rr,"{L(n,k)}"] && (x)_{n} \arrow[ul,bend right=20,"(-1)^{n-k}\tstirlingi{n}{k}"'] \arrow[ll,bend left=15,"{(-1)^{n-k}L(n,k)}"] \end{tikzcd} ]

\end{document}

enter image description here

I'd avoid large labels like in the picture you show.

The braces in the labels with L(n,k) are necessary in order to avoid TikZ mistaking the comma for something that separates options.

egreg
  • 1,121,712
1

With xy:

\documentclass[border=10pt]{standalone}

\usepackage{amsmath,amssymb} \usepackage[all]{xy} \begin{document} $$ \xymatrix@C+2.5em@R+2.5em{ & x^n \ar[ddr]*{\begin{Bmatrix}n\k\end{Bmatrix}} \ar@/_15pt/[ddl]{(-1)^{n-k}\begin{Bmatrix}n\k\end{Bmatrix}}
& \ & & \ x^{(n)} \ar[rr]^
{L(n,k)} \ar[uur]*{\begin{bmatrix}n\k\end{bmatrix}} & & (x){n} \ar@/^15pt/[ll]^{(-1)^{n-k}L(n,k)} \ar@/15pt/[uul]{(-1)^{n-k}\begin{bmatrix}n\k\end{bmatrix}} } $$ \end{document}

enter image description here

s__C
  • 3,186
  • 1
    +1 as noted in comments under the question this is the source made available by arxiv https://commons.wikimedia.org/wiki/File:Stirling_numbers_as_polynomial_basis_change.svg#LaTeX.2FTikZ_source_code – David Carlisle Aug 30 '23 at 16:36
  • Where "arxiv" probably means "the Wikimedia project". ;) – Teepeemm Aug 30 '23 at 18:35