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 #1368

Open
2 tasks
hansonchar opened this issue Oct 27, 2024 · 0 comments
Open
2 tasks

Comments

@hansonchar
Copy link

Brief outline of the proposed feature

Motivation for this change

The conversation at #640 on the possibility of supporting the specification of options that can be applied to multiple examples.

To demonstrate the usage of this feature, I've modified ControlElectric.lua, while simplifying the code by removing unnecessary double quotes at the same time.

** Pull request already approved **

#1339

Usage example

For the record: Here are other examples that could make use of this PR:

  • --[[
    % TODOsp: codeexamples: the following 3 examples need these libraries
    % \usetikzlibrary{graphs,graphdrawing}
    % \usegdlibrary{force}
    --]]
    example
    [[
    \begin{tikzpicture}
    \draw [help lines] (0,0) grid (3,2);
    \graph [spring layout]
    {
    a[x=1] -- { b, c, d, e -- {f,g,h} };
    { h, g } -- a;
    };
    \end{tikzpicture}
    ]]
    example
    [[
    \begin{tikzpicture}
    \draw [help lines] (0,0) grid (3,2);
    \graph [spring layout]
    {
    a -- { b, c, d[x=0], e -- {f[x=2], g, h[x=1]} };
    { h, g } -- a;
    };
    \end{tikzpicture}
    ]]
    example
    [[
    \begin{tikzpicture}
    \draw [help lines] (0,0) grid (3,2);
    \graph [spring layout]
    {
    a -- { b, c, d[x=0], e -- {f[x=2,y=1], g, h[x=1]} };
    { h, g } -- a;
    };
    \end{tikzpicture}
    ]]

  • --[[
    % TODOsp: codeexamples: the following 4 examples need these libraries
    % \usetikzlibrary{graphs,graphdrawing}
    % \usegdlibrary{layered}
    --]]
    example
    [[
    \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
    [[
    \begin{tikzpicture}
    \draw [help lines] (0,0) grid (3,2);
    \graph [layered layout, anchor node=c, edges=rounded corners]
    { a -- {b [x=1,y=1], c [x=1,y=1] } -- d -- a};
    \end{tikzpicture}
    ]]

@hmenke hmenke added this to the 3.1.11 milestone Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants