Tikz, issue with applying style to nodesTikZ 3.0: Colorate a specific node in a subgraphHow can I put a...

Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?

Should we avoid writing fiction about historical events without extensive research?

Sometimes a banana is just a banana

Why is it "take a leak?"

Caulking a corner instead of taping with joint compound?

Draw bounding region by list of points

Was it really inappropriate to write a pull request for the company I interviewed with?

PTIJ: Mordechai mourning

Transparent Materials for Creating Martian Dome Ceilings

School performs periodic password audits. Is my password compromised?

Can we carry rice to Japan?

What is a term for a function that when called repeatedly, has the same effect as calling once?

PTIJ: Is all laundering forbidden during the 9 days?

Find maximum of the output from reduce

Split a number into equal parts given the number of parts

Can a space-faring robot still function over a billion years?

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Can a Trickery Domain cleric cast a spell through the Invoke Duplicity clone while inside a Forcecage?

How can neutral atoms have exactly zero electric field when there is a difference in the positions of the charges?

Why are special aircraft used for the carriers in the United States Navy?

3.5% Interest Student Loan or use all of my savings on Tuition?

Quitting employee has privileged access to critical information

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Should I use HTTPS on a domain that will only be used for redirection?



Tikz, issue with applying style to nodes


TikZ 3.0: Colorate a specific node in a subgraphHow can I put a coloured outline around fraction lines?Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideTikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?begin{figure}… end{figure} is not working with tikz package













5















I am a beginner in LaTeX, especially in TikZ package.



I want to draw Peterson graph with some styles.



My code



documentclass{article}

usepackage{tikz}
usepackage{caption}
usepackage{graphicx}

usetikzlibrary{graphs}
usetikzlibrary{graphs.standard}
usetikzlibrary[graphs]

tikzset{
every node/.style={draw, circle, very thick},
mark/.style={fill=black!50, circle},
}

begin{document}
begin{figure}
begin{tikzpicture}[]
graph [simple, edges={thick}, clockwise] {
subgraph C_n [n=5, name=A, radius=2cm];
subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

(A 5)[mark] --[red] (A 4)[mark],
A 1 -- B a,
A 2 -- B b,
A 3 -- B c,
A 4 -- B d,
A 5 -- B e,
B a -- B c,
B a -- B d,
B b -- B e,
B b -- B d,
B e -- B c
};

end{tikzpicture}
end{figure}
end{document}


I expect, that nodes 4 and 5 will be gray, but I have only red edge.



enter image description here



What did I do wrong?










share|improve this question









New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    your code is not compileable !

    – AndréC
    yesterday











  • tikzset be before begin{document}, and begin{tikzpicture}[] in right place.

    – Noctus
    yesterday











  • Modify your question by clicking on the edit button.

    – AndréC
    yesterday











  • In my opinion, this is a bug in the graphs.standard library, I tried in vain to apply a style to the graphs in this library. It does not work. Let's wait and see what other TikZ users think about it.

    – AndréC
    yesterday








  • 3





    You can not change the color of existing node. The node (A 5) is created in the subgraph command before you try to apply [mark] to it. Check TikZ 3.0: Colorate a specific node in a subgraph.

    – Kpym
    yesterday
















5















I am a beginner in LaTeX, especially in TikZ package.



I want to draw Peterson graph with some styles.



My code



documentclass{article}

usepackage{tikz}
usepackage{caption}
usepackage{graphicx}

usetikzlibrary{graphs}
usetikzlibrary{graphs.standard}
usetikzlibrary[graphs]

tikzset{
every node/.style={draw, circle, very thick},
mark/.style={fill=black!50, circle},
}

begin{document}
begin{figure}
begin{tikzpicture}[]
graph [simple, edges={thick}, clockwise] {
subgraph C_n [n=5, name=A, radius=2cm];
subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

(A 5)[mark] --[red] (A 4)[mark],
A 1 -- B a,
A 2 -- B b,
A 3 -- B c,
A 4 -- B d,
A 5 -- B e,
B a -- B c,
B a -- B d,
B b -- B e,
B b -- B d,
B e -- B c
};

end{tikzpicture}
end{figure}
end{document}


I expect, that nodes 4 and 5 will be gray, but I have only red edge.



