Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support applying options to multiple examples as suggested in #640 #1339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
*.zip

build/*
tex/generic/pgf/pgf.revision.tex
4 changes: 4 additions & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

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

### Fixed

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

### Contributors

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

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

Expand Down
22 changes: 9 additions & 13 deletions tex/generic/pgf/graphdrawing/lua/pgf/gd/force/ControlElectric.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare {
type = "number",
initial = 1,

summary = [["
summary = [[
Defines the electric charge of the node. The stronger the
|electric charge| of a node the stronger the repulsion between the
node and others in the graph. A negative |electric charge| means that
Expand All @@ -38,25 +38,21 @@ declare {
|spring electrical layout| algorithm works.
Two typical effects of increasing the |electric charge| are distortion
of symmetries and an upscaling of the drawings.
"]],
]],
examples = {
{
options = [["preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}}"]],
code = [["
options = [[ preamble={\usetikzlibrary{graphs,graphdrawing} \usegdlibrary{force}} ]],
[[
\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 changes: 2 additions & 1 deletion tex/generic/pgf/lua/pgf/manual/DocumentParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,10 @@ local function process_examples(t)
local code, options
if type(t[i]) == "table" then
code = assert(t[i].code)
options = t[i].options
options = t[i].options or t.options
else
code = t[i]
options = t.options
end
n[i] = {
options = process_string(strip_quotes(options)),
Expand Down
Loading