diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/memorygraphs')
-rw-r--r-- | Master/texmf-dist/tex/latex/memorygraphs/memorygraphs.sty | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/memorygraphs/memorygraphs.sty b/Master/texmf-dist/tex/latex/memorygraphs/memorygraphs.sty index bcd5286b718..15a13207ec0 100644 --- a/Master/texmf-dist/tex/latex/memorygraphs/memorygraphs.sty +++ b/Master/texmf-dist/tex/latex/memorygraphs/memorygraphs.sty @@ -1,5 +1,5 @@ %% memorygraphs.tex -%% Copyright 2018 C. Staps +%% Copyright 2018-2019 C. Staps % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,7 +16,7 @@ % This work consists of the files memorygraphs.sty and the documentation in % memorygraphs.tex and example-fibonacci.tex. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{memorygraphs}[2018/12/26 v0.1 Draw memory graphs using TikZ] +\ProvidesPackage{memorygraphs}[2019/01/06 v0.1.1 Draw memory graphs using TikZ] \RequirePackage{tikz} \usetikzlibrary{arrows.meta,calc,positioning,shapes} @@ -90,15 +90,18 @@ anchor=mid, every block, }, - block/.append code={\let\arg\memorygraphs@arg}, + block/.append code={% + \let\arg\memorygraphs@arg% + \gdef\memorygraphs@arity{0}% + }, block mark north east/.style={ append after command={ \pgfextra \pgfinterruptpath \draw[#1] - ($(\tikzlastnode.head north east)-(0,.5\pgflinewidth)$) + ($(\tikzlastnode.head north east)-(\ifnum\memorygraphs@arity=0 .5\pgflinewidth\else0\fi,.5\pgflinewidth)$) -- +(0,-\memorygraphs@marklength) - -- ($(\tikzlastnode.head north east)-(0+\memorygraphs@marklength,.5\pgflinewidth)$) + -- ($(\tikzlastnode.head north east)-(\ifnum\memorygraphs@arity=0 .5\pgflinewidth\else0\fi+\memorygraphs@marklength,.5\pgflinewidth)$) -- cycle; \endpgfinterruptpath \endpgfextra @@ -109,9 +112,9 @@ \pgfextra \pgfinterruptpath \draw[#1] - ($(\tikzlastnode.head south east)+(0,.5\pgflinewidth)$) + ($(\tikzlastnode.head south east)+(\ifnum\memorygraphs@arity=0 -.5\pgflinewidth\else0\fi,.5\pgflinewidth)$) -- +(0,\memorygraphs@marklength) - -- ($(\tikzlastnode.head south east)+(0-\memorygraphs@marklength,.5\pgflinewidth)$) + -- ($(\tikzlastnode.head south east)+(\ifnum\memorygraphs@arity=0 -.5\pgflinewidth\else0\fi-\memorygraphs@marklength,.5\pgflinewidth)$) -- cycle; \endpgfinterruptpath \endpgfextra @@ -151,6 +154,11 @@ rectangle split every empty part={}, rectangle split empty part width=.2em, }, + arity/.append code={% + \pgfmathsetcount\c@pgf@counta{\pgfkeysvalueof{/pgf/rectangle split parts}}% + \ifnum\c@pgf@counta=0\else\advance\c@pgf@counta by-1 \fi + \xdef\memorygraphs@arity{\the\c@pgf@counta}% + }, ref/.style={ {Circle[length=3pt]}-Latex, shorten <=-1.5pt, |