How to draw “section-size” arrows using tikz












2















I searched for problems like this, but couldn't find any approach. Then, I don't believe this is a duplicated question.



The question is: how to draw section-size arrow marks (like the one shown in the picture) using tikz.



enter image description here










share|improve this question























  • Sorry, what does section-sized mean? Try documentclass[tikz,border=3.14mm]{standalone} begin{document} begin{tikzpicture} node (tmp) {$phi$}; draw (tmp.north east) -- ++ (-3,0); draw (tmp.south east) -- ++ (-3,0); draw[<-] (tmp.north) -- ++ (0,0.5); draw[<-] (tmp.south) -- ++ (0,-0.5); end{tikzpicture} end{document}.

    – marmot
    Dec 18 '18 at 19:37











  • Hi @marmot. I mean that I would like to draw those couple of arrows that point to each other indicating the size of a section (because is generally used to point diameter of pipes, etc). I know how to draw them separately... but is there a way to draw at once using a simple code?

    – Brasil
    Dec 18 '18 at 19:42











  • I guess I got most confused by the fact that section has several meanings. So you are talking about diameters, and not the things that come with the section command, right?

    – marmot
    Dec 18 '18 at 19:45






  • 1





    Yes. That is exactly what I mean @marmot :)

    – Brasil
    Dec 18 '18 at 19:46











  • How about this answer?

    – marmot
    Dec 18 '18 at 19:53
















2















I searched for problems like this, but couldn't find any approach. Then, I don't believe this is a duplicated question.



The question is: how to draw section-size arrow marks (like the one shown in the picture) using tikz.



enter image description here










share|improve this question























  • Sorry, what does section-sized mean? Try documentclass[tikz,border=3.14mm]{standalone} begin{document} begin{tikzpicture} node (tmp) {$phi$}; draw (tmp.north east) -- ++ (-3,0); draw (tmp.south east) -- ++ (-3,0); draw[<-] (tmp.north) -- ++ (0,0.5); draw[<-] (tmp.south) -- ++ (0,-0.5); end{tikzpicture} end{document}.

    – marmot
    Dec 18 '18 at 19:37











  • Hi @marmot. I mean that I would like to draw those couple of arrows that point to each other indicating the size of a section (because is generally used to point diameter of pipes, etc). I know how to draw them separately... but is there a way to draw at once using a simple code?

    – Brasil
    Dec 18 '18 at 19:42











  • I guess I got most confused by the fact that section has several meanings. So you are talking about diameters, and not the things that come with the section command, right?

    – marmot
    Dec 18 '18 at 19:45






  • 1





    Yes. That is exactly what I mean @marmot :)

    – Brasil
    Dec 18 '18 at 19:46











  • How about this answer?

    – marmot
    Dec 18 '18 at 19:53














2












2








2


0






I searched for problems like this, but couldn't find any approach. Then, I don't believe this is a duplicated question.



The question is: how to draw section-size arrow marks (like the one shown in the picture) using tikz.



enter image description here










share|improve this question














I searched for problems like this, but couldn't find any approach. Then, I don't believe this is a duplicated question.



The question is: how to draw section-size arrow marks (like the one shown in the picture) using tikz.



enter image description here







tikz-pgf tikz-arrows






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 18 '18 at 19:15









BrasilBrasil

3831312




