LaTeX figure drawing












8















enter image description here



How to draw this figure in LaTeX?



I am new to LaTeX figure drawing. Here I see two round headed rectangles and two circles. Also I am eager to know that can I draw this in Overleaf?










share|improve this question





























    8















    enter image description here



    How to draw this figure in LaTeX?



    I am new to LaTeX figure drawing. Here I see two round headed rectangles and two circles. Also I am eager to know that can I draw this in Overleaf?










    share|improve this question



























      8












      8








      8


      2






      enter image description here



      How to draw this figure in LaTeX?



      I am new to LaTeX figure drawing. Here I see two round headed rectangles and two circles. Also I am eager to know that can I draw this in Overleaf?










      share|improve this question
















      enter image description here



      How to draw this figure in LaTeX?



      I am new to LaTeX figure drawing. Here I see two round headed rectangles and two circles. Also I am eager to know that can I draw this in Overleaf?







      tikz-pgf diagrams pstricks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 22 at 7:25









      LianTze Lim

      7,72322763




      7,72322763










      asked Jan 22 at 6:06









      EncipherEncipher

      2688




      2688






















          4 Answers
          4






          active

          oldest

          votes


















          12














          Just another solution.



          documentclass[tikz,border=3.14mm]{standalone}
          begin{document}
          begin{tikzpicture}

          fill circle(2pt) coordinate(a) ++(20:2cm) circle(2pt) coordinate(b);
          draw (a)++(110:2mm) arc (110:290:2mm)--++(20:2cm) arc (-70:110:2mm)--cycle;
          draw (b)++(170:2mm) arc (170:350:2mm)--++(80:2cm) arc (-10:170:2mm)--cycle;

          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer

































            11














            One out of many possibilities.



            documentclass[tikz,border=3.14mm]{standalone}
            usetikzlibrary{shapes.misc}
            begin{document}
            begin{tikzpicture}[bullet/.style={fill,circle,inner sep=2pt}]
            node[rounded rectangle,draw,minimum width=3cm,minimum height=4mm,rotate=20](A) at (0,0){};
            node[rounded rectangle,draw,minimum width=3cm,minimum
            height=4mm,rotate=80,anchor=west](B)
            at ([xshift=-1mm]A.south east){};
            node[bullet,shift={(200:2mm)}] at (A.east){};
            node[bullet,shift={(20:2mm)}] at (A.west){};
            end{tikzpicture}
            end{document}


            enter image description here






            share|improve this answer



















            • 1





              The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

              – Stefan
              Jan 22 at 11:55











            • @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

              – marmot
              Jan 22 at 15:38











            • I had thought of the usage for simulation purposes.

              – Stefan
              Jan 23 at 6:07



















            11














            Run with xelatex



            documentclass{article}
            usepackage{pst-node}
            begin{document}

            begin{pspicture}(-1,-1)(4,5)
            pnodes(0,0){A}(3,1){B}(3.5,4){C}psdots[dotscale=3](A)(B)
            ncbox[linearc=0.4,nodesep=4mm]{A}{B}
            ncbox[linearc=0.4,nodesep=4mm]{C}{B}
            end{pspicture}

            end{document}


            enter image description here






            share|improve this answer

































              4














              Another option: this one is in Metapost using the mplib package, so you need to use lualatex to compile it. In Overleaf, click on "Menu" at the top left and choose "LuaLaTeX" as the compiler.



              A drawing of some semaphore arms.



              documentclass[border=5mm]{standalone}
              usepackage{luatex85}
              usepackage{luamplib}
              begin{document}
              mplibtextextlabel{enable}
              begin{mplibcode}
              beginfig(1);
              vardef arm(expr extent, radius, mark_start, mark_end) =
              save P, A;
              picture P; path A;
              A = halfcircle scaled 2 radius rotated 90
              -- halfcircle scaled 2 radius rotated -90 shifted (extent, 0)
              -- cycle;
              P = image(draw A;
              if mark_start > 0:
              fill fullcircle scaled 2 mark_start;
              fi
              if mark_end > 0:
              fill fullcircle scaled 2 mark_end shifted (extent, 0);
              fi
              ); P
              enddef;
              draw arm(200, 16, 0, 6) rotated 200;
              draw arm(200, 16, 6, 0) rotated 60;
              endfig;
              end{mplibcode}
              end{document}





              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%2f471233%2flatex-figure-drawing%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                12














                Just another solution.



                documentclass[tikz,border=3.14mm]{standalone}
                begin{document}
                begin{tikzpicture}

                fill circle(2pt) coordinate(a) ++(20:2cm) circle(2pt) coordinate(b);
                draw (a)++(110:2mm) arc (110:290:2mm)--++(20:2cm) arc (-70:110:2mm)--cycle;
                draw (b)++(170:2mm) arc (170:350:2mm)--++(80:2cm) arc (-10:170:2mm)--cycle;

                end{tikzpicture}
                end{document}


                enter image description here






                share|improve this answer






























                  12














                  Just another solution.



                  documentclass[tikz,border=3.14mm]{standalone}
                  begin{document}
                  begin{tikzpicture}

                  fill circle(2pt) coordinate(a) ++(20:2cm) circle(2pt) coordinate(b);
                  draw (a)++(110:2mm) arc (110:290:2mm)--++(20:2cm) arc (-70:110:2mm)--cycle;
                  draw (b)++(170:2mm) arc (170:350:2mm)--++(80:2cm) arc (-10:170:2mm)--cycle;

                  end{tikzpicture}
                  end{document}


                  enter image description here






                  share|improve this answer




























                    12












                    12








                    12







                    Just another solution.



                    documentclass[tikz,border=3.14mm]{standalone}
                    begin{document}
                    begin{tikzpicture}

                    fill circle(2pt) coordinate(a) ++(20:2cm) circle(2pt) coordinate(b);
                    draw (a)++(110:2mm) arc (110:290:2mm)--++(20:2cm) arc (-70:110:2mm)--cycle;
                    draw (b)++(170:2mm) arc (170:350:2mm)--++(80:2cm) arc (-10:170:2mm)--cycle;

                    end{tikzpicture}
                    end{document}


                    enter image description here






                    share|improve this answer















                    Just another solution.



                    documentclass[tikz,border=3.14mm]{standalone}
                    begin{document}
                    begin{tikzpicture}

                    fill circle(2pt) coordinate(a) ++(20:2cm) circle(2pt) coordinate(b);
                    draw (a)++(110:2mm) arc (110:290:2mm)--++(20:2cm) arc (-70:110:2mm)--cycle;
                    draw (b)++(170:2mm) arc (170:350:2mm)--++(80:2cm) arc (-10:170:2mm)--cycle;

                    end{tikzpicture}
                    end{document}


                    enter image description here







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 22 at 22:19

























                    answered Jan 22 at 8:54









                    IgnasiIgnasi

                    92.7k4166308




                    92.7k4166308























                        11














                        One out of many possibilities.



                        documentclass[tikz,border=3.14mm]{standalone}
                        usetikzlibrary{shapes.misc}
                        begin{document}
                        begin{tikzpicture}[bullet/.style={fill,circle,inner sep=2pt}]
                        node[rounded rectangle,draw,minimum width=3cm,minimum height=4mm,rotate=20](A) at (0,0){};
                        node[rounded rectangle,draw,minimum width=3cm,minimum
                        height=4mm,rotate=80,anchor=west](B)
                        at ([xshift=-1mm]A.south east){};
                        node[bullet,shift={(200:2mm)}] at (A.east){};
                        node[bullet,shift={(20:2mm)}] at (A.west){};
                        end{tikzpicture}
                        end{document}


                        enter image description here






                        share|improve this answer



















                        • 1





                          The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

                          – Stefan
                          Jan 22 at 11:55











                        • @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

                          – marmot
                          Jan 22 at 15:38











                        • I had thought of the usage for simulation purposes.

                          – Stefan
                          Jan 23 at 6:07
















                        11














                        One out of many possibilities.



                        documentclass[tikz,border=3.14mm]{standalone}
                        usetikzlibrary{shapes.misc}
                        begin{document}
                        begin{tikzpicture}[bullet/.style={fill,circle,inner sep=2pt}]
                        node[rounded rectangle,draw,minimum width=3cm,minimum height=4mm,rotate=20](A) at (0,0){};
                        node[rounded rectangle,draw,minimum width=3cm,minimum
                        height=4mm,rotate=80,anchor=west](B)
                        at ([xshift=-1mm]A.south east){};
                        node[bullet,shift={(200:2mm)}] at (A.east){};
                        node[bullet,shift={(20:2mm)}] at (A.west){};
                        end{tikzpicture}
                        end{document}


                        enter image description here






                        share|improve this answer



















                        • 1





                          The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

                          – Stefan
                          Jan 22 at 11:55











                        • @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

                          – marmot
                          Jan 22 at 15:38











                        • I had thought of the usage for simulation purposes.

                          – Stefan
                          Jan 23 at 6:07














                        11












                        11








                        11







                        One out of many possibilities.



                        documentclass[tikz,border=3.14mm]{standalone}
                        usetikzlibrary{shapes.misc}
                        begin{document}
                        begin{tikzpicture}[bullet/.style={fill,circle,inner sep=2pt}]
                        node[rounded rectangle,draw,minimum width=3cm,minimum height=4mm,rotate=20](A) at (0,0){};
                        node[rounded rectangle,draw,minimum width=3cm,minimum
                        height=4mm,rotate=80,anchor=west](B)
                        at ([xshift=-1mm]A.south east){};
                        node[bullet,shift={(200:2mm)}] at (A.east){};
                        node[bullet,shift={(20:2mm)}] at (A.west){};
                        end{tikzpicture}
                        end{document}


                        enter image description here






                        share|improve this answer













                        One out of many possibilities.



                        documentclass[tikz,border=3.14mm]{standalone}
                        usetikzlibrary{shapes.misc}
                        begin{document}
                        begin{tikzpicture}[bullet/.style={fill,circle,inner sep=2pt}]
                        node[rounded rectangle,draw,minimum width=3cm,minimum height=4mm,rotate=20](A) at (0,0){};
                        node[rounded rectangle,draw,minimum width=3cm,minimum
                        height=4mm,rotate=80,anchor=west](B)
                        at ([xshift=-1mm]A.south east){};
                        node[bullet,shift={(200:2mm)}] at (A.east){};
                        node[bullet,shift={(20:2mm)}] at (A.west){};
                        end{tikzpicture}
                        end{document}


                        enter image description here







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jan 22 at 6:22









                        marmotmarmot

                        95.5k4110210




                        95.5k4110210








                        • 1





                          The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

                          – Stefan
                          Jan 22 at 11:55











                        • @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

                          – marmot
                          Jan 22 at 15:38











                        • I had thought of the usage for simulation purposes.

                          – Stefan
                          Jan 23 at 6:07














                        • 1





                          The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

                          – Stefan
                          Jan 22 at 11:55











                        • @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

                          – marmot
                          Jan 22 at 15:38











                        • I had thought of the usage for simulation purposes.

                          – Stefan
                          Jan 23 at 6:07








                        1




                        1





                        The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

                        – Stefan
                        Jan 22 at 11:55





                        The figure reminds me of a toy called "Metallbaukasten" (de.wikipedia.org/wiki/Metallbaukasten). It would be interesting if there is a package for this.

                        – Stefan
                        Jan 22 at 11:55













                        @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

                        – marmot
                        Jan 22 at 15:38





                        @Stefan I am not aware of such a package. (And I guess kids will prefer the real thing anyway. ;-)

                        – marmot
                        Jan 22 at 15:38













                        I had thought of the usage for simulation purposes.

                        – Stefan
                        Jan 23 at 6:07





                        I had thought of the usage for simulation purposes.

                        – Stefan
                        Jan 23 at 6:07











                        11














                        Run with xelatex



                        documentclass{article}
                        usepackage{pst-node}
                        begin{document}

                        begin{pspicture}(-1,-1)(4,5)
                        pnodes(0,0){A}(3,1){B}(3.5,4){C}psdots[dotscale=3](A)(B)
                        ncbox[linearc=0.4,nodesep=4mm]{A}{B}
                        ncbox[linearc=0.4,nodesep=4mm]{C}{B}
                        end{pspicture}

                        end{document}


                        enter image description here






                        share|improve this answer






























                          11














                          Run with xelatex



                          documentclass{article}
                          usepackage{pst-node}
                          begin{document}

                          begin{pspicture}(-1,-1)(4,5)
                          pnodes(0,0){A}(3,1){B}(3.5,4){C}psdots[dotscale=3](A)(B)
                          ncbox[linearc=0.4,nodesep=4mm]{A}{B}
                          ncbox[linearc=0.4,nodesep=4mm]{C}{B}
                          end{pspicture}

                          end{document}


                          enter image description here






                          share|improve this answer




























                            11












                            11








                            11







                            Run with xelatex



                            documentclass{article}
                            usepackage{pst-node}
                            begin{document}

                            begin{pspicture}(-1,-1)(4,5)
                            pnodes(0,0){A}(3,1){B}(3.5,4){C}psdots[dotscale=3](A)(B)
                            ncbox[linearc=0.4,nodesep=4mm]{A}{B}
                            ncbox[linearc=0.4,nodesep=4mm]{C}{B}
                            end{pspicture}

                            end{document}


                            enter image description here






                            share|improve this answer















                            Run with xelatex



                            documentclass{article}
                            usepackage{pst-node}
                            begin{document}

                            begin{pspicture}(-1,-1)(4,5)
                            pnodes(0,0){A}(3,1){B}(3.5,4){C}psdots[dotscale=3](A)(B)
                            ncbox[linearc=0.4,nodesep=4mm]{A}{B}
                            ncbox[linearc=0.4,nodesep=4mm]{C}{B}
                            end{pspicture}

                            end{document}


                            enter image description here







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Jan 22 at 8:34

























                            answered Jan 22 at 7:36









                            HerbertHerbert

                            273k24412725




                            273k24412725























                                4














                                Another option: this one is in Metapost using the mplib package, so you need to use lualatex to compile it. In Overleaf, click on "Menu" at the top left and choose "LuaLaTeX" as the compiler.



                                A drawing of some semaphore arms.



                                documentclass[border=5mm]{standalone}
                                usepackage{luatex85}
                                usepackage{luamplib}
                                begin{document}
                                mplibtextextlabel{enable}
                                begin{mplibcode}
                                beginfig(1);
                                vardef arm(expr extent, radius, mark_start, mark_end) =
                                save P, A;
                                picture P; path A;
                                A = halfcircle scaled 2 radius rotated 90
                                -- halfcircle scaled 2 radius rotated -90 shifted (extent, 0)
                                -- cycle;
                                P = image(draw A;
                                if mark_start > 0:
                                fill fullcircle scaled 2 mark_start;
                                fi
                                if mark_end > 0:
                                fill fullcircle scaled 2 mark_end shifted (extent, 0);
                                fi
                                ); P
                                enddef;
                                draw arm(200, 16, 0, 6) rotated 200;
                                draw arm(200, 16, 6, 0) rotated 60;
                                endfig;
                                end{mplibcode}
                                end{document}





                                share|improve this answer




























                                  4














                                  Another option: this one is in Metapost using the mplib package, so you need to use lualatex to compile it. In Overleaf, click on "Menu" at the top left and choose "LuaLaTeX" as the compiler.



                                  A drawing of some semaphore arms.



                                  documentclass[border=5mm]{standalone}
                                  usepackage{luatex85}
                                  usepackage{luamplib}
                                  begin{document}
                                  mplibtextextlabel{enable}
                                  begin{mplibcode}
                                  beginfig(1);
                                  vardef arm(expr extent, radius, mark_start, mark_end) =
                                  save P, A;
                                  picture P; path A;
                                  A = halfcircle scaled 2 radius rotated 90
                                  -- halfcircle scaled 2 radius rotated -90 shifted (extent, 0)
                                  -- cycle;
                                  P = image(draw A;
                                  if mark_start > 0:
                                  fill fullcircle scaled 2 mark_start;
                                  fi
                                  if mark_end > 0:
                                  fill fullcircle scaled 2 mark_end shifted (extent, 0);
                                  fi
                                  ); P
                                  enddef;
                                  draw arm(200, 16, 0, 6) rotated 200;
                                  draw arm(200, 16, 6, 0) rotated 60;
                                  endfig;
                                  end{mplibcode}
                                  end{document}





                                  share|improve this answer


























                                    4












                                    4








                                    4







                                    Another option: this one is in Metapost using the mplib package, so you need to use lualatex to compile it. In Overleaf, click on "Menu" at the top left and choose "LuaLaTeX" as the compiler.



                                    A drawing of some semaphore arms.



                                    documentclass[border=5mm]{standalone}
                                    usepackage{luatex85}
                                    usepackage{luamplib}
                                    begin{document}
                                    mplibtextextlabel{enable}
                                    begin{mplibcode}
                                    beginfig(1);
                                    vardef arm(expr extent, radius, mark_start, mark_end) =
                                    save P, A;
                                    picture P; path A;
                                    A = halfcircle scaled 2 radius rotated 90
                                    -- halfcircle scaled 2 radius rotated -90 shifted (extent, 0)
                                    -- cycle;
                                    P = image(draw A;
                                    if mark_start > 0:
                                    fill fullcircle scaled 2 mark_start;
                                    fi
                                    if mark_end > 0:
                                    fill fullcircle scaled 2 mark_end shifted (extent, 0);
                                    fi
                                    ); P
                                    enddef;
                                    draw arm(200, 16, 0, 6) rotated 200;
                                    draw arm(200, 16, 6, 0) rotated 60;
                                    endfig;
                                    end{mplibcode}
                                    end{document}





                                    share|improve this answer













                                    Another option: this one is in Metapost using the mplib package, so you need to use lualatex to compile it. In Overleaf, click on "Menu" at the top left and choose "LuaLaTeX" as the compiler.



                                    A drawing of some semaphore arms.



                                    documentclass[border=5mm]{standalone}
                                    usepackage{luatex85}
                                    usepackage{luamplib}
                                    begin{document}
                                    mplibtextextlabel{enable}
                                    begin{mplibcode}
                                    beginfig(1);
                                    vardef arm(expr extent, radius, mark_start, mark_end) =
                                    save P, A;
                                    picture P; path A;
                                    A = halfcircle scaled 2 radius rotated 90
                                    -- halfcircle scaled 2 radius rotated -90 shifted (extent, 0)
                                    -- cycle;
                                    P = image(draw A;
                                    if mark_start > 0:
                                    fill fullcircle scaled 2 mark_start;
                                    fi
                                    if mark_end > 0:
                                    fill fullcircle scaled 2 mark_end shifted (extent, 0);
                                    fi
                                    ); P
                                    enddef;
                                    draw arm(200, 16, 0, 6) rotated 200;
                                    draw arm(200, 16, 6, 0) rotated 60;
                                    endfig;
                                    end{mplibcode}
                                    end{document}






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Jan 22 at 13:18









                                    ThrustonThruston

                                    26.1k24290




                                    26.1k24290






























                                        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%2f471233%2flatex-figure-drawing%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

                                        How to change which sound is reproduced for terminal bell?

                                        Can I use Tabulator js library in my java Spring + Thymeleaf project?

                                        Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents