Forgot password?
 Register account
View 611|Reply 5

意外发现 coordinate 后重新定义的同名称并不冲突

[Copy link]

770

Threads

4692

Posts

310K

Credits

Credits
35048

Show all posts

isee Posted 2021-5-31 21:10 |Read mode
定义交点 name intersections 时重复,发现重复后之前的不影响,之后的用新定义

TiKZ

686

Threads

110K

Posts

910K

Credits

Credits
91229
QQ

Show all posts

kuing Posted 2021-5-31 23:53
给个 example 呗

770

Threads

4692

Posts

310K

Credits

Credits
35048

Show all posts

 Author| isee Posted 2021-6-1 00:01
回复 2# kuing


\coordinate [label=below:{A}] (a) at (0,0);
\coordinate [label=below:{B}] (b) at (2,0);
\draw (a)--(b);
\coordinate [label=below:{C}] (b) at (0,2);
\draw (a)--(b);

686

Threads

110K

Posts

910K

Credits

Credits
91229
QQ

Show all posts

kuing Posted 2021-6-1 00:15
回复 3# isee

原来是这个意思……
不过……这其实不难发现吧,也没什么不合理之处……

我顺便说一个,其实这样玩也不会报错:
  1. \begin{tikzpicture}
  2. \coordinate [label=below:{A}] (a) at (0,0);
  3. \coordinate [label=below:{B}] (b) at (2,0);
  4. \draw (a)--(b);
  5. \coordinate [label=below:{C}] (b) at (0,2);
  6. \draw[blue] (a)--(b);
  7. \end{tikzpicture}
  8. \begin{tikzpicture}
  9. \draw[red] (a)--(b);
  10. \end{tikzpicture}
Copy the Code
效果: QQ截图20210601001825.png
也就是说 coordinate 的点在下一个图其实还可以继续用。

770

Threads

4692

Posts

310K

Credits

Credits
35048

Show all posts

 Author| isee Posted 2021-6-1 00:18
回复 4# kuing


    晕迷哦,看来作者很有想法~

770

Threads

4692

Posts

310K

Credits

Credits
35048

Show all posts

 Author| isee Posted 2021-6-1 00:19
TiKZ 相当宽松,基本上顺序无关,基本上随时“添什么东西”都没太问题

Mobile version|Discuz Math Forum

2025-5-31 11:20 GMT+8

Powered by Discuz!

× Quick Reply To Top Edit