Skip to content

Instantly share code, notes, and snippets.

@vakili
Created June 3, 2021 10:37
Show Gist options
  • Save vakili/76e9d1bf4640a894c348bff627bbddf2 to your computer and use it in GitHub Desktop.
Save vakili/76e9d1bf4640a894c348bff627bbddf2 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{tikz-cd}
%change style of arrows
\tikzcdset{arrow style=math font}
% circle
\newcommand*\cir[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=2.5pt] (char) {#1};}}
% square
\newcommand*\squ[1]{\tikz[baseline=(char.base)]{
\node[shape=rectangle,draw,inner sep=4pt] (char) {#1};}}
% empty space
\newcommand{\pha}{\phantom{a}}
\begin{document}
\begin{equation}
\begin{tikzcd}[row sep = 2em]
& & \cir{\scalebox{0.7}{start}} \ar[dll] \ar[dl] \ar[d] \ar[drr]& & \\
\cir{1} \ar[drr]& \cir{2} \ar[dr] & \cir{3} \ar[d] & \hspace{-1em}\cdot\cdot\cdot & \cir{p} \ar[dll] \\
& & \cir{\scalebox{0.7}{p+1}} & &
\end{tikzcd}
\end{equation}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment