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

  • 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

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

\documentclass[tikz, border=2mm]{standalone}

\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;
extension start length=-0.25, extension end length=-0.25]{(2.75,0)}{(2.75,4)}{4.0};
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};

enter image description here


An other approach using the To path operation :

        diameter/.style={to path={},
                        execute at end to={
                        \path (\tikztostart)--(\tikztotarget) \tikztonodes;
        \path[diameter] (0.5,0)to node{\(\phi\)}(1,1);

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



enter image description here

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.