summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memorygraphs
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-07 22:12:07 +0000
committerKarl Berry <karl@freefriends.org>2019-01-07 22:12:07 +0000
commitfa3720c40955f139e3846475ff94698d483128b4 (patch)
tree235eb140d596f4e7b29a8d7b6b2587ae9697b662 /Master/texmf-dist/tex/latex/memorygraphs
parentcd624f24ec394294c526af7d6a9ca8811497e248 (diff)
memorygraphs (7jan19)
git-svn-id: svn://tug.org/texlive/trunk@49631 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/memorygraphs')
-rw-r--r--Master/texmf-dist/tex/latex/memorygraphs/memorygraphs.sty22
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,