%% to be compiled with pdflatex

\documentclass{amsart}

%%%%%%%%

\newif\ifNAMES %
%% uncomment to show the names of the coordinates
%%% recommended if you read this file
% \NAMEStrue %

%%%%%%%%

\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings}

\begin{document}
\thispagestyle{empty}

\centerline{%
  \tikzpicture

  \coordinate (A0) at (0,0) ; %
  \coordinate (A1) at (0,-2) ; %
  \coordinate (A2) at (-6,0) ; %
  \coordinate (A3) at ($(A1)+(A2)$) ; %
  \coordinate (A02) at ($(A0)!1/2!(A2)$) ; %

  \coordinate (K01) at ($(A0)!1/2!(A1)$) ; %
  \coordinate (K002) at ($(A0)!1/4!(A2)$) ; %
  \coordinate (K022) at ($(A0)!3/4!(A2)$) ; %
  \coordinate (K13) at ($(A1)!1/2!(A3)$) ; %
  \coordinate (K32) at ($(A2)!1/2!(A3)$) ; %

  %%%%

  %% placement in shipout is independent of labels, thickness of
  %% bullets
  \useasboundingbox (A0) (A1) (A2) (A3) ; %

  %%%%

  \fill[blue!10] (A2) -- (A0) -- (A1) -- (A3) -- cycle ; %

  %%%% arrows

  \tikzset{
    midtip/.style={decoration={markings, %
        mark=at position #1 with %
        %% need the thin,black to override
        {\arrow[thin,black]{stealth[sep=-2pt]}} %
      },postaction={decorate}}, %
    midtip/.default=1/2, %
  }

  \def\ST#1|{$\scriptstyle #1$}
  \def\SB#1|{$\scriptstyle \bf #1$}

  %% 2 arrows

  \path[thick,draw=gray,midtip=1/4,midtip=3/4] (A2) -- (A0) %
  node[pos=0/4,left]{\ST 1(2(34)) |} %
  node[pos=1/4,above]{\SB 12(34) |} %
  node[pos=2/4,above]{\ST (12)(34) |} %
  node[pos=3/4,above]{\SB (12)34 |} %
  node[pos=4/4,right]{\ST ((12)3)4 |} ; %

  %% 1 arrow

  \draw[thick,draw=gray,midtip] (K32) -- (K01) %
  node[pos=0/2,left]{\ST 1(234) |} %
  node[pos=1/2,above]{\SB 1234 |} %
  node[pos=2/2,right]{\ST (123)4 |} ; %

  %% 1 arrow

  \draw[thick,draw=gray,midtip] (A3) -- (A1) %
  node[pos=0/2,left]{\ST 1((23)4) |} %
  node[pos=1/2,below] {\SB 1(23)4 |} %
  node[pos=2/2,right]{\ST (1(23))4 |} ; %

  %% 2 very thick verticals

  \draw[very thick] (A2) -- (A3) ; %
  \draw[very thick] (A0) -- (A1) ; %

  %%%% bullets

  \foreach \XXX in {%
    A0, A1, A2, A3, A02%
  }{
    \fill[radius=1.7pt] (\XXX) circle[]; %
  }

  %%%%%%%% show the names of the coordinates
  \ifNAMES

  \foreach \XXX/\place in {%
    A0/below left, A1/above left, A2/below right, A3/above right, %
    A02/below, K01/left, K13/above, K32/right%
  }{
    \node[\place,inner sep=2pt,blue] at (\XXX) {\tiny \XXX}; %
  }

  \fi % \ifNAMES

  \endtikzpicture
} % \centerline
\end{document}

%%%%%%%%

%% png creation (normal size, transparent)

%%% pdflatex diagram2.tex
%%% pdftocairo -png -singlefile -transp -r 225 diagram2.pdf tmp
%%% magick -define png:exclude-chunk=date,time tmp.png -crop 732x245+590+329 +repage diagram2.png
%%% optipng diagram2.png

%%%% magick adds white (fallback) background to the transparent image.

%%%% trim parameters:
%%% magick tmp.png -format "%@\n" info: %% 730x245+592+329

%%%% Left padding 2px (after trimming) to get symmetric dots.

%% program versions

%%% This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
%%% Document Class: amsart 2017/10/31 v2.20.4
%%% Package: tikz 2020/01/08 v3.1.5b (3.1.5b)

%%% pdftocairo version 0.86.1
%%% ImageMagick 7.1.1-43 Q16-HDRI x86_64 22550 https://imagemagick.org
%%% OptiPNG version 0.7.7

%%%%%%%%

%%%% First version:
%%% 2024-12-20

%%%% Latest change:
%%% 2025-08-05

%%%%%%%%
