From 9e55d0e32bc28baf64708a45f3f0d22d541ae634 Mon Sep 17 00:00:00 2001 From: Hanson Char Date: Sat, 22 Jun 2024 23:17:51 -0700 Subject: [PATCH] Add missing preambles to FineTune.lua --- .../lua/pgf/gd/control/FineTune.lua | 75 +++++++++++-------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua b/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua index 87d67b5b5..3ba4d1fff 100644 --- a/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua +++ b/tex/generic/pgf/graphdrawing/lua/pgf/gd/control/FineTune.lua @@ -37,12 +37,15 @@ declare { after the algorithm has computed something. "]], - examples = [[" - \tikz \graph [edges=rounded corners, nodes=draw, - layered layout, sibling distance=0] { - a -- {b, c, d[nudge=(up:2mm)]} -- e -- a; - }; - "]] + examples = { + options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]], + [[ + \tikz \graph [edges=rounded corners, nodes=draw, + layered layout, sibling distance=0] { + a -- {b, c, d[nudge=(up:2mm)]} -- e -- a; + }; + ]] + } } @@ -57,12 +60,15 @@ declare { }, summary = "A shorthand for nudging a node upwards.", - examples = [[" - \tikz \graph [edges=rounded corners, nodes=draw, - layered layout, sibling distance=0] { - a -- {b, c, d[nudge up=2mm]} -- e -- a; - }; - "]] + examples = { + options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]], + [[ + \tikz \graph [edges=rounded corners, nodes=draw, + layered layout, sibling distance=0] { + a -- {b, c, d[nudge up=2mm]} -- e -- a; + }; + ]] + } } @@ -90,12 +96,15 @@ declare { }, summary = "Like |nudge up|, but left.", - examples = [[" - \tikz \graph [edges=rounded corners, nodes=draw, - layered layout, sibling distance=0] { - a -- {b, c, d[nudge left=2mm]} -- e -- a; - }; - "]] + examples = { + options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]], + [[ + \tikz \graph [edges=rounded corners, nodes=draw, + layered layout, sibling distance=0] { + a -- {b, c, d[nudge left=2mm]} -- e -- a; + }; + ]] + } } --- @@ -125,12 +134,15 @@ declare { afterwards, the node is placed there, regardless of what the algorithm has computed (all other nodes are unaffected). "]], - examples = [[" - \tikz \graph [edges=rounded corners, nodes=draw, - layered layout, sibling distance=0] { - a -- {b,c,d[regardless at={(1,0)}]} -- e -- a; - }; - "]] + examples = { + options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]], + [[ + \tikz \graph [edges=rounded corners, nodes=draw, + layered layout, sibling distance=0] { + a -- {b,c,d[regardless at={(1,0)}]} -- e -- a; + }; + ]] + } } @@ -154,11 +166,14 @@ declare { regardless. The name of the key is intended to remind one of a node being ``nailed'' to the canvas. "]], - examples = [[" - \tikz \graph [edges=rounded corners, nodes=draw, - layered layout, sibling distance=0] { - a -- {b,c,d[nail at={(1,0)}]} -- e[nail at={(1.5,-1)}] -- a; - }; - "]] + examples = { + options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]], + [[ + \tikz \graph [edges=rounded corners, nodes=draw, + layered layout, sibling distance=0] { + a -- {b,c,d[nail at={(1,0)}]} -- e[nail at={(1.5,-1)}] -- a; + }; + ]] + } }