18j-iamp/figs/libs/dimer.sty

34 lines
856 B
TeX

% square lattice (width #1, height #2, origin #3)
\def\grid#1#2#3{
\foreach\i in {0,...,#2}{
\draw#3++(0,\i)--++(#1,0);
}
\foreach\i in {0,...,#1}{
\draw#3++(\i,0)--++(0,#2);
}
}
% dimer (bottom-left vertex #1, vertical or horizontal #2)
\def\dimer#1#2{
\if#2h
\draw[line width=5pt]#1--++(1,0);
\fill#1circle(7pt);
\fill#1++(1,0)circle(7pt);
\else
\draw[line width=5pt]#1--++(0,1);
\fill#1circle(7pt);
\fill#1++(0,1)circle(7pt);
\fi
}
% interactions (bottom-left vertex #1, vertical or horizontal #2)
\def\interaction#1#2{
\if#2h
\draw[line width=5pt, color=white]#1--++(1,0);
\draw[line width=4pt, decorate, decoration={snake}, color=red]#1--++(1,0);
\else
\draw[line width=5pt, color=white]#1--++(0,1);
\draw[line width=4pt, decorate, decoration={snake}, color=red]#1--++(0,1);
\fi
}