Graphics, Figures & Tablespic[...] angle{...} question

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
topsquark
Posts: 71
Joined: Wed Oct 05, 2022 10:30 pm

pic[...] angle{...} question

Post by topsquark »

I have a quick TikZ formatting question. The following code puts the angle where I want it just fine. But I have to set coordinates for (A), (B), and (C).

Code: Select all

\usetikzlibrary{angles, quotes}
\begin{tikzpicture}
     \coordinate (A) at (0,3.5);
     \coordinate (B) at (0,1);
     \coordinate (C) at (-0.48,2.93);
     \draw [dashed] (A) -- (B) -- (C);
     \path pic[angle radius=2cm,"$\theta$"] {angle = A--B--C};
\end{tikzpicture}
Is it possible to replace the path line using the actual coordinates without defining them? ie. Can I somehow substitute angle = A--B--C with angle = (0,3.5)--(0,1)--(-0.48,2.93)?

Thanks!
-Dan

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

pic[...] angle{...} question

Post by Stefan Kottwitz »

Hi Dan,

unfortunately, they have to be coordinate names. From the TikZ manual:
The three points A, B, and C must be the names of nodes or coordinates; you cannot use direct
coordinates like “(1,1)” here.
Stefan
LaTeX.org admin
topsquark
Posts: 71
Joined: Wed Oct 05, 2022 10:30 pm

pic[...] angle{...} question

Post by topsquark »

Ah well. I was hoping to simplify the code a bit. But it's not a big deal.

Thanks for the information!

-Dan
Post Reply