enter image description here



What did I do wrong?










share|improve this question









New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    your code is not compileable !

    – AndréC
    yesterday











  • tikzset be before begin{document}, and begin{tikzpicture}[] in right place.

    – Noctus
    yesterday











  • Modify your question by clicking on the edit button.

    – AndréC
    yesterday











  • In my opinion, this is a bug in the graphs.standard library, I tried in vain to apply a style to the graphs in this library. It does not work. Let's wait and see what other TikZ users think about it.

    – AndréC
    yesterday








  • 3





    You can not change the color of existing node. The node (A 5) is created in the subgraph command before you try to apply [mark] to it. Check TikZ 3.0: Colorate a specific node in a subgraph.

    – Kpym
    yesterday














5












5








5


1






I am a beginner in LaTeX, especially in TikZ package.



I want to draw Peterson graph with some styles.



My code



documentclass{article}

usepackage{tikz}
usepackage{caption}
usepackage{graphicx}

usetikzlibrary{graphs}
usetikzlibrary{graphs.standard}
usetikzlibrary[graphs]

tikzset{
every node/.style={draw, circle, very thick},
mark/.style={fill=black!50, circle},
}

begin{document}
begin{figure}
begin{tikzpicture}[]
graph [simple, edges={thick}, clockwise] {
subgraph C_n [n=5, name=A, radius=2cm];
subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

(A 5)[mark] --[red] (A 4)[mark],
A 1 -- B a,
A 2 -- B b,
A 3 -- B c,
A 4 -- B d,
A 5 -- B e,
B a -- B c,
B a -- B d,
B b -- B e,
B b -- B d,
B e -- B c
};

end{tikzpicture}
end{figure}
end{document}


I expect, that nodes 4 and 5 will be gray, but I have only red edge.



enter image description here



What did I do wrong?










share|improve this question









New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am a beginner in LaTeX, especially in TikZ package.



I want to draw Peterson graph with some styles.



My code



documentclass{article}

usepackage{tikz}
usepackage{caption}
usepackage{graphicx}

usetikzlibrary{graphs}
usetikzlibrary{graphs.standard}
usetikzlibrary[graphs]

tikzset{
every node/.style={draw, circle, very thick},
mark/.style={fill=black!50, circle},
}

begin{document}
begin{figure}
begin{tikzpicture}[]
graph [simple, edges={thick}, clockwise] {
subgraph C_n [n=5, name=A, radius=2cm];
subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

(A 5)[mark] --[red] (A 4)[mark],
A 1 -- B a,
A 2 -- B b,
A 3 -- B c,
A 4 -- B d,
A 5 -- B e,
B a -- B c,
B a -- B d,
B b -- B e,
B b -- B d,
B e -- B c
};

end{tikzpicture}
end{figure}
end{document}


I expect, that nodes 4 and 5 will be gray, but I have only red edge.



enter image description here



What did I do wrong?







tikz-pgf nodes graphs






share|improve this question









New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 19 hours ago









JouleV

4,91111139




4,91111139






New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









NoctusNoctus

284




284




New contributor




Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Noctus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    your code is not compileable !

    – AndréC
    yesterday











  • tikzset be before begin{document}, and begin{tikzpicture}[] in right place.

    – Noctus
    yesterday











  • Modify your question by clicking on the edit button.

    – AndréC
    yesterday











  • In my opinion, this is a bug in the graphs.standard library, I tried in vain to apply a style to the graphs in this library. It does not work. Let's wait and see what other TikZ users think about it.

    – AndréC
    yesterday








  • 3





    You can not change the color of existing node. The node (A 5) is created in the subgraph command before you try to apply [mark] to it. Check TikZ 3.0: Colorate a specific node in a subgraph.

    – Kpym
    yesterday














  • 1





    your code is not compileable !

    – AndréC
    yesterday











  • tikzset be before begin{document}, and begin{tikzpicture}[] in right place.

    – Noctus
    yesterday











  • Modify your question by clicking on the edit button.

    – AndréC
    yesterday











  • In my opinion, this is a bug in the graphs.standard library, I tried in vain to apply a style to the graphs in this library. It does not work. Let's wait and see what other TikZ users think about it.

    – AndréC
    yesterday








  • 3





    You can not change the color of existing node. The node (A 5) is created in the subgraph command before you try to apply [mark] to it. Check TikZ 3.0: Colorate a specific node in a subgraph.

    – Kpym
    yesterday