3831312













  • Sorry, what does section-sized mean? Try documentclass[tikz,border=3.14mm]{standalone} begin{document} begin{tikzpicture} node (tmp) {$phi$}; draw (tmp.north east) -- ++ (-3,0); draw (tmp.south east) -- ++ (-3,0); draw[<-] (tmp.north) -- ++ (0,0.5); draw[<-] (tmp.south) -- ++ (0,-0.5); end{tikzpicture} end{document}.

    – marmot
    Dec 18 '18 at 19:37











  • Hi @marmot. I mean that I would like to draw those couple of arrows that point to each other indicating the size of a section (because is generally used to point diameter of pipes, etc). I know how to draw them separately... but is there a way to draw at once using a simple code?

    – Brasil
    Dec 18 '18 at 19:42











  • I guess I got most confused by the fact that section has several meanings. So you are talking about diameters, and not the things that come with the section command, right?

    – marmot
    Dec 18 '18 at 19:45






  • 1





    Yes. That is exactly what I mean @marmot :)

    – Brasil
    Dec 18 '18 at 19:46











  • How about this answer?

    – marmot
    Dec 18 '18 at 19:53



















  • Sorry, what does section-sized mean? Try documentclass[tikz,border=3.14mm]{standalone} begin{document} begin{tikzpicture} node (tmp) {$phi$}; draw (tmp.north east) -- ++ (-3,0); draw (tmp.south east) -- ++ (-3,0); draw[<-] (tmp.north) -- ++ (0,0.5); draw[<-] (tmp.south) -- ++ (0,-0.5); end{tikzpicture} end{document}.

    – marmot
    Dec 18 '18 at 19:37











  • Hi @marmot. I mean that I would like to draw those couple of arrows that point to each other indicating the size of a section (because is generally used to point diameter of pipes, etc). I know how to draw them separately... but is there a way to draw at once using a simple code?

    – Brasil
    Dec 18 '18 at 19:42











  • I guess I got most confused by the fact that section has several meanings. So you are talking about diameters, and not the things that come with the section command, right?

    – marmot
    Dec 18 '18 at 19:45






  • 1





    Yes. That is exactly what I mean @marmot :)

    – Brasil
    Dec 18 '18 at 19:46











  • How about this answer?

    – marmot
    Dec 18 '18 at 19:53

















Sorry, what does section-sized mean? Try documentclass[tikz,border=3.14mm]{standalone} begin{document} begin{tikzpicture} node (tmp) {$phi$}; draw (tmp.north east) -- ++ (-3,0); draw (tmp.south east) -- ++ (-3,0); draw[<-] (tmp.north) -- ++ (0,0.5); draw[<-] (tmp.south) -- ++ (0,-0.5); end{tikzpicture} end{document}.

– marmot
Dec 18 '18 at 19:37





Sorry, what does section-sized mean? Try documentclass[tikz,border=3.14mm]{standalone} begin{document} begin{tikzpicture} node (tmp) {$phi$}; draw (tmp.north east) -- ++ (-3,0); draw (tmp.south east) -- ++ (-3,0); draw[<-] (tmp.north) -- ++ (0,0.5); draw[<-] (tmp.south) -- ++ (0,-0.5); end{tikzpicture} end{document}.

– marmot
Dec 18 '18 at 19:37













Hi @marmot. I mean that I would like to draw those couple of arrows that point to each other indicating the size of a section (because is generally used to point diameter of pipes, etc). I know how to draw them separately... but is there a way to draw at once using a simple code?

– Brasil
Dec 18 '18 at 19:42





Hi @marmot. I mean that I would like to draw those couple of arrows that point to each other indicating the size of a section (because is generally used to point diameter of pipes, etc). I know how to draw them separately... but is there a way to draw at once using a simple code?

– Brasil
Dec 18 '18 at 19:42













I guess I got most confused by the fact that section has several meanings. So you are talking about diameters, and not the things that come with the section command, right?

– marmot
Dec 18 '18 at 19:45





I guess I got most confused by the fact that section has several meanings. So you are talking about diameters, and not the things that come with the section command, right?

– marmot
Dec 18 '18 at 19:45




1




1





Yes. That is exactly what I mean @marmot :)

– Brasil
Dec 18 '18 at 19:46





Yes. That is exactly what I mean @marmot :)

– Brasil
Dec 18 '18 at 19:46













How about this answer?

– marmot
Dec 18 '18 at 19:53





How about this answer?

– marmot
Dec 18 '18 at 19:53










2 Answers
2






active

oldest

votes


















6














tikz-dimline was designed for this pourpose. Following code is an example from its documentation.



documentclass[tikz, border=2mm]{standalone}
usepackage{tikz-dimline}

