Skip to content

Commit

Permalink
With the previous commit, we can now further
Browse files Browse the repository at this point in the history
simplify the usage of having multiple examples
with the same options.

Signed-off-by: Hanson Char <[email protected]>
  • Loading branch information
hansonchar committed Jun 10, 2024
1 parent cf6c892 commit 045d59a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,18 @@ declare {
]],
examples = {
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}} ]],
{
code = [[
[[
\tikz \graph [spring electrical layout, horizontal=0 to 1]
{ 0 [electric charge=1] -- subgraph C_n [n=10] };
]]
},{
code = [[
]],
[[
\tikz \graph [spring electrical layout, horizontal=0 to 1]
{ 0 [electric charge=5] -- subgraph C_n [n=10] };
]]
},{
code = [[
]],
[[
\tikz \graph [spring electrical layout, horizontal=0 to 1]
{ [clique] 1 [electric charge=5], 2, 3, 4 };
]]
}
]]
}
}

Expand Down

3 comments on commit 045d59a

@hansonchar
Copy link
Author

@hansonchar hansonchar commented on 045d59a Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both forms of usages would work, with the second commit showing the cleaner, less verbose form.

@Mo-Gul
Copy link
Contributor

@Mo-Gul Mo-Gul commented on 045d59a Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't have any preference here. The important thing should be that these examples can properly be "extracted".

@hansonchar
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understand. I am currently reading up and learning more about lpeg - a fascinating subject.

Please sign in to comment.