Skip to content

Commit a22132d

Browse files
committed
Support applying options to multiple examples as
suggested in #640 Signed-off-by: Hanson Char <[email protected]>
1 parent 12f1783 commit a22132d

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
*.zip
1313

1414
build/*
15+
tex/generic/pgf/pgf.revision.tex

doc/generic/pgf/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1111
### Added
1212

1313
- Add `RGB` and `gray` color model support for ConTeXt #1130
14+
- Support an apply-all feature (suggested in issue #640) to
15+
apply a single definition of options to multiple examples.
1416

1517
### Fixed
1618

@@ -27,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2729
- Resolve overfull hboxes >=20pt in the manual
2830
- Adapt `\graphicspath` setting for flattened doc tree #1191
2931
- Promote warning "Plot data file \`...' not found" to error
32+
- Ignore file `tex/generic/pgf/pgf.revision.tex` in git
3033

3134
### Contributors
3235

@@ -40,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4043
- Yukai Chou (@muzimuzhi)
4144
- Alexander Grahn
4245
- Max Chernoff
46+
- Hanson Char
4347

4448
## [3.1.10] - 2023-01-13 Henri Menke
4549

tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ declare {
2929
type = "number",
3030
initial = 1,
3131

32-
summary = [["
32+
summary = [[
3333
Defines the electric charge of the node. The stronger the
3434
|electric charge| of a node the stronger the repulsion between the
3535
node and others in the graph. A negative |electric charge| means that
@@ -38,24 +38,24 @@ declare {
3838
|spring electrical layout| algorithm works.
3939
Two typical effects of increasing the |electric charge| are distortion
4040
of symmetries and an upscaling of the drawings.
41-
"]],
41+
]],
4242
examples = {
43+
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}} ]],
4344
{
44-
options = [["preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}}"]],
45-
code = [["
45+
code = [[
4646
\tikz \graph [spring electrical layout, horizontal=0 to 1]
4747
{ 0 [electric charge=1] -- subgraph C_n [n=10] };
48-
"]]
48+
]]
4949
},{
50-
code = [["
50+
code = [[
5151
\tikz \graph [spring electrical layout, horizontal=0 to 1]
5252
{ 0 [electric charge=5] -- subgraph C_n [n=10] };
53-
"]]
53+
]]
5454
},{
55-
code = [["
55+
code = [[
5656
\tikz \graph [spring electrical layout, horizontal=0 to 1]
5757
{ [clique] 1 [electric charge=5], 2, 3, 4 };
58-
"]]
58+
]]
5959
}
6060
}
6161
}

tex/generic/pgf/lua/pgf/manual/DocumentParser.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ local function process_examples(t)
162162
local code, options
163163
if type(t[i]) == "table" then
164164
code = assert(t[i].code)
165-
options = t[i].options
165+
options = t[i].options or t.options
166166
else
167167
code = t[i]
168168
end

0 commit comments

Comments
 (0)