begin{document}
begin{tikzpicture}[scale=0.5]
draw[help lines] (-1,-1) grid (4,7);
draw (0,0) -- (0,4) -- (.5,4) -- (.5,5) -- (1.,5) -- (1.,4) -- (1.5,4) -- (1.5,0)
-- cycle;
dimline[color=blue,
extension start length=-0.25, extension end length=-0.25]{(2.75,0)}{(2.75,4)}{4.0};
dimline[color=red,
line style={arrows=dimline reverse-dimline reverse},
label style={above=0.8ex,font=tiny},
extension start length=1,
extension end length=1]{(0.5,5.6)}{(1.0,5.6)}{0.5};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer































    5














    An other approach using the To path operation :



    documentclass[border=5mm,tikz]{standalone}
    usetikzlibrary{arrows.meta,calc}
    tikzset{
    diameter/.style={to path={},
    execute at end to={
    draw[Stealth-](tikztostart)--($(tikztostart)!-0.5cm!(tikztotarget)$);
    draw[Stealth-](tikztotarget)--($(tikztotarget)!-0.5cm!(tikztostart)$);
    path (tikztostart)--(tikztotarget) tikztonodes;
    },
    }
    }
    begin{document}
    begin{tikzpicture}
    draw(0,0)--(2,0);
    draw(0,1)--(2,1);
    path[diameter] (0.5,0)to node{(phi)}(1,1);

    path[diameter] (1.5,0)to node{(phi)}(1.5,1);

    end{tikzpicture}

    end{document}


    enter image description here






    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%2f466417%2fhow-to-draw-section-size-arrows-using-tikz%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      6














      tikz-dimline was designed for this pourpose. Following code is an example from its documentation.



      documentclass[tikz, border=2mm]{standalone}
      usepackage{tikz-dimline}

      begin{document}
      begin{tikzpicture}[scale=0.5]
      draw[help lines] (-1,-1) grid (4,7);
      draw (0,0) -- (0,4) -- (.5,4) -- (.5,5) -- (1.,5) -- (1.,4) -- (1.5,4) -- (1.5,0)
      -- cycle;
      dimline[color=blue,
      extension start length=-0.25, extension end length=-0.25]{(2.75,0)}{(2.75,4)}{4.0};
      dimline[color=red,
      line style={arrows=dimline reverse-dimline reverse},
      label style={above=0.8ex,font=tiny},
      extension start length=1,
      extension end length=1]{(0.5,5.6)}{(1.0,5.6)}{0.5};
      end{tikzpicture}
      end{document}


      enter image description here






      share|improve this answer




























        6














        tikz-dimline was designed for this pourpose. Following code is an example from its documentation.



        documentclass[tikz, border=2mm]{standalone}
        usepackage{tikz-dimline}

        begin{document}
        begin{tikzpicture}[scale=0.5]
        draw[help lines] (-1,-1) grid (4,7);
        draw (0,0) -- (0,4) -- (.5,4) -- (.5,5) -- (1.,5) -- (1.,4) -- (1.5,4) -- (1.5,0)
        -- cycle;
        dimline[color=blue,
        extension start length=-0.25, extension end length=-0.25]{(2.75,0)}{(2.75,4)}{4.0};
        dimline[color=red,
        line style={arrows=dimline reverse-dimline reverse},
        label style={above=0.8ex,font=tiny},
        extension start length=1,
        extension end length=1]{(0.5,5.6)}{(1.0,5.6)}{0.5};
        end{tikzpicture}
        end{document}


        enter image description here






        share|improve this answer


























          6












          6








          6







          tikz-dimline was designed for this pourpose. Following code is an example from its documentation.



          documentclass[tikz, border=2mm]{standalone}
          usepackage{tikz-dimline}

          begin{document}
          begin{tikzpicture}[scale=0.5]
          draw[help lines] (-1,-1) grid (4,7);
          draw (0,0) -- (0,4) -- (.5,4) -- (.5,5) -- (1.,5) -- (1.,4) -- (1.5,4) -- (1.5,0)
          -- cycle;
          dimline[color=blue,
          extension start length=-0.25, extension end length=-0.25]{(2.75,0)}{(2.75,4)}{4.0};
          dimline[color=red,
          line style={arrows=dimline reverse-dimline reverse},
          label style={above=0.8ex,font=tiny},
          extension start length=1,
          extension end length=1]{(0.5,5.6)}{(1.0,5.6)}{0.5};
          end{tikzpicture}
          end{document}


          enter image description here






          share|improve this answer













          tikz-dimline was designed for this pourpose. Following code is an example from its documentation.



          documentclass[tikz, border=2mm]{standalone}
          usepackage{tikz-dimline}

          begin{document}
          begin{tikzpicture}[scale=0.5]
          draw[help lines] (-1,-1) grid (4,7);
          draw (0,0) -- (0,4) -- (.5,4) -- (.5,5) -- (1.,5) -- (1.,4) -- (1.5,4) -- (1.5,0)
          -- cycle;
          dimline[color=blue,
          extension start length=-0.25, extension end length=-0.25]{(2.75,0)}{(2.75,4)}{4.0};
          dimline[color=red,
          line style={arrows=dimline reverse-dimline reverse},
          label style={above=0.8ex,font=tiny},
          extension start length=1,
          extension end length=1]{(0.5,5.6)}{(1.0,5.6)}{0.5};
          end{tikzpicture}
          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 18 '18 at 19:35









          IgnasiIgnasi

          92.3k4166305




          92.3k4166305























              5














              An other approach using the To path operation :



              documentclass[border=5mm,tikz]{standalone}
              usetikzlibrary{arrows.meta,calc}
              tikzset{
              diameter/.style={to path={},
              execute at end to={
              draw[Stealth-](tikztostart)--($(tikztostart)!-0.5cm!(tikztotarget)$);
              draw[Stealth-](tikztotarget)--($(tikztotarget)!-0.5cm!(tikztostart)$);
              path (tikztostart)--(tikztotarget) tikztonodes;
              },
              }
              }
              begin{document}
              begin{tikzpicture}
              draw(0,0)--(2,0);
              draw(0,1)--(2,1);
              path[diameter] (0.5,0)to node{(phi)}(1,1);

              path[diameter] (1.5,0)to node{(phi)}(1.5,1);

              end{tikzpicture}

              end{document}


              enter image description here






              share|improve this answer




























                5














                An other approach using the To path operation :



                documentclass[border=5mm,tikz]{standalone}
                usetikzlibrary{arrows.meta,calc}
                tikzset{
                diameter/.style={to path={},
                execute at end to={
                draw[Stealth-](tikztostart)--($(tikztostart)!-0.5cm!(tikztotarget)$);
                draw[Stealth-](tikztotarget)--($(tikztotarget)!-0.5cm!(tikztostart)$);
                path (tikztostart)--(tikztotarget) tikztonodes;
                },
                }
                }
                begin{document}
                begin{tikzpicture}
                draw(0,0)--(2,0);
                draw(0,1)--(2,1);
                path[diameter] (0.5,0)to node{(phi)}(1,1);

                path[diameter] (1.5,0)to node{(phi)}(1.5,1);

                end{tikzpicture}

                end{document}


                enter image description here






                share|improve this answer


























                  5












                  5








                  5







                  An other approach using the To path operation :



                  documentclass[border=5mm,tikz]{standalone}
                  usetikzlibrary{arrows.meta,calc}
                  tikzset{
                  diameter/.style={to path={},
                  execute at end to={
                  draw[Stealth-](tikztostart)--($(tikztostart)!-0.5cm!(tikztotarget)$);
                  draw[Stealth-](tikztotarget)--($(tikztotarget)!-0.5cm!(tikztostart)$);
                  path (tikztostart)--(tikztotarget) tikztonodes;
                  },
                  }
                  }
                  begin{document}
                  begin{tikzpicture}
                  draw(0,0)--(2,0);
                  draw(0,1)--(2,1);
                  path[diameter] (0.5,0)to node{(phi)}(1,1);

                  path[diameter] (1.5,0)to node{(phi)}(1.5,1);

                  end{tikzpicture}

                  end{document}


                  enter image description here






                  share|improve this answer













                  An other approach using the To path operation :



                  documentclass[border=5mm,tikz]{standalone}
                  usetikzlibrary{arrows.meta,calc}
                  tikzset{
                  diameter/.style={to path={},
                  execute at end to={
                  draw[Stealth-](tikztostart)--($(tikztostart)!-0.5cm!(tikztotarget)$);
                  draw[Stealth-](tikztotarget)--($(tikztotarget)!-0.5cm!(tikztostart)$);
                  path (tikztostart)--(tikztotarget) tikztonodes;
                  },
                  }
                  }
                  begin{document}
                  begin{tikzpicture}
                  draw(0,0)--(2,0);
                  draw(0,1)--(2,1);
                  path[diameter] (0.5,0)to node{(phi)}(1,1);

                  path[diameter] (1.5,0)to node{(phi)}(1.5,1);

                  end{tikzpicture}

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 18 '18 at 20:35









                  Hafid BoukhouldaHafid Boukhoulda

                  2,2091517




                  2,2091517






























                      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%2f466417%2fhow-to-draw-section-size-arrows-using-tikz%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

                      Сан-Квентин

                      8-я гвардейская общевойсковая армия

                      Алькесар