0

The "measurement of length of a line" in my question is the part highlighted by a green rectangle in the following figure: enter image description here

Now, I am drawing the elements (i.e. two arrows, two ends, 8) of the measurement separately. It is tedious. I wonder are there simple ways to draw these measurements? For example, \somecommand [<->, offset=x mm, "text"] (point1) -- (point2), namely \somecommand [<->, offset=2mm, "4"] (A) -- (D) or \somecommand [<->, offset=2mm, "8"] (B) -- (C) in the above figure. I would appreciate any help with this situation.

  • 2
    Maybe https://tex.stackexchange.com/questions/14901/dimensioning-of-a-technical-drawing-in-tikz can help? (there is a pakage too, https://www.ctan.org/tex-archive/graphics/pgf/contrib/tikz-dimline?lang=en) – Rmano Jun 18 '21 at 08:17
  • Dear @Rmano: This information is very useful. Thank you very much! – lightweight Jun 21 '21 at 00:55

1 Answers1

2

In case you'd be interested, it uses a short code with pstricks:

\documentclass[ border=3pt]{standalone}
\usepackage{pst-eucl}%,

\begin{document}

\begin{pspicture}(-0.5,-0.5)(8.5,4.5) \psset{ labelsep=0.8ex, linejoin=1, RightAngleSize=0.25, tbarsize=8pt, arrowinset=0.1} \pstGeonodePointSymbol=none, PosAngle={180,180,0,0}{A}(0,0){B}(8,0){C}(7,4){D} \psline(A)(B)(C)(D)(A)% \pnodes{H}(4,4)(4,0)\pcline(H0)(H1)\ncput{4} \pstRightAngle{D}{H0}{H1} \pstRightAngle{C}{H1}{H0} \psset{offset=1.6ex} \pcline{|<->|}(A)(D)\ncput{4} \pcline{|<->|}(C)(B)\ncput*{8} \end{pspicture}

\end{document}

enter image description here

Bernard
  • 271,350