1




1





your code is not compileable !

– AndréC
yesterday





your code is not compileable !

– AndréC
yesterday













tikzset be before begin{document}, and begin{tikzpicture}[] in right place.

– Noctus
yesterday





tikzset be before begin{document}, and begin{tikzpicture}[] in right place.

– Noctus
yesterday













Modify your question by clicking on the edit button.

– AndréC
yesterday





Modify your question by clicking on the edit button.

– AndréC
yesterday













In my opinion, this is a bug in the graphs.standard library, I tried in vain to apply a style to the graphs in this library. It does not work. Let's wait and see what other TikZ users think about it.

– AndréC
yesterday







In my opinion, this is a bug in the graphs.standard library, I tried in vain to apply a style to the graphs in this library. It does not work. Let's wait and see what other TikZ users think about it.

– AndréC
yesterday






3




3





You can not change the color of existing node. The node (A 5) is created in the subgraph command before you try to apply [mark] to it. Check TikZ 3.0: Colorate a specific node in a subgraph.

– Kpym
yesterday





You can not change the color of existing node. The node (A 5) is created in the subgraph command before you try to apply [mark] to it. Check TikZ 3.0: Colorate a specific node in a subgraph.

– Kpym
yesterday










1 Answer
1






active

oldest

votes


















2














I followed the link given by @Kpym in his commentary and adapted the solution given by hftf.



documentclass[tikz,border=5mm]{standalone}

%usepackage{tikz}
%usepackage{caption}
usepackage{graphicx}

usetikzlibrary{graphs}
usetikzlibrary{graphs.standard}


tikzset{
every node/.style={draw, circle, very thick},
marko/.style={fill=cyan!50, circle},
}

begin{document}
% begin{figure}
begin{tikzpicture}[]
graph [simple, edges={thick},n=5,radius=2cm, clockwise] {
1;2;3;4[marko];5[marko];
subgraph C_n [n=5, name=A, radius=2cm];
subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

(A 5) --[blue] (A 4),
A 1 -- B a,
A 2 -- B b,
A 3 -- B c,
A 4 -- B d,
A 5 -- B e,
B a -- B c,
B a -- B d,
B b -- B e,
B b -- B d,
B e -- B c
};

end{tikzpicture}
%
% tikz
%graph [nodes={draw, circle}, n=5, radius=1.5cm, clockwise]
%{ 1; 2; 3[fill=gray]; 4; 5; subgraph K_n };
% end{figure}
end{document}


