How to draw the figure with four pentagons? The 2019 Stack Overflow Developer Survey Results Are InLaTeX equivalent of ConTeXt buffersHow 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: 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?beginfigure… endfigure is not working with tikz package

Idiomatic way to prevent slicing?

Why is the maximum length of OpenWrt’s root password 8 characters?

Why is it "Tumoren" and not "Tumore"?

Understanding the implication of what "well-defined" means for the operation in quotient group

How to deal with fear of taking dependencies

Flying Bloodthirsty Lampshades

Does duplicating a spell with Wish count as casting that spell?

Why do UK politicians seemingly ignore opinion polls on Brexit?

Lethal sonic weapons

Can't find the latex code for the ⍎ (down tack jot) symbol

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Is domain driven design an anti-SQL pattern?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

How is radar separation assured between primary and secondary targets?

Why can Shazam fly?

Is three citations per paragraph excessive for undergraduate research paper?

What spell level should this homebrew After-Image spell be?

What tool would a Roman-age civilization have to grind silver and other metals into dust?

Manuscript was "unsubmitted" because the manuscript was deposited in Arxiv Preprints

How to answer pointed "are you quitting" questioning when I don't want them to suspect

How to create dashed lines/arrows in Illustrator

What is this 4-propeller plane?

Unbreakable Formation vs. Cry of the Carnarium

Landlord wants to switch my lease to a "Land contract" to "get back at the city"



How to draw the figure with four pentagons?



The 2019 Stack Overflow Developer Survey Results Are InLaTeX equivalent of ConTeXt buffersHow 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: 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?beginfigure… endfigure is not working with tikz package










3















I want to make the next figure formed by 4 pentagons.



enter image description here



I can only do with two and still have a space between them. I can't even do the reflection of the two pentagons to get the desired figure.



documentclass[a4paper]article

usepackage[brazil]babel

usepackagegraphicx

usepackagetikz

begindocument

begincenter

beginfigure[!htb]

begintikzpicture

draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

endtikzpicture

endfigure

beginfigure[!htb]

begintikzpicture
draw[ultra thick,rotate around=198:(-0.80,0.58)] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

endtikzpicture

endfigure

endcenter

enddocument


enter image description here










