How I can change the distance dimension like the picture below. In the \dim={add dim, distance} have two parameter I want to add 1 parameter for distance of dimesion like picture 1 , and rolate the text in picture 2. enter image description here

enter image description here


      distance2/ .initial=10pt

\pgfdeclaredecoration{add dim}{final}{

\tikzset{dim/.style args={#1,#2,#3}{decoration={add dim,distance=#2},
                postaction={decorate,decoration={text along path,
                                                 text align={align=center},

\coordinate (A) at (0,0);
\coordinate (B) at (4,2);

\draw[dim={35 cm,34pt,34pt}]  (A) --  (B); 

\draw[fill=gray] (A) circle(2pt); 
\draw[fill=gray] (B) circle(2pt);


  • What is the difference between #2 and #3. – Symbol 1 Jul 20 '17 at 12:00
  • And what is distance2 for? – cfr Jul 20 '17 at 18:43
  • distance2 is #3 it's dist in the code. – Le Quan Plus Jul 21 '17 at 7:38

Your Answer

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

Browse other questions tagged or ask your own question.