Skip to content

Commit

Permalink
Fix preamble + Nicer and more consistent formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Hanson Char <[email protected]>
  • Loading branch information
hansonchar committed Jun 24, 2024
1 parent abf597d commit 15eb48f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
42 changes: 21 additions & 21 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/control/doc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ sense that some nodes are ``nailed to the canvas'' while other
nodes can ``move freely''.
]]

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}} ]],
code = [[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
Expand All @@ -110,10 +110,10 @@ example({
};
\end{tikzpicture}
]]
})
}

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}} ]],
code = [[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
Expand All @@ -124,10 +124,10 @@ example({
};
\end{tikzpicture}
]]
})
}

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}} ]],
code = [[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
Expand All @@ -138,7 +138,7 @@ example({
};
\end{tikzpicture}
]]
})
}
--------------------------------------------------------------------


Expand Down Expand Up @@ -168,18 +168,18 @@ Note how in the last example |c| is placed at |(1,1)| rather than
|b| as would happen by default.
]]

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]],
code = [[
\tikz \draw (0,0)
-- (1,0.5) graph [edges=red, layered layout, anchor node=a] { a -> {b,c} }
-- (1.5,0) graph [edges=blue, layered layout,
anchor node=y, anchor at={(2,0)}] { x -> {y,z} };
]]
})
}

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]],
code = [[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (3,2);
Expand All @@ -188,7 +188,7 @@ example({
{ a -- {b [x=1,y=1], c [x=1,y=1] } -- d -- a};
\end{tikzpicture}
]]
})
}
--------------------------------------------------------------------


Expand All @@ -203,8 +203,8 @@ The coordinate at which the graph should be anchored when no
explicit anchor is given for any node. The initial value is the origin.
]]

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]],
code = [[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
Expand All @@ -213,7 +213,7 @@ example({
{ a -- {b, c [anchor here] } -- d -- a};
\end{tikzpicture}
]]
})
}
--------------------------------------------------------------------


Expand All @@ -235,8 +235,8 @@ In the example, |c| is placed at the origin since this is the
default |anchor at| position.
]]

example({
options = [[ preamble=\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered} ]],
example {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{layered}} ]],
code = [[
\begin{tikzpicture}
\draw [help lines] (0,0) grid (2,2);
Expand All @@ -245,5 +245,5 @@ example({
{ a -- {b, c [anchor here] } -- d -- a};
\end{tikzpicture}
]]
})
}
--------------------------------------------------------------------
11 changes: 8 additions & 3 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/trees/doc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,13 @@ example
};
]]

example({
options = [[ preamble=\usetikzlibrary{shapes.misc, arrows.meta, decorations.pathmorphing} ]],
example {
options = [[
preamble = {
\usetikzlibrary{shapes.misc,arrows.meta,graphs,graphdrawing,decorations.pathmorphing}
\usegdlibrary{trees}
}
]],
code = [[
\tikz \graph [binary tree layout] {
Knuth -> {
Expand All @@ -313,7 +318,7 @@ example({
}
};
]]
})
}
--------------------------------------------------------------------


Expand Down

0 comments on commit 15eb48f

Please sign in to comment.