screenshot






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Noctus is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477920%2ftikz-issue-with-applying-style-to-nodes%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    I followed the link given by @Kpym in his commentary and adapted the solution given by hftf.



    documentclass[tikz,border=5mm]{standalone}

    %usepackage{tikz}
    %usepackage{caption}
    usepackage{graphicx}

    usetikzlibrary{graphs}
    usetikzlibrary{graphs.standard}


    tikzset{
    every node/.style={draw, circle, very thick},
    marko/.style={fill=cyan!50, circle},
    }

    begin{document}
    % begin{figure}
    begin{tikzpicture}[]
    graph [simple, edges={thick},n=5,radius=2cm, clockwise] {
    1;2;3;4[marko];5[marko];
    subgraph C_n [n=5, name=A, radius=2cm];
    subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

    (A 5) --[blue] (A 4),
    A 1 -- B a,
    A 2 -- B b,
    A 3 -- B c,
    A 4 -- B d,
    A 5 -- B e,
    B a -- B c,
    B a -- B d,
    B b -- B e,
    B b -- B d,
    B e -- B c
    };

    end{tikzpicture}
    %
    % tikz
    %graph [nodes={draw, circle}, n=5, radius=1.5cm, clockwise]
    %{ 1; 2; 3[fill=gray]; 4; 5; subgraph K_n };
    % end{figure}
    end{document}


    screenshot






    share|improve this answer




























      2














      I followed the link given by @Kpym in his commentary and adapted the solution given by hftf.



      documentclass[tikz,border=5mm]{standalone}

      %usepackage{tikz}
      %usepackage{caption}
      usepackage{graphicx}

      usetikzlibrary{graphs}
      usetikzlibrary{graphs.standard}


      tikzset{
      every node/.style={draw, circle, very thick},
      marko/.style={fill=cyan!50, circle},
      }

      begin{document}
      % begin{figure}
      begin{tikzpicture}[]
      graph [simple, edges={thick},n=5,radius=2cm, clockwise] {
      1;2;3;4[marko];5[marko];
      subgraph C_n [n=5, name=A, radius=2cm];
      subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

      (A 5) --[blue] (A 4),
      A 1 -- B a,
      A 2 -- B b,
      A 3 -- B c,
      A 4 -- B d,
      A 5 -- B e,
      B a -- B c,
      B a -- B d,
      B b -- B e,
      B b -- B d,
      B e -- B c
      };

      end{tikzpicture}
      %
      % tikz
      %graph [nodes={draw, circle}, n=5, radius=1.5cm, clockwise]
      %{ 1; 2; 3[fill=gray]; 4; 5; subgraph K_n };
      % end{figure}
      end{document}


      screenshot






      share|improve this answer


























        2












        2








        2







        I followed the link given by @Kpym in his commentary and adapted the solution given by hftf.



        documentclass[tikz,border=5mm]{standalone}

        %usepackage{tikz}
        %usepackage{caption}
        usepackage{graphicx}

        usetikzlibrary{graphs}
        usetikzlibrary{graphs.standard}


        tikzset{
        every node/.style={draw, circle, very thick},
        marko/.style={fill=cyan!50, circle},
        }

        begin{document}
        % begin{figure}
        begin{tikzpicture}[]
        graph [simple, edges={thick},n=5,radius=2cm, clockwise] {
        1;2;3;4[marko];5[marko];
        subgraph C_n [n=5, name=A, radius=2cm];
        subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

        (A 5) --[blue] (A 4),
        A 1 -- B a,
        A 2 -- B b,
        A 3 -- B c,
        A 4 -- B d,
        A 5 -- B e,
        B a -- B c,
        B a -- B d,
        B b -- B e,
        B b -- B d,
        B e -- B c
        };

        end{tikzpicture}
        %
        % tikz
        %graph [nodes={draw, circle}, n=5, radius=1.5cm, clockwise]
        %{ 1; 2; 3[fill=gray]; 4; 5; subgraph K_n };
        % end{figure}
        end{document}


        screenshot






        share|improve this answer













        I followed the link given by @Kpym in his commentary and adapted the solution given by hftf.



        documentclass[tikz,border=5mm]{standalone}

        %usepackage{tikz}
        %usepackage{caption}
        usepackage{graphicx}

        usetikzlibrary{graphs}
        usetikzlibrary{graphs.standard}


        tikzset{
        every node/.style={draw, circle, very thick},
        marko/.style={fill=cyan!50, circle},
        }

        begin{document}
        % begin{figure}
        begin{tikzpicture}[]
        graph [simple, edges={thick},n=5,radius=2cm, clockwise] {
        1;2;3;4[marko];5[marko];
        subgraph C_n [n=5, name=A, radius=2cm];
        subgraph I_n [V={a,b,c,d,e}, name=B, radius=1cm];

        (A 5) --[blue] (A 4),
        A 1 -- B a,
        A 2 -- B b,
        A 3 -- B c,
        A 4 -- B d,
        A 5 -- B e,
        B a -- B c,
        B a -- B d,
        B b -- B e,
        B b -- B d,
        B e -- B c
        };

        end{tikzpicture}
        %
        % tikz
        %graph [nodes={draw, circle}, n=5, radius=1.5cm, clockwise]
        %{ 1; 2; 3[fill=gray]; 4; 5; subgraph K_n };
        % end{figure}
        end{document}


        screenshot







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 19 hours ago









        AndréCAndréC

        9,90311547




        9,90311547






















            Noctus is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Noctus is a new contributor. Be nice, and check out our Code of Conduct.













            Noctus is a new contributor. Be nice, and check out our Code of Conduct.












            Noctus is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f477920%2ftikz-issue-with-applying-style-to-nodes%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

            Castillo d'Acher Características Menú de navegación

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...