share|improve this question




























    3















    I want to make the next figure formed by 4 pentagons.



    enter image description here



    I can only do with two and still have a space between them. I can't even do the reflection of the two pentagons to get the desired figure.



    documentclass[a4paper]article

    usepackage[brazil]babel

    usepackagegraphicx

    usepackagetikz

    begindocument

    begincenter

    beginfigure[!htb]

    begintikzpicture

    draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

    endtikzpicture

    endfigure

    beginfigure[!htb]

    begintikzpicture
    draw[ultra thick,rotate around=198:(-0.80,0.58)] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

    endtikzpicture

    endfigure

    endcenter

    enddocument


    enter image description here










    share|improve this question


























      3












      3








      3


      1






      I want to make the next figure formed by 4 pentagons.



      enter image description here



      I can only do with two and still have a space between them. I can't even do the reflection of the two pentagons to get the desired figure.



      documentclass[a4paper]article

      usepackage[brazil]babel

      usepackagegraphicx

      usepackagetikz

      begindocument

      begincenter

      beginfigure[!htb]

      begintikzpicture

      draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

      endtikzpicture

      endfigure

      beginfigure[!htb]

      begintikzpicture
      draw[ultra thick,rotate around=198:(-0.80,0.58)] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

      endtikzpicture

      endfigure

      endcenter

      enddocument


      enter image description here










      share|improve this question
















      I want to make the next figure formed by 4 pentagons.



      enter image description here



      I can only do with two and still have a space between them. I can't even do the reflection of the two pentagons to get the desired figure.



      documentclass[a4paper]article

      usepackage[brazil]babel

      usepackagegraphicx

      usepackagetikz

      begindocument

      begincenter

      beginfigure[!htb]

      begintikzpicture

      draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

      endtikzpicture

      endfigure

      beginfigure[!htb]

      begintikzpicture
      draw[ultra thick,rotate around=198:(-0.80,0.58)] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;

      endtikzpicture

      endfigure

      endcenter

      enddocument


      enter image description here







      tikz-pgf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 4 at 18:17







      Benedito Freire

















      asked Apr 4 at 18:14









      Benedito FreireBenedito Freire

      1307




      1307




















          3 Answers
          3






          active

          oldest

          votes


















          11














          You can draw more than one shape in the same tikzpicture:



          documentclass[a4paper]article

          usepackage[brazil]babel

          usepackagegraphicx

          usepackagetikz

          begindocument

          begincenter

          beginfigure[!htb]

          begintikzpicture

          draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
          beginscope[yshift=-3.22cm]
          draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
          endscope
          beginscope[xshift=3.8cm]
          draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
          beginscope[yshift=-3.22cm]
          draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
          endscope
          endscope
          endtikzpicture

          endfigure

          endcenter

          enddocument



          To make things easier, you can use predefined pentagons:



          documentclass[a4paper]article

          usepackagetikz
          usetikzlibraryshapes.geometric

          begindocument

          beginfigure[!htb]
          begintikzpicture[every node/.append style=regular polygon, regular polygon sides=5, minimum size=4cm, draw,ultra thick]
          node at (0,0) ;
          node at (3.8,0) ;
          node[rotate=180] at (0,-3.22) ;
          node[rotate=180] at (3.8,-3.22) ;
          endtikzpicture
          endfigure

          enddocument


          enter image description here



          Off-topic: please note that placing a floating figure environment inside a non-floating center environment does not make much sense..






          share|improve this answer
































            11














            Similar answer to @samcarter, but using named nodes -- avoids having to calculate the distances. My motto: Let TikZ do the work!



            documentclassarticle

            usepackagetikz

            usetikzlibraryshapes.geometric
            %% The size can easily altered by changing the minimum size
            tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1in,draw,ultra thick,outer sep=0pt

            documentclassarticle

            usepackagetikz

            usetikzlibraryshapes.geometric

            tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1.5in,draw,ultra thick,outer sep=0pt

            begindocument

            tikz%
            node[pgon] (S) at (0,0) S;
            node[pgon,anchor=corner 2] (A) at (S.corner 5) A;
            node[pgon,rotate=180,anchor=corner 4] (B) at (S.corner 3) B;
            node[pgon,rotate=180,anchor=corner 4] (C) at (A.corner 3) C;
            draw[fill=purple!50,line join=bevel,ultra thick] (S.corner 5) --
            (A.corner 3) --
            (C.corner 5) --
            (S.corner 4) -- cycle;


            enddocument


            Update



            I have modified the code slightly so that there won't be a problem with mitre issues at the top and bottom of the colored shape. Updated the output as well.



            Pentagon figure






            share|improve this answer




















            • 1





              @marmot Good point. Making the change. Thanks.

              – sgmoye
              Apr 4 at 20:30











            • Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

              – hpekristiansen
              Apr 5 at 4:37











            • @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

              – sgmoye
              Apr 5 at 10:56


















            3














            This looks like a code golfing challenge ;)



            documentclass[tikz,border=7pt]standalone
            usetikzlibraryshapes.geometric
            begindocument
            tikz
            path[fill=violet](1,1.17557)foreach~in1,-1[scale=~]foreach~in1,-1[yscale=~]
            --(1,1.17557)node[regular polygon,regular polygon sides=5,
            inner sep=17.11435,draw,fill=white,transform shape,yshift=-9.24486];
            enddocument


            enter image description here



            Calculations



            • 1cm = 28.452755906694 pt

            • x = 1 cm

            • y = (cos(pi/5)+cos(2*pi/5))/sin(2*pi/5) = 1.1755705045849463 cm

            • inner sep = cos(pi/5)/sqrt(2)/sin(2*pi/5)*28.452755906694 = 17.114359850473026 pt

            • yshift = -cos(2*pi/5)/sin(2*pi/5)*28.452755906694 = -9.244860806192047 pt





            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
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483225%2fhow-to-draw-the-figure-with-four-pentagons%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              11














              You can draw more than one shape in the same tikzpicture:



              documentclass[a4paper]article

              usepackage[brazil]babel

              usepackagegraphicx

              usepackagetikz

              begindocument

              begincenter

              beginfigure[!htb]

              begintikzpicture

              draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
              beginscope[yshift=-3.22cm]
              draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
              endscope
              beginscope[xshift=3.8cm]
              draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
              beginscope[yshift=-3.22cm]
              draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
              endscope
              endscope
              endtikzpicture

              endfigure

              endcenter

              enddocument



              To make things easier, you can use predefined pentagons:



              documentclass[a4paper]article

              usepackagetikz
              usetikzlibraryshapes.geometric

              begindocument

              beginfigure[!htb]
              begintikzpicture[every node/.append style=regular polygon, regular polygon sides=5, minimum size=4cm, draw,ultra thick]
              node at (0,0) ;
              node at (3.8,0) ;
              node[rotate=180] at (0,-3.22) ;
              node[rotate=180] at (3.8,-3.22) ;
              endtikzpicture
              endfigure

              enddocument


              enter image description here



              Off-topic: please note that placing a floating figure environment inside a non-floating center environment does not make much sense..






              share|improve this answer





























                11














                You can draw more than one shape in the same tikzpicture:



                documentclass[a4paper]article

                usepackage[brazil]babel

                usepackagegraphicx

                usepackagetikz

                begindocument

                begincenter

                beginfigure[!htb]

                begintikzpicture

                draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                beginscope[yshift=-3.22cm]
                draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                endscope
                beginscope[xshift=3.8cm]
                draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                beginscope[yshift=-3.22cm]
                draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                endscope
                endscope
                endtikzpicture

                endfigure

                endcenter

                enddocument



                To make things easier, you can use predefined pentagons:



                documentclass[a4paper]article

                usepackagetikz
                usetikzlibraryshapes.geometric

                begindocument

                beginfigure[!htb]
                begintikzpicture[every node/.append style=regular polygon, regular polygon sides=5, minimum size=4cm, draw,ultra thick]
                node at (0,0) ;
                node at (3.8,0) ;
                node[rotate=180] at (0,-3.22) ;
                node[rotate=180] at (3.8,-3.22) ;
                endtikzpicture
                endfigure

                enddocument


                enter image description here



                Off-topic: please note that placing a floating figure environment inside a non-floating center environment does not make much sense..






                share|improve this answer



























                  11












                  11








                  11







                  You can draw more than one shape in the same tikzpicture:



                  documentclass[a4paper]article

                  usepackage[brazil]babel

                  usepackagegraphicx

                  usepackagetikz

                  begindocument

                  begincenter

                  beginfigure[!htb]

                  begintikzpicture

                  draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  beginscope[yshift=-3.22cm]
                  draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  endscope
                  beginscope[xshift=3.8cm]
                  draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  beginscope[yshift=-3.22cm]
                  draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  endscope
                  endscope
                  endtikzpicture

                  endfigure

                  endcenter

                  enddocument



                  To make things easier, you can use predefined pentagons:



                  documentclass[a4paper]article

                  usepackagetikz
                  usetikzlibraryshapes.geometric

                  begindocument

                  beginfigure[!htb]
                  begintikzpicture[every node/.append style=regular polygon, regular polygon sides=5, minimum size=4cm, draw,ultra thick]
                  node at (0,0) ;
                  node at (3.8,0) ;
                  node[rotate=180] at (0,-3.22) ;
                  node[rotate=180] at (3.8,-3.22) ;
                  endtikzpicture
                  endfigure

                  enddocument


                  enter image description here



                  Off-topic: please note that placing a floating figure environment inside a non-floating center environment does not make much sense..






                  share|improve this answer















                  You can draw more than one shape in the same tikzpicture:



                  documentclass[a4paper]article

                  usepackage[brazil]babel

                  usepackagegraphicx

                  usepackagetikz

                  begindocument

                  begincenter

                  beginfigure[!htb]

                  begintikzpicture

                  draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  beginscope[yshift=-3.22cm]
                  draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  endscope
                  beginscope[xshift=3.8cm]
                  draw[ultra thick,rotate=18] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  beginscope[yshift=-3.22cm]
                  draw[ultra thick,rotate=198] (0:2) -- (72:2) -- (144:2) -- (216:2) -- (288:2) -- cycle;
                  endscope
                  endscope
                  endtikzpicture

                  endfigure

                  endcenter

                  enddocument



                  To make things easier, you can use predefined pentagons:



                  documentclass[a4paper]article

                  usepackagetikz
                  usetikzlibraryshapes.geometric

                  begindocument

                  beginfigure[!htb]
                  begintikzpicture[every node/.append style=regular polygon, regular polygon sides=5, minimum size=4cm, draw,ultra thick]
                  node at (0,0) ;
                  node at (3.8,0) ;
                  node[rotate=180] at (0,-3.22) ;
                  node[rotate=180] at (3.8,-3.22) ;
                  endtikzpicture
                  endfigure

                  enddocument


                  enter image description here



                  Off-topic: please note that placing a floating figure environment inside a non-floating center environment does not make much sense..







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 4 at 19:40

























                  answered Apr 4 at 18:57









                  user36296user36296

                  1




                  1





















                      11














                      Similar answer to @samcarter, but using named nodes -- avoids having to calculate the distances. My motto: Let TikZ do the work!



                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric
                      %% The size can easily altered by changing the minimum size
                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1in,draw,ultra thick,outer sep=0pt

                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric

                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1.5in,draw,ultra thick,outer sep=0pt

                      begindocument

                      tikz%
                      node[pgon] (S) at (0,0) S;
                      node[pgon,anchor=corner 2] (A) at (S.corner 5) A;
                      node[pgon,rotate=180,anchor=corner 4] (B) at (S.corner 3) B;
                      node[pgon,rotate=180,anchor=corner 4] (C) at (A.corner 3) C;
                      draw[fill=purple!50,line join=bevel,ultra thick] (S.corner 5) --
                      (A.corner 3) --
                      (C.corner 5) --
                      (S.corner 4) -- cycle;


                      enddocument


                      Update



                      I have modified the code slightly so that there won't be a problem with mitre issues at the top and bottom of the colored shape. Updated the output as well.



                      Pentagon figure






                      share|improve this answer




















                      • 1





                        @marmot Good point. Making the change. Thanks.

                        – sgmoye
                        Apr 4 at 20:30











                      • Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

                        – hpekristiansen
                        Apr 5 at 4:37











                      • @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

                        – sgmoye
                        Apr 5 at 10:56















                      11














                      Similar answer to @samcarter, but using named nodes -- avoids having to calculate the distances. My motto: Let TikZ do the work!



                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric
                      %% The size can easily altered by changing the minimum size
                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1in,draw,ultra thick,outer sep=0pt

                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric

                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1.5in,draw,ultra thick,outer sep=0pt

                      begindocument

                      tikz%
                      node[pgon] (S) at (0,0) S;
                      node[pgon,anchor=corner 2] (A) at (S.corner 5) A;
                      node[pgon,rotate=180,anchor=corner 4] (B) at (S.corner 3) B;
                      node[pgon,rotate=180,anchor=corner 4] (C) at (A.corner 3) C;
                      draw[fill=purple!50,line join=bevel,ultra thick] (S.corner 5) --
                      (A.corner 3) --
                      (C.corner 5) --
                      (S.corner 4) -- cycle;


                      enddocument


                      Update



                      I have modified the code slightly so that there won't be a problem with mitre issues at the top and bottom of the colored shape. Updated the output as well.



                      Pentagon figure






                      share|improve this answer




















                      • 1





                        @marmot Good point. Making the change. Thanks.

                        – sgmoye
                        Apr 4 at 20:30











                      • Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

                        – hpekristiansen
                        Apr 5 at 4:37











                      • @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

                        – sgmoye
                        Apr 5 at 10:56













                      11












                      11








                      11







                      Similar answer to @samcarter, but using named nodes -- avoids having to calculate the distances. My motto: Let TikZ do the work!



                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric
                      %% The size can easily altered by changing the minimum size
                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1in,draw,ultra thick,outer sep=0pt

                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric

                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1.5in,draw,ultra thick,outer sep=0pt

                      begindocument

                      tikz%
                      node[pgon] (S) at (0,0) S;
                      node[pgon,anchor=corner 2] (A) at (S.corner 5) A;
                      node[pgon,rotate=180,anchor=corner 4] (B) at (S.corner 3) B;
                      node[pgon,rotate=180,anchor=corner 4] (C) at (A.corner 3) C;
                      draw[fill=purple!50,line join=bevel,ultra thick] (S.corner 5) --
                      (A.corner 3) --
                      (C.corner 5) --
                      (S.corner 4) -- cycle;


                      enddocument


                      Update



                      I have modified the code slightly so that there won't be a problem with mitre issues at the top and bottom of the colored shape. Updated the output as well.



                      Pentagon figure






                      share|improve this answer















                      Similar answer to @samcarter, but using named nodes -- avoids having to calculate the distances. My motto: Let TikZ do the work!



                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric
                      %% The size can easily altered by changing the minimum size
                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1in,draw,ultra thick,outer sep=0pt

                      documentclassarticle

                      usepackagetikz

                      usetikzlibraryshapes.geometric

                      tikzsetpgon/.style=regular polygon,regular polygon sides=5,minimum size=1.5in,draw,ultra thick,outer sep=0pt

                      begindocument

                      tikz%
                      node[pgon] (S) at (0,0) S;
                      node[pgon,anchor=corner 2] (A) at (S.corner 5) A;
                      node[pgon,rotate=180,anchor=corner 4] (B) at (S.corner 3) B;
                      node[pgon,rotate=180,anchor=corner 4] (C) at (A.corner 3) C;
                      draw[fill=purple!50,line join=bevel,ultra thick] (S.corner 5) --
                      (A.corner 3) --
                      (C.corner 5) --
                      (S.corner 4) -- cycle;


                      enddocument


                      Update



                      I have modified the code slightly so that there won't be a problem with mitre issues at the top and bottom of the colored shape. Updated the output as well.



                      Pentagon figure







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Apr 5 at 11:05

























                      answered Apr 4 at 19:57









                      sgmoyesgmoye

                      4,07811328




                      4,07811328







                      • 1





                        @marmot Good point. Making the change. Thanks.

                        – sgmoye
                        Apr 4 at 20:30











                      • Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

                        – hpekristiansen
                        Apr 5 at 4:37











                      • @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

                        – sgmoye
                        Apr 5 at 10:56












                      • 1





                        @marmot Good point. Making the change. Thanks.

                        – sgmoye
                        Apr 4 at 20:30











                      • Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

                        – hpekristiansen
                        Apr 5 at 4:37











                      • @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

                        – sgmoye
                        Apr 5 at 10:56







                      1




                      1





                      @marmot Good point. Making the change. Thanks.

                      – sgmoye
                      Apr 4 at 20:30





                      @marmot Good point. Making the change. Thanks.

                      – sgmoye
                      Apr 4 at 20:30













                      Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

                      – hpekristiansen
                      Apr 5 at 4:37





                      Nice answer. When I compile your code, I do not get these very small purple triangles sticking out at the top and bottom(something like a miter line join at a sharp angle) . Do you know why they are there? What is your workflow to create the image?

                      – hpekristiansen
                      Apr 5 at 4:37













                      @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

                      – sgmoye
                      Apr 5 at 10:56





                      @hpekristiansen Hmmm. I did not see the mitre issue to which you refer, even at very high magnification (MacTeX2019-Pretest). Still, I will modify the code above to take care of that problem... Thanks for your keen observation!

                      – sgmoye
                      Apr 5 at 10:56











                      3














                      This looks like a code golfing challenge ;)



                      documentclass[tikz,border=7pt]standalone
                      usetikzlibraryshapes.geometric
                      begindocument
                      tikz
                      path[fill=violet](1,1.17557)foreach~in1,-1[scale=~]foreach~in1,-1[yscale=~]
                      --(1,1.17557)node[regular polygon,regular polygon sides=5,
                      inner sep=17.11435,draw,fill=white,transform shape,yshift=-9.24486];
                      enddocument


                      enter image description here



                      Calculations



                      • 1cm = 28.452755906694 pt

                      • x = 1 cm

                      • y = (cos(pi/5)+cos(2*pi/5))/sin(2*pi/5) = 1.1755705045849463 cm

                      • inner sep = cos(pi/5)/sqrt(2)/sin(2*pi/5)*28.452755906694 = 17.114359850473026 pt

                      • yshift = -cos(2*pi/5)/sin(2*pi/5)*28.452755906694 = -9.244860806192047 pt





                      share|improve this answer



























                        3














                        This looks like a code golfing challenge ;)



                        documentclass[tikz,border=7pt]standalone
                        usetikzlibraryshapes.geometric
                        begindocument
                        tikz
                        path[fill=violet](1,1.17557)foreach~in1,-1[scale=~]foreach~in1,-1[yscale=~]
                        --(1,1.17557)node[regular polygon,regular polygon sides=5,
                        inner sep=17.11435,draw,fill=white,transform shape,yshift=-9.24486];
                        enddocument


                        enter image description here



                        Calculations



                        • 1cm = 28.452755906694 pt

                        • x = 1 cm

                        • y = (cos(pi/5)+cos(2*pi/5))/sin(2*pi/5) = 1.1755705045849463 cm

                        • inner sep = cos(pi/5)/sqrt(2)/sin(2*pi/5)*28.452755906694 = 17.114359850473026 pt

                        • yshift = -cos(2*pi/5)/sin(2*pi/5)*28.452755906694 = -9.244860806192047 pt





                        share|improve this answer

























                          3












                          3








                          3







                          This looks like a code golfing challenge ;)



                          documentclass[tikz,border=7pt]standalone
                          usetikzlibraryshapes.geometric
                          begindocument
                          tikz
                          path[fill=violet](1,1.17557)foreach~in1,-1[scale=~]foreach~in1,-1[yscale=~]
                          --(1,1.17557)node[regular polygon,regular polygon sides=5,
                          inner sep=17.11435,draw,fill=white,transform shape,yshift=-9.24486];
                          enddocument


                          enter image description here



                          Calculations



                          • 1cm = 28.452755906694 pt

                          • x = 1 cm

                          • y = (cos(pi/5)+cos(2*pi/5))/sin(2*pi/5) = 1.1755705045849463 cm

                          • inner sep = cos(pi/5)/sqrt(2)/sin(2*pi/5)*28.452755906694 = 17.114359850473026 pt

                          • yshift = -cos(2*pi/5)/sin(2*pi/5)*28.452755906694 = -9.244860806192047 pt





                          share|improve this answer













                          This looks like a code golfing challenge ;)



                          documentclass[tikz,border=7pt]standalone
                          usetikzlibraryshapes.geometric
                          begindocument
                          tikz
                          path[fill=violet](1,1.17557)foreach~in1,-1[scale=~]foreach~in1,-1[yscale=~]
                          --(1,1.17557)node[regular polygon,regular polygon sides=5,
                          inner sep=17.11435,draw,fill=white,transform shape,yshift=-9.24486];
                          enddocument


                          enter image description here



                          Calculations



                          • 1cm = 28.452755906694 pt

                          • x = 1 cm

                          • y = (cos(pi/5)+cos(2*pi/5))/sin(2*pi/5) = 1.1755705045849463 cm

                          • inner sep = cos(pi/5)/sqrt(2)/sin(2*pi/5)*28.452755906694 = 17.114359850473026 pt

                          • yshift = -cos(2*pi/5)/sin(2*pi/5)*28.452755906694 = -9.244860806192047 pt






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 5 at 6:10









                          KpymKpym

                          17.8k24191




                          17.8k24191



























                              draft saved

                              draft discarded
















































                              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%2f483225%2fhow-to-draw-the-figure-with-four-pentagons%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

                              រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

                              Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

                              Romeo and Juliet ContentsCharactersSynopsisSourcesDate and textThemes and motifsCriticism and interpretationLegacyScene by sceneSee alsoNotes and referencesSourcesExternal linksNavigation menu"Consumer Price Index (estimate) 1800–"10.2307/28710160037-3222287101610.1093/res/II.5.31910.2307/45967845967810.2307/2869925286992510.1525/jams.1982.35.3.03a00050"Dada Masilo: South African dancer who breaks the rules"10.1093/res/os-XV.57.1610.2307/28680942868094"Sweet Sorrow: Mann-Korman's Romeo and Juliet Closes Sept. 5 at MN's Ordway"the original10.2307/45957745957710.1017/CCOL0521570476.009"Ram Leela box office collections hit massive Rs 100 crore, pulverises prediction"Archived"Broadway Revival of Romeo and Juliet, Starring Orlando Bloom and Condola Rashad, Will Close Dec. 8"Archived10.1075/jhp.7.1.04hon"Wherefore art thou, Romeo? To make us laugh at Navy Pier"the original10.1093/gmo/9781561592630.article.O006772"Ram-leela Review Roundup: Critics Hail Film as Best Adaptation of Romeo and Juliet"Archived10.2307/31946310047-77293194631"Romeo and Juliet get Twitter treatment""Juliet's Nurse by Lois Leveen""Romeo and Juliet: Orlando Bloom's Broadway Debut Released in Theaters for Valentine's Day"Archived"Romeo and Juliet Has No Balcony"10.1093/gmo/9781561592630.article.O00778110.2307/2867423286742310.1076/enst.82.2.115.959510.1080/00138380601042675"A plague o' both your houses: error in GCSE exam paper forces apology""Juliet of the Five O'Clock Shadow, and Other Wonders"10.2307/33912430027-4321339124310.2307/28487440038-7134284874410.2307/29123140149-661129123144728341M"Weekender Guide: Shakespeare on The Drive""balcony"UK public library membership"romeo"UK public library membership10.1017/CCOL9780521844291"Post-Zionist Critique on Israel and the Palestinians Part III: Popular Culture"10.2307/25379071533-86140377-919X2537907"Capulets and Montagues: UK exam board admit mixing names up in Romeo and Juliet paper"Istoria Novellamente Ritrovata di Due Nobili Amanti2027/mdp.390150822329610820-750X"GCSE exam error: Board accidentally rewrites Shakespeare"10.2307/29176390149-66112917639"Exam board apologises after error in English GCSE paper which confused characters in Shakespeare's Romeo and Juliet""From Mariotto and Ganozza to Romeo and Guilietta: Metamorphoses of a Renaissance Tale"10.2307/37323537323510.2307/2867455286745510.2307/28678912867891"10 Questions for Taylor Swift"10.2307/28680922868092"Haymarket Theatre""The Zeffirelli Way: Revealing Talk by Florentine Director""Michael Smuin: 1938-2007 / Prolific dance director had showy career"The Life and Art of Edwin BoothRomeo and JulietRomeo and JulietRomeo and JulietRomeo and JulietEasy Read Romeo and JulietRomeo and Julieteeecb12003684p(data)4099369-3n8211610759dbe00d-a9e2-41a3-b2c1-977dd692899302814385X313670221313670221