Graph-Maker-Other
view release on metacpan or search on metacpan
devel/pictures.tex view on Meta::CPAN
\usepackage[T1]{fontenc} % T1 for accents, before babel
\usepackage{amsmath}
\allowdisplaybreaks
\usepackage{needspace}
\usepackage{gensymb} % for \degree
\usepackage{hyphenat} % for \hyp hyphenation of words with -
\usepackage[pdfusetitle,
pdflang={en}, % RFC3066 style ISO639
]{hyperref}
\renewcommand\figureautorefname{figure} % lower case
\usepackage[all]{hypcap} % figure links to top of figure
% breakurl must be after hyperref
% whizzytex circa its version 1.3.3 does something hairy which upsets breakurl,
% so skip when whizzytex previewing
\usepackage{ifthen}
\ifthenelse{\isundefined{\Whizzytex}}{
\usepackage{breakurl} % for breaking long \url in DVI
}
\usepackage{mathtools} % for \mathclap and showonlyrefs
\mathtoolsset{showonlyrefs=true,showmanualtags=true}
\usepackage{amsthm}
\usepackage{tikz}
\usetikzlibrary{arrows.meta} % for Latex arrows To[length etc
\usetikzlibrary{bending} % for arrow [bend]
\usetikzlibrary{calc} % for ($(...)$) coordinate calculations
\usetikzlibrary{decorations} % for [decoration=]
\usetikzlibrary{decorations.pathreplacing} % for decoration=brace
\usetikzlibrary{shapes} % for shape aspect=1
\tikzset{font=\small, % same as text
>=Latex} % arrowhead style
% must be capital Latex for [harpoon] half arrows
%------------------------------------------------------------------------------
% personal preferences
\hypersetup{
pdfborderstyle={/W 0}, % no border on hyperlinks
}
% these must be after \begin{document} to take effect, hence \AtBeginDocument
\AtBeginDocument{%
\setlength\abovedisplayskip{.7\baselineskip}
\setlength\belowdisplayskip{.7\baselineskip}
\setlength\abovedisplayshortskip{.5\baselineskip}
\setlength\belowdisplayshortskip{.5\baselineskip}
}
% less space after "plain" style \end{theorem} etc
\makeatletter
\g@addto@macro\th@plain{\thm@postskip=1\baselineskip}
\makeatother
%------------------------------------------------------------------------------
% Generic Macros
% GP-DEFINE default(strictargs,1);
\newcommand\MySlash{\slash\hspace{0pt}}
\newcommand\MyTightDots{.\kern.1em.\kern.1em.}
\newbox\MyNegativePhantomBox
\newcommand\MyNegativePhantom[1]{%
\setbox\MyNegativePhantomBox\hbox{#1}%
\hbox to -\wd\MyNegativePhantomBox{}}
% -\wd\MyNegativePhantomBox
% % Uncomment this to see the bounding box around each picture.
% \tikzset{
% every picture/.append style={
% execute at end picture={
% \draw (current bounding box.south west)
% rectangle (current bounding box.north east);
% }}}
%------------------------------------------------------------------------------
\begin{document}
%------------------------------------------------------------------------------
\clearpage
\section{A045898 Triplets of Hanoi Moves}
Bits of $n$, high to low
\begin{tikzpicture}
[scale=1.8,
my box/.style={draw,ellipse,minimum size=1em,inner sep=.15em,outer sep=.2em},
]
\node (1) at (0,0) [my box] {1};
\node (2) at (1.5,0) [my box] {2};
\node (3) at (1.5,-1) [my box] {3};
\node (4) at (0,-1) [my box] {4};
\node (5) at (.75,-2) [my box] {5};
% GP-DEFINE expand=[ 1,2; \
% GP-DEFINE 1,3; \
% GP-DEFINE 4,5; \
% GP-DEFINE 1,5; \
% GP-DEFINE 4,3 ];
\draw [<-,loop left] (1) to node[pos=.5,auto=left] {0} ();
\draw [->,bend left=10] (1) to node[pos=.5,auto=left] {1} (2);
% GP-Test expand[1,1] == 1
% GP-Test expand[1,2] == 2
\draw [->,bend left=10] (2) to node[pos=.5,auto=left] {0} (1);
\draw [->] (2) to node[pos=.4,auto=left] {1} (3);
% GP-Test expand[2,1] == 1
% GP-Test expand[2,2] == 3
\draw [->] (3) to node[pos=.5,auto=right] {0} (4);
( run in 0.607 second using v1.01-cache-2.11-cpan-e1769b4cff6 )