summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tzplot/tzplot-doc-C-v2.1.tex
blob: e717bd68c26302551f9c7fc2d75caaf9f60c74fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
%!TEX root = tzplot-doc.tex
%\begin{document}

%%%==========================
\part{Points, Lines, and Curves}
%%%==========================
\label{p:linesandcurves}


%%==================================
\chapter{Getting Ready}
\label{c:gettingready}

%%------------------------------------------------------------
\section{Styles: \texttt{tzdotted}, \texttt{tzdashed}, \texttt{tzhelplines}}
\label{s:styles:tzhelplines}

The styles \ixttw{tzdotted}, \ixttw{tzdashed}, and \ixttw{tzhelplines} are defined as follows:

\begin{tzsty}
% styles: tzdotted, tzdashed, tzhelplines
\tikzset{%
  tzdotted/.style={line cap=round,dash pattern=on 0pt off 1cm/(#1)},
  tzdotted/.default=10
}
\tikzset{%
  tzdashed/.style={dashed=none,dash pattern=on 5mm/(#1) off 5mm/(#1)},
  tzdashed/.default=10
}
\tikzset{%
  tzhelplines/.style={help lines,-,tzdotted}
}
\end{tzsty}

The styles |tzdotted| and |tzdashed| print 10 dots and 10 dashes per 1cm, respectively, by default.
The style |tzhelplines| uses |tzdotted| by default.


%%------------------------------------------------------------
\section{\protect\cmd{\tzhelplines}, \protect\cmd{\tzhelplines*}}
\label{s:tzhelplines}

\icmd{\tzhelplines} draws |grid| from the first coordinate to the second coordinate.
If only one coordinate is specified, then the first coordinate is regarded as |(0,0)|.

The starred version \icmd{\tzhelplines*} uses the grid as a \iisw{bounding box}.

\begin{tzdef}
% syntax: minimum
\tzhelplines(<coor>)
% syntax: full
\tzhelplines[<opt>](<coor1>)(<coor2>)
% defaults
  [help lines,tzdotted=10](<m>)()
% (<m>): mandatory argument
\end{tzdef}

Here, |(|\ixxw{<m>}|)| stands for a \xem{mandatory} argument.

\begin{tztikz}
\tzhelplines(4,3)      % works similarly to:
  \draw [help lines] (0,0) grid (4,3);

\tzhelplines(1,1)(4,3) % works similarly to:
  \draw [help lines] (1,1) grid (4,3);
\end{tztikz}


By default, |\tzhelplines| prints |grid| with |10| dots per |1cm|.
|\tzhelplines| with the option value |[tzdotted=<n>]| prints |<n>| dots per |1cm|.
(That is, the default value is |tzdotted=10|.)

\begin{tzcode}{.3}
% \tzhelplines
\begin{tikzpicture}
\tzhelplines(2,2)
\draw [help lines] (3,0) grid (5,2);
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% tzdotted: (default: 10 dots per 1cm)
\begin{tikzpicture}
\tzhelplines[thick](1,2)                  % 10 dots
\tzhelplines[thick,tzdotted=20](2,0)(3,2) % 20 dots
\tzhelplines[thick,tzdotted=5](4,0)(5,2)  %  5 dots
\end{tikzpicture}
\end{tzcode}

With the option value, |[tzdotted=<n>/<d>]|, |\tzhelplines| prints |<n>| dots per |<d>cm|.

Similarly for |tzdashed|.

\begin{tzcode}{.3}
% tzdotted, tzdashed
\begin{tikzpicture}
\tzhelplines[thick,tzdashed](4,2)
\tzhelplines[thick,step=.5](4,2)
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
% scaled: 7 dots per .7cm (10 dots per hard 1cm)
\begin{tikzpicture}[scale=.7]
\tzhelplines[tzdashed](4,3)
\tzhelplines[step=.5](4,3)
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
% scaled: 10/.7 means 10 dots per .7cm
\begin{tikzpicture}[scale=.7]
\tzhelplines[tzdashed=10/.7](4,3)         %%
\tzhelplines[step=.5,tzdotted=10/.7](4,3) %%
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzbbox}: A bounding box}
\label{s:tzbbox}

\icmd{\tzbbox} sets a bounding box.

\begin{tzdef}
% syntax
\tzbbox(<coor1>)(<coor2>)
% defaults
  (0,0)(<m>)
% <m>: mandatory
\end{tzdef}

\begin{tztikz}
\tzbbox(-1,-1)(4,3) % is an abbreviation of:
  \path [ use as bounding box ] (-1,-1) rectangle (4,3);
\end{tztikz}

If only one coordinate is specified, the first coordinate is regarded as |(0,0)|.

%%==================================
\chapter{Dots}
\label{c:dots}

%%------------------------------------------------------------
\section{\protect\cmd{\tzcdot(*)}: A small circle}
\label{s:tzcdot}

A dot is usually expressed by a small circle.
\icmd{\tzcdot} prints a circle dot \tikz \tzcdot(0,0);.

The starred version \icmd{\tzcdot*} prints a filled circle dot \tikz \tzcdot*(0,0);.
The \xem{radius} of the circle is |1.2pt|, by default.

\begin{tzdef}
% syntax: minimum
\tzcdot(<coor>)
% syntax: medium
\tzcdot*(<coor>){<label>}[<angle>](<radius>)
% syntax: full
\tzcdot*[<opt>]<shift coor>(<coor>){<label>}[<[label opt]angle>](<radius>)
% defaults
 *[ solid,thin,tzcdot=1.2pt ]<>(<m>){}[](1.2pt)
% tzcdot is a predefined key (in this package).
% <m>: mandatory
\end{tzdef}

Here, |(|\ixxw{<m>}|)| stands for a \xem{mandatory} argument. All others are optional arguments.

\paragraph{How to change the size}
There are \textsc{Three Ways} to change the \xem{radius} of a circle dot drawn by |\tzcdot|.

\begin{enumerate}
\item The simplest way is to use the \xem{last parenthesis option}, like |\tzcdot(0,0)(3pt)|.

\begin{tztikz}
\tzcdot(0,0)       % is an abbreviation of:
  \draw (0,0) circle (1.2pt); % default radius=1.2pt
\end{tztikz}

\begin{tztikz}
\tzcdot*(0,0)(3pt) % is an abbreviation of:
  \draw [fill] (0,0) circle (3pt);
\end{tztikz}

\item
You can use the key-value option |[tzcdot=<dim>]|, like |\tzcdot[tzcdot=3pt](0,0)|,  to change the \xem{radius} of a circle dot. The |tzcdot| key is defined in the package.
If both the |tzcdot| key-value and the last parenthesis option are used, the former wins.

\begin{tztikz}
\tzcdot*(1,1) % works like:
  \draw [fill] (1,1) circle [radius=1.2pt]; % default radius=1.2pt
\end{tztikz}

\begin{tztikz}
\tzcdot*[tzcdot=3pt] % works like:
  \draw [fill] (0,0) circle [radius=3pt];
\end{tztikz}

\begin{tzcode}{.3}
% \tzcdot(*)
\begin{tikzpicture}
\tzhelplines(4,2)
\tzcdot(0,0)        \tzcdot[tzcdot=4pt](1,1)
\tzcdot*(2,1)(2pt)  \tzcdot*(3,0)(3pt)
\end{tikzpicture}
\end{tzcode}

\item 
Another way to change the radius is to use a macro, like |\settzcdotradius{3pt}|.
It is effective within the |tizpicture| environment unless changed by \icmd{\settzcdotradius} again.

\begin{tzcode}{.3}
% \settzcdotradius
\begin{tikzpicture}
\tzhelplines(4,2)
\settzcdotradius{4pt}
\tzcdot(0,0)        \tzcdot(1,1)
\tzcdot*(2,1)(2pt)  \tzcdot*(3,0)
\end{tikzpicture}
\end{tzcode}

\end{enumerate}


\paragraph{How to label}
You can add a label to a specified coordinate by adding the optional argument |{<label>}| immediately after |(<coor>)|. You can also change the |{<label>}| position by the option |[<angle>]|.

\begin{tztikz}
\tzcdot(0,0){A} % is an abbreviation of:
  \draw (0,0) circle (1.2pt) node [label={:A}] {};

\tzcdot(0,0)(2pt){A}[[blue]0] % is an abbreviation of:
  \draw (0,0) circle (2pt) node [label={[blue]0:A}] {};
\end{tztikz}

\begin{tzcode}{.3}
% \tzcdot: labels
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcdot(0,0){A} % default position: 90 or above
\tzcdot[tzcdot=4pt](1,1){B}[0]
\tzcdot*(2,1){C}[45](2pt)
\tzcdot*(3,0){D}[-90](3pt)
\tzcdot(4,3){E}[-90](6pt)
\end{tikzpicture}
\end{tzcode}

In \Tikz, the distance from the coordinate center to a label does not depend on the size of circle dots.

\paragraph{How to change colors}
With the first optional argument |[<opt>]|, you can change the color of a dot.
You can also change the color of a label, as shown in the following example.

\begin{tzcode}{.3}
% \tzcdot(*): color, fill
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,3);
\tzcdot(0,0){A}
\tzcdot*[red](1,0){\textbf{B}}[45]
\tzcdot*[red,fill=green](2,1){green}[[blue]0](10pt)
\tzcdot[tzcdot=2*7pt](3,2){big}[center]
\tzcdot*[fill=red,text=blue](4,3){D}(2*3pt)
\end{tikzpicture}
\end{tzcode}


\paragraph{Shift}
Dots can be shifted by specifying the optional argument |<shift coor>| immediately before |(<coor>)|. The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcdot: shift
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,3);
\tzcdot(0,0){A}
\tzcdot*[red]<0,2>(1,0){\textbf{B}}[45] % shift
\tzcdot*[red,fill=green](2,1){green}[[blue]0](10pt)
\tzcdot[tzcdot=2*7pt]<1,-1>(3,2){big}[center] % shift
\tzcdot*[fill=red,text=blue](4,3){D}(2*3pt)
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
% \tzcdot: repeated
\begin{tikzpicture}
\tzhelplines(4,2)
\foreach \x in {0,...,4}
  { \foreach \A in {2,4,6,8}
      { \tzcdot[blue]    (\x,0)(\A pt) } }
\foreach \x in {0,...,4}
  { \foreach \A in {2,4,6,8}
      { \tzcdot[red]<1,1>(\x,0)(\A pt) } } % shift
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzcdots(*)}: Multiple circle dots}
\label{s:tzcdots}

The macro \icmd{\tzcdots} takes an \xem{arbitrary number of coordinates} as arguments to print multiple circle dots with the radius |1.2pt|, by default.
You need to indicate when the iteration of an arbitrary number of coordinates ends, by typing a \xem{semicolon} |;|.
Let us call this kind of macro a \iisw{semicolon version} macro.

\remark
\begin{itemize}
\item DO NOT FORGET to enter `|;|' at the end of iteration.
\item Without the semicolon |;|, an error occurs with the the \iisw{error message}:
  \begin{verbatim}
  ! Package tzplot Error: You may have forgotten a semicolon here or above!
  \end{verbatim}
\end{itemize}


The starred version |\tzcdots*| prints multiple filled dots.

\begin{tzdef}
% syntax: minimum
\tzcdots*(<coor>)(<coor>)..repeated..(<coor>) ;
% syntax: full
\tzcdots*[<opt>]<shift coor> (<coor>){<label>}[<[label opt]angle>]
                            ..repeated.. (){}[] ; (<dot radius>)
% defaults
 *[tzcdot=1.2pt]<>(<m>){}[]..repeated..(){}[] ; (1.2pt)
\end{tzdef}

\begin{tzcode}{.3}
% \tzcdots(*)
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcdots(0,0)(1,1)(2,1)(3,2)(4,0);
\tzcdots*(0,3)(1,2)(2,2)(3,3)(4,3); % semicolon
\end{tikzpicture}
\end{tzcode}

\paragraph{How to label}

Each coordinate can be followed by the optional arguments |{<label>}| and |[<angle>]| to label dots. So the repeating pattern is the triple |(<coor>){<label>}[<angle>]|. In \Tikz, |<angle>| can have the label option like |<[label opt]angle>|.

\begin{tzcode}{.3}
% \tzcdots: label
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcdots(0,0){A}
        (1,1)
        (2,1){C}[0]
        (3,2){D}[-90]
        (4,0){E}[[red,draw]45];
\tzcdots*(0,3)(1,2){B}[-135](2,2){C}[45](3,3)(4,3);
\end{tikzpicture}
\end{tzcode}

\paragraph{How to change the size of dots}

There are \textsc{Three Ways} of changing the \xem{radius} of dots.
\begin{enumerate}
\item The simplest way is to use the \xem{last} parenthesis optional argument, \xem{after the semicolon}.
\item Another way is to use the \ixxw{tzcdot} key, like |\tzcdots[tzcdot=3pt]...|.
If both options are used the key-value option wins.
\item You can also use the macro \icmd{\settzcdotradius}.
The effect remains within the |tikzpicture| environment unless it is changed again.
\end{enumerate}

\begin{tzcode}{.3}
% \tzcdots: size (radius)
\begin{tikzpicture}
\tzhelplines(4,3)
\settzcdotradius{3pt}
\tzcdots(0,0)(1,0){3pt};
\tzcdots*(1,1)(2,1){1pt};(1pt) % simplest
\tzcdots[tzcdot=5pt](2,2)(3,2){5pt};
\tzcdots*(3,3)(4,3){3pt};
\end{tikzpicture}
\end{tzcode}



\paragraph{How to change colors}

With the first optional argument |[<opt>]|, you can change the color of dots.
You can also change the color of all labels at once using the first optional argument, 
like |\tzcdots[text=red]...| as shown in the following example.

\begin{tzcode}{.3}
% \tzcdots: color
\begin{tikzpicture}
\tzhelplines(4,3)
\settzcdotradius{3pt}
\tzcdots*[red]
  (0,0)(1,1){\textbf{Ben}}[[blue]-90](2,1)(3,0);
\tzcdots*[thick,blue,fill=green,text=red]
  (1,2){A}(2,2){Ben}[[blue]-90](3,2){C}(4,2){D};(4pt)
\tzcdots*[blue]
  (1,3){A}(2,3){B}(3,3){C}(4,3){D};
\end{tikzpicture}
\end{tzcode}

\paragraph{Shift} You can move the coordinates of dots by specifying |<shift coor>| option immediately before the first coordinate.

\begin{tzcode}{.3}
% \tzcdots: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcdots[red] (0,0){A}(1,1)(2,1){C}(3,2){D}[0](4,0){E};
\tzcdots*<0,1>(0,0){A}(1,1)(2,1){C}(3,2){D}[0](4,0){E};
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzdot(*)}: A single node dot}
\label{s:tzdot}

The macro \icmd{\tzdot} prints a small circle node \tikz \tzdot(0,0);, as a dot, with the \xem{diameter} (or |minimum size|) of |2.4pt|, by default.

The starred version \icmd{\tzdot*} prints a filled dot \tikz \tzdot*(0,0);.

\begin{tzdef}
% syntax: minimum
\tzdot(coor)
% syntax: medium
\tzdot*(<coor>){<label>}[<angle>](<dot size>)
% syntax: full
\tzdot*[<node opt>]<shift coor>(<coor>){<label>}[<[label opt]angle>](<dot size>)
% defaults
 *[ tzdot=2.4pt ]<>(<m>){}[](2.4pt)
% the style tzdot is predefined
% (<m>): mandatory
\end{tzdef}

|\tzdot(*)| accepts one mandatory argument, denoted by |(|\ixxw{<m>}|)|. All others are optional.

The style \ixxw{tzdot} is predefined in this package as follows:

\begin{tzsty}
% style: tzdot
\tikzset{
  tzdot/.style={draw,circle,solid,thin,inner sep=0pt,minimum size=#1},
  tzdot/.default=2.4pt
}
\end{tzsty}


\subsection{{\normalfont\scshape Three Ways} to change the size of node dots}
\label{ss:threeways}

There are \iscw{Three Ways} to change the \xem{diameter} (or |minimum size|) of a node dot drawn by |\tzdot(*)|.

\begin{enumerate}
\item Use the predefined style |tzdot| in the first optional agrument, like |\tzdot[tzdot=5pt](0,0)|, which gives the same result as |\tzdot[minimum size=5pt](0,0)|.

\begin{tztikz}
\tzdot(0,0) % works like:
  \path (0,0) node [tzdot=2.4pt] {}; % default size
  % or equivalently
  \node [tzdot,minimum size=2.4pt] at (0,0) {};
\end{tztikz}

\item The simplest way is to use the \xem{last parenthesis optional argument}, like |\tzdot(0,0)(5pt)|, which yields the same result as in |\tzdot[tzdot=5pt](0,0)|.
If both options are used, the |tzdot| (or |minimum size|) option overwrites the last parenthesis option.

\begin{tzcode}{.3}
% \tzdot(*)
\begin{tikzpicture}
\tzhelplines(4,2)
\tzdot(0,0)        \tzdot[tzdot=8pt](1,1)
\tzdot*(2,1)(4pt)  \tzdot*(3,0)(6pt)
\end{tikzpicture}
\end{tzcode}

\item You can use the macro |\settzdotsize| to change the size (or diameter) of all node dots drawn by |\tzdot*|. It is effective within the |tikzpicture| environment unless changed again.

\begin{tzcode}{.3}
% \settzdotsize
\begin{tikzpicture}
\tzhelplines(4,2)
\settzdotsize{8pt}
\tzdot(0,0)        \tzdot(1,1)
\tzdot*(2,1)(4pt)  \tzdot*(3,0)
\end{tikzpicture}
\end{tzcode}

\end{enumerate}

\subsection{How to label}
\label{ss:tzdot:label}

You can add a label to a specified coordinate by specifying the optional argument |{<label>}| immediately after the coordinate |(<coor>)|.
You can also change the label position by the option |[<angle>]| or |[<[label opt]angle>]| following |{<label>}|.

\begin{tztikz}
\tzdot(0,0){A}(3pt)          % works like:
  \path (0,0) node [tzdot=3pt,label={:A}] {};
  
\tzdot*(0,0){A}[[red]0](3pt) % works like:
  \path (0,0) node [fill,tzdot=3pt,label={[red]0:A}] {};
\end{tztikz}


\begin{tzcode}{.3}
% \tzdot: labels
\begin{tikzpicture}
\tzhelplines(4,3)
\tzdot(0,0){A}
\tzdot(1,1){B}[0](8pt)
\tzdot*(2,1){C}[45](4pt)
\tzdot*(3,0){D}[-90](6pt)
\tzdot(4,3){E}[[red,draw]br](12pt) % string replacement
\end{tikzpicture}
\end{tzcode}

\paragraph{String replacement}
(See also Section \ref{ss:string-replacement} on page \pageref{ss:string-replacement}.)
\begin{itemize}\firmlist
\item In \Tikz, to place labels you can use |<angle>| or the positional words such as |[above]|, |[below]|, |[center]| (\xem{not} |[centered]| for the main node option), |[below right]|, and so on.
\item \xem{Just to avoid frequent coding errors}, from the version 2 of the |tzplot| package, you can use the abridged strings |[a]|, |[b]|, |[c]|, |[br]|, and so on.
\item So |[[blue,draw]-45]|, |[[blue,draw]below right]|, and |[[blue,draw]br]| give the same result.
\end{itemize}

Unlike |\tzcdot|, the |\tzdot|'s label position depends on the size of a circle node. In \Tikz\ jargon, |{<label>}| is in a \iisw{label node} for a \iisw{main node} that is a circle node with no text in it, so |<label>| moves accordingly as the main node dot gets bigger or smaller.


\subsection{How to change colors and shapes}
\label{ss:tzdot:color}

With the first optional argument |[<node opt>]|, you can change of the color or shape of dots.
You can also change the label color using |[<label opt>]| as shown in the following example.

\remark 
\begin{itemize}\firmlist
\item |[<node opt>]| is for options of \xem{main nodes}, |[<label opt>]| is for options of \xem{label nodes}.
\item |[<label opt>]| is used in the form of |[<[<label opt>]angle>]|.
\end{itemize}

\begin{tzcode}{.3}
% \tzdot: color
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,3);
\tzdot(0,0){A}
\tzdot*[red](1,0){\textbf{B}}[45]
\tzdot*[red,fill=green](2,1){green}[[blue]0](2*10pt)
\tzdot[tzdot=4*7pt](3,2){big}[center]
\tzdot*[fill=red](4,3){D}(4*3pt)
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% \tzdot: shape
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,3);
\tzdot[regular polygon](0,0){A}(10pt)
\tzdot*[red](1,0){\textbf{B}}[45]
\tzdot*[red,green,rectangle](2,1){green}[0](2*10pt)
\tzdot[tzdot=4*7pt](3,2){big}[center]
\tzdot*[fill=red,star](4,3){D}(4*3pt)
\end{tikzpicture}
\end{tzcode}



\subsection{How to move: \texttt{shift}}
\label{ss:tzdot:shift}

Dots can be shifted by specifying the optional argument |<shift coor>| immediately before |(<coor>)|. The empty shift option |<>| is not allowed.

\begin{tzcode}{.3}
% \tzdot: shift
\begin{tikzpicture}
\draw [help lines] (0,0) grid (4,3);
\tzdot[regular polygon](0,0){A}(10pt)
\tzdot*[red]<0,2>(1,0){\textbf{B}-shifted}[45] % shift
\tzdot*[red,green,rectangle](2,1){green}[0](2*10pt)
\tzdot[tzdot=4*7pt]<1,-1>(3,2){big}[center]    % shift
\tzdot*[fill=red,star](4,3){D}(4*3pt)
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% \tzdot: repeated
\begin{tikzpicture}
\tzhelplines(4,2)
\foreach \x in {0,...,4}
  { \foreach \A in {1,2,3,4}
      { \tzdot[blue]      (\x,0)(2*\A mm) } }
\foreach \x in {0,...,4}
  { \foreach \A in {1,2,3,4}
      { \tzdot[green]<1,1>(\x,0)(2*\A mm) } }  % shift
\end{tikzpicture}
\end{tzcode}


\subsection{Comparison: \protect\cmd{\tzdot} and \protect\cmd{\tzcdot}}
\label{ss:tzdot:comparison}

The most important difference between |\tzcdot| and |\tzdot| is that |\tzcdot| is affected by \Tikz's scaling factor, but |\tzdot| is not.
This is critical when |xscale| is not equal to |yscale|.

\begin{tzcode}{.3}
\begin{tikzpicture}[xscale=1.6,yscale=.8]
\tzhelplines(3,3)
\tzcdot(0,0)(3pt)              % dostorted
\tzdot(1,0)(6pt)
\tzcdots*(1,1)(2,1)(3,1);(2pt) % distorted
\tzdots*(1,2)(2,2)(3,2);(4pt)
\end{tikzpicture}
\end{tzcode}

The following table further shows the differences between them.
%Everything else is the same for end-users.

\begin{tzcode}{.3}[listing only,colback=green!10!white]
% concept       % single  % multi    % size control     % [key=default size]
node [circle]   \tzdot    \tzdots    \settzdotsize      [tzdot=2.4pt]  % diameter
circle          \tzcdot   \tzcdots   \settzcdotradius   [tzcdot=1.2pt] % radius
\end{tzcode}

\remark 
\begin{itemize}\firmlist
\item In \Tikz, a `node' is `not' affected by `scaling' unless the \Tikz\ option |transform shape| is used together.
|\tzdot| is also useful for labelling a large dot.
  \begin{itemize}
  \item In |\tzdot|, |<label>| is a label in a \iisw{label node} for a node dot (as a \iisw{main node}).
  So if a main node dot gets larger or smaller, its label moves accordingly. 
  (Unlike, the labels with |\tzcdot| or |\tzcdots|.)
  \item The position of |<label>| in |\tzcdot| does not depend on the size of dots.
  \end{itemize}
\item The package |tzplot| takes |\tzdot| as a \xem{standard dot}, not |\tzcdot|.
So, you can apply the \threeways\ (on page \pageref{ss:threeways}) to change the size of any standard dots.
\end{itemize}


%%------------------------------------------------------------
\section{\protect\cmd{\tzdots(*)}: Multiple node dots}
\label{s:tzdots}

\icmd{\tzdots} takes an arbitrary number of coordinates as arguments to print multiple circle node dots with the \xem{diameter} (or |minimum size|) of |2.4pt|, by default.

This is a \iisw{semicolon version} macro, with the repeating pattern |(<coor>){<label>}[<angle>]|, which means that you need to type a \xem{semicolon} `|;|' at the end of the coordinate repetition. The \xem{semicolon} says, ``\xem{The repetition ends here}."

\remark
\begin{itemize}\firmlist
\item DO NOT FORGET to enter `|;|' at the end of iteration.
\item Without the semicolon |;|, an error occurs with the error message:
  \begin{verbatim}
  ! Package tzplot Error: You may have forgotten a semicolon here or above!
  \end{verbatim}
\end{itemize}

The starred version \icmd{\tzdots*} prints multiple filled node dots.

\begin{tzdef}
% syntax: minimum
\tzdots*(<coor>)(<coor>)..repeated..(<coor>) ;
% syntax: full
\tzdots*[<node opt>]<shift coor> (<coor>){<label>}[<[label opt]angle>]
                                 ..repeated.. (){}[] ; (<dot size>)
% defaults
 *[tzdot=2.4pt]<> (<m>){}[] ..repeated.. (){}[] ; (2.4pt)
\end{tzdef}

\begin{tzcode}{.3}
% \tzdots(*)
\begin{tikzpicture}
\tzhelplines(4,3)
\tzdots(0,0)(1,1)(2,1)(3,2)(4,0);
\tzdots*(0,3)(1,2)(2,2)(3,3)(4,3); % semicolon
\end{tikzpicture}
\end{tzcode}

\paragraph{How to label}

Each coordinate can be followed by the optional arguments |{<label>}| and |[<angle>]| to label dots. So the triple |(<coor>){<label>}[<angle>]| is the whole repeating pattern.
(To avoid frequent coding errors, you can also use \xem{string replacement} instead of angles. See also Section \ref{ss:string-replacement} on page \pageref{ss:string-replacement}

\begin{tzcode}{.3}
% \tzdots: label
\begin{tikzpicture}
\tzhelplines(4,3)
\tzdots(0,0){A}
       (1,1)
       (2,1){C}[0]
       (3,2){D}[b]           % string replacement
       (4,0){E};
\tzdots*(0,3)(1,2){B}(2,2){C}[45](3,3)(4,3);
\end{tikzpicture}
\end{tzcode}



\paragraph{How to change the size of dots}

There are \threeways\ of changing the \xem{diameter} of node dots, as discussed in Section \ref{ss:threeways} on page \pageref{ss:threeways}.

\begin{enumerate}
\item The simplest way is to use the \xem{last} parenthesis optional argument, \xem{after the semicolon}.
\item Another way is to use the style \ixxw{tzdot}, like |\tzdots[tzdot=3pt]...|.
If both options are used the |tzdot| option style wins.
\item You can also use the macro \icmd{\settzdotsize}.
The effect remains within the |tikzpicture| environment unless it is changed again.
\end{enumerate}

\begin{tzcode}{.3}
% \tzdots: size (diameter)
\begin{tikzpicture}
\tzhelplines(4,3)
\settzdotsize{3mm}
\tzdots(0,0)(1,0){3mm};
\tzdots*(1,1)(2,1){2mm};(2mm) % simplest
\tzdots[tzdot=4mm](2,2)(3,2){4mm};
\tzdots*(3,3)(4,3){3mm};
\end{tikzpicture}
\end{tzcode}



\paragraph{How to change colors}

With the first optional argument |[<node opt>]| you can change the color of node dots.
You can also change the color of each label by |[<label opt>]|.

\begin{tzcode}{.3}
% \tzdots: color
\begin{tikzpicture}[->]
\tzhelplines(4,3)
\settzdotsize{6pt}
\tzdots*[red]
  (0,0)(1,1){\textbf{Ben}}[[blue]-90](2,1)(3,0);
\tzdots*[thick,blue,fill=green]
  (1,2){A}(2,2){Ben}[[red]-90](3,2){C}(4,2){D};(8pt)
\tzdots*[blue]
  (1,3){A}(2,3){B}(3,3){C}(4,3){D};
\end{tikzpicture}
\end{tzcode}

\remark
\begin{itemize}
\item |[<node opt>]| is the option of a \iisw{main node} and |[<label opt>]| is the option of a \iisw{label node}.
\item |[<label opt>]| is used in the form of |[<[<label opt>]angle>]|, like |[[red]90]|.
\item You can control all labels together using |every label/.style| as in the following examples:
\end{itemize}

\begin{tzcode}{.3}
% \tzdots: every label/.style
\begin{tikzpicture}
\tzhelplines(4,3)
\settzdotsize{6pt}
\tzdots*[red]
  (0,0)(1,1){\textbf{Ben}}[[blue]-90](2,1)(3,0);
\tzdots*[thick,blue,fill=green]
  (1,2){A}(2,2){Ben}[[red]-90](3,2){C}(4,2){D};(8pt)
\tikzset{every label/.style={draw,text=red}} %%
\tzdots*[blue]
  (1,3){A}(2,3){B}(3,3){C}(4,3){D}[0];
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% every label/.style
\begin{tikzpicture}[every label/.style={draw,text=red}]
\tzhelplines(4,3)
\tzdots*
  (0,0){Ace}[[font=\LARGE\ttfamily]-90]
  (2,1){\textbf{Bob}}[[blue]135]
  (3,2){$C_1$\\$N_o$}[[align=center]0];
\end{tikzpicture}
\end{tzcode}


\paragraph{Shift} You can move the coordinates of dots by specifying |<shift coor>| option immediately before the first coordinate.
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzdots: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzdots[red] (0,0){A}(1,1)(2,1){C}(3,2){D}[0](4,0){E};
\tikzset{every label/.style={red}}
\tzdots*<0,1>(0,0){A}(1,1)(2,1){C}(3,2){D}[0](4,0){E};
\end{tikzpicture}
\end{tzcode}



%%==================================
\chapter{Coordinates}
\label{c:coordinates}

%%------------------------------------------------------------
\section{\protect\cmd{\tzcoor} and \protect\cmd{\tzcoor*}}
\label{s:tzcoor}

\subsection{\protect\cmd{\tzcoor}}
\label{ss:tzcoor}

For example, \icmd{\tzcoor}|(0,0)(A)| means that the coordinate |(0,0)| is named |(A)|.

\begin{tztikz}
\tzcoor(0,0)(A) % is an abbreviation of:
  \path (0,0) coordinate (A);
  % or
  \coordinate (A) at (0,0);
\end{tztikz}

\begin{tzdef}
% syntax: minimum
\tzcoor(<coor>)(<name>)
% syntax: medium
\tzcoor(<coor>)(<name>){<label>}[<angle>]
% syntax: full
\tzcoor<shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>]
% defaults
  <>(<m>)(<m>){}[]
\end{tzdef}

Here, |<m>| stands for `mandatory.' |\tzcoor| takes two mandatory arguments in parenthesis.

\paragraph{How to label}
You can put a label to a coordinate by specifying the optional arguments |{<label>}| and |[<angle>]| immediately after |(<name>)|.

\begin{tztikz}
\tzcoor(0,0)(A){$A$}[0] % works like:
  \path (0,0) coordinate [label={0:$A$}] (A);
\end{tztikz}

\begin{tzcode}{.3}
% \tzcoor
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoor(0,0)(A){$A_1$} % TikZ default: 90 or above
\tzcoor(2,1)(B){$B_2$\\ending point}[[align=left,red]0]
\draw (A) -- (B);
\end{tikzpicture}
\end{tzcode}

\paragraph{Shift}
You can move the coordinate by specifying the optional argument |<shift coor>| before |(<coor>)|.
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcoor: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoor<0,1>(0,0)(A){$A_1$} %%
\tzcoor(2,1)(B){$B_2$\\ending point}[[align=left,red]0]
\tzline(A)(B)
\end{tikzpicture}
\end{tzcode}


\subsection{\protect\cmd{\tzcoor*}}
\label{ss:tzcoor*}

The starred version \icmd{\tzcoor*} works like |\tzcoor| with one exception. It prints a `node dot' of the size |2.4pt|, by default, at a specified coordinate.

\begin{tzdef}
% syntax: minimum
\tzcoor*(<coor>)(<coor name>)
% syntax: medium
\tzcoor*(<coor>)(<coor name>){<label>}[<angle>]
% syntax: full
\tzcoor*[<dot opt>]<shift coor>
        (<coor>)(<name>){<label>}[[<label opt>]<angle>](<dot size>)
% defaults
 *[]<>(<m>)(<m>){}[](2.4pt)
\end{tzdef}


\begin{tztikz}
\tzcoor*(0,0)(A) % works like:
  \path (0,0) coordinate (A);
  \tzdot*(0,0)
\end{tztikz}

\begin{tztikz}
\tzcoor(0,0)(A){$A$}[right] % works like:
  \path (0,0) coordinate (A);
  \tzdot*(0,0){$A$}[right]
\end{tztikz}

\begin{tzcode}{.3}
% \tzcoor*
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoor*(0,0)(A){$A_1$} % TikZ default: 90 or above
\tzcoor*(30:3cm)(B){$B_2$}[[draw,blue]0]
\draw (A) -- (B);
\end{tikzpicture}
\end{tzcode}

\paragraph{Changing the color and size of a dot}

You can change the color of a dot by specifying |[<dot opt>]|, which is, in fact, \Tikz's |node| option.
To change the size of dots, you can apply the \threeways\ (see Subsection \ref{ss:threeways} on page \pageref{ss:threeways}).

\begin{tzcode}{.3}
% \tzcoor*: color, size
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoor(1,1)(A){A}
\tzcoor*(2,1)(B){B}[0]
\tzcoor*[red](1,2)(C){C}[[blue,draw]l] % abb
\tzcoor*[fill=none,tzdot=5pt](3,2)(D){D}[45]
\tzcoor*[blue,thick,fill=green](4,0)(E){E}[180](6pt)
\end{tikzpicture}
\end{tzcode}

\paragraph{Shift} The optional argument |<shift coor>| works just like in |\tzcoor|.
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcoor*: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoor*<0,1>(0,0)(A){$A_1$} %%
\tzcoor*(2,1)(B){$B_2$\\end point}[[align=left,red]0]
\tzline(A)(B)
\end{tikzpicture}
\end{tzcode}

%%------------------------------------------------------------
\section{\protect\cmd{\tzcoors} and \protect\cmd{\tzcoors*}: Semicolon versions}
\label{s:tzcoors}

\subsection{\protect\cmd{\tzcoors}}
\label{ss:tzcoors}

The macro \icmd{\tzcoors} takes an \xem{arbitrary number of pairs} of coordinates and their names as arguments.
For example, |\tzcoors(0,0)(A) (1,1)(B) (2,2)(C);| means that the coordinate |(0,0)| is represented by the name |(A)|, |(1,1)| by |(B)|, and |(2,2)| by |(C)|.

\begin{tzdef}
% syntax: minimum
\tzcoors(<coor>)(<name>..repeated..(<coor>)(<name>) ;
% syntax: full
\tzcoors <shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>] 
                     ..repeated.. ()(){}[] ;
% defaults
  <> (<m>)(<m>){}[] ..repeated.. ()(){}[] ;
\end{tzdef}

This is a \xem{semicolon version} macro. The quadruple |(<coor>)(<name>){<label>}[<angle>]| is the whole repeating pattern.
It is required to type a \xem{semicolon} `|;|' to indicate when the coordinate repetition ends.


\begin{tztikz}
\tzcoors (0,0)(A) (1,1)(B) (2,1)(C) (3,0)(D) ; % works like:
  \path (0,0) coordinate (A)
        (1,1) coordinate (B)
        (2,1) coordinate (C)
        (3,0) coordinate (D);
\end{tztikz}

\begin{tztikz}
\tzcoors (0,0)(A) (1,1)(B) (2,1)(C){C}[0] (3,0)(D){D}[90]; % works like:
  \path (0,0) coordinate                (A)
        (1,1) coordinate                (B)
        (2,1) coordinate [label={0:C}]  (C) 
        (3,0) coordinate [label={90:D}] (D);
\end{tztikz}

You can add a label to each specified coordinate by adding the optional arguments |{<label>}| and |[<angle>]| immediately after |(<name>)|.

\begin{tzcode}{.3}
% \tzcoors
\begin{tikzpicture}
\tzcoors (0,0)(A){Ace}[[font=\LARGE\ttfamily]-90]
         (2,1)(B){\textbf{Bob}}[[blue]135]
         (3,2)(C){$C_1$\\$N_o$}[[align=center]0];
\draw (A) -- (B) -- (C);
\end{tikzpicture}
\end{tzcode}

By the option |<shift coor>|, all specified coordinates are shifted.
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcoors
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoors (0,0)(A) (1,1)(B) (2,1)(C){C} (3,0)(D);
\tzlines(A)(B)(C)(D);
% shift
\tzcoors <1,1> (0,0)(A) (1,1)(B) (2,1)(C){C} (3,0)(D);
\tzlines[dashed](A)(B)(C)(D);
\end{tikzpicture}
\end{tzcode}


\subsection{\protect\cmd{\tzcoors*}}
\label{ss:tzcoors*}

The starred version \icmd{\tzcoors*} takes an \xem{arbitrary number of pairs} of coordinates and names as mandatory arguments to print node dots at the coordinates. 

The full repeating pattern is |(<coor>)(<name>){<label>}[<angle>]|.
It is required to type a \xem{semicolon} `|;|' to indicate when the iteration of coordinates ends. 

\begin{tzdef}
% syntax: minimum
\tzcoors*(<coor>)(<name>)..repeated..(<coor>)(<name>) ;
% syntax: full
\tzcoors*[<dot opt>]<shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>] 
                                ..repeated.. ()(){}[] ; (<dot size>)
% defaults
 *[]<> (<m>)(<m>){}[] ..repeated.. ()(){}[] ; (2.4pt)
\end{tzdef}

You can label each dot by specifying the optional arguments |{<label>}| and |[<angle>]| after the pair |(<coor>)(<name>)|.

\begin{tzcode}{.3}
% \tzcoors*
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoors*(0,0)(A)
         (1,1)(B){B}
         (2,1)(C)
         (3,3)(D){D}[0] ;  % semicolon
\end{tikzpicture}
\end{tzcode}

You can change the dot color by |[<dot opt>]| and the label color by |[<label opt>]|.
You can apply the \threeways\ (on page \pageref{ss:threeways}) to change the dot size. The simplest way of changing the dot size is to specify the \xem{last} (even after the semicolon) parenthesis option |(<dot size>)|. 

\begin{tzcode}{.3}
% \tzcoors*
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoors*[red](0,0)(A)
         (1,1)(B){B}
         (2,1)(C)
         (3,3)(D){D}[[blue]0] ; (6pt)
\end{tikzpicture}
\end{tzcode}

By specifying the optional argument |<shift coor>| immediately before the first coordinate, you can move all specified coordinates.
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcoors*: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\settzdotsize{6pt}
\tzcoors*[red]       (0,0)(A)(1,1)(B)(2,1)(C)(3,3)(D);
\settzdotsize{4pt}
\tzcoors*[blue]<.5,0>(0,0)(A)(1,1)(B)(2,1)(C)(3,3)(D);
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzcoorsquick} and \protect\cmd{\tzcoorsquick*}: Semicolon versions}
\label{s:tzcoorsquick}

\subsection{\protect\cmd{\tzcoorsquick}}
\label{ss:tzcoorsquick}

You can see the coordinate array at a glance using \icmd{\tzcoorsquick}, which displays specified names as text at the |center| (by default) of the coordinates.

\begin{tzdef}
% syntax: minimum
\tzcoorsquick(<coor>)(<name>)..repeated..(<coor>)(<name>) ;
% syntax: full
\tzcoorsquick<shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>]
                                     ..repeated.. ()(){}[] ;
% defaults
  <> (<m>)(<m>){}[center] ..repeated.. ()(){}[] ;
\end{tzdef}

\begin{tzcode}{.3}
% \tzcoorsquick
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoorsquick(0,0)(A)
             (1,1)(Ben)
             (2,1)(Cate)
             (3,2)(Daniel);   % semicolon
\end{tikzpicture}
\end{tzcode}

A label can be suppressed by the empty braces |{}|.
You can move the coordinates by specifying |<shift coor>| immediately before the first coordinate. The \xem{empty} option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcoorsquick: shift, color
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoorsquick
  (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel);
\tikzset{every label/.style={blue}}
\tzcoorsquick <0,1>
  (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel);
\end{tikzpicture}
\end{tzcode}


\subsection{\protect\cmd{\tzcoorsquick*}}
\label{ss:tzcoorsquick*}

The starred version \icmd{\tzcoorsquick*} prints node dots on the coordinates and displays the names |above| (or |90| degree from) the dots, by default.

\begin{tzdef}
% syntax: minimum
\tzcoorsquick*(<coor>)(<name>)..repeated..(<coor>)(<name>) ;
% syntax: full
\tzcoorsquick*[<dot opt>]<shift coor>(<coor>)(<name>){<label>}[<[label opt]angle>]
                                     ..repeated.. ()(){}[] ; (<dot size>)
% defaults
 *[ tzdot=1.2pt ]<> (<m>)(<m>){}[] ..repeated.. ()(){}[] ; (2.4pt)
\end{tzdef}

\begin{tzcode}{.3}
% \tzcoorsquick*
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoorsquick*(0,0)(A)    (1,1)(Ben)
              (2,1)(Cate) (3,2)(Daniel);
\end{tikzpicture}
\end{tzcode}

A label can be suppressed by the empty braces |{}|.
You can change the dot size using the \threeways\ (on page \pageref{ss:threeways}).
You can shift the coordinate by specifying |<shift coor>| immediately before the first coordinate. The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzcoorsquick*: size, color, shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoorsquick*
  (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel);
\tikzset{every label/.style={blue}}
\tzcoorsquick*[blue]<0,1>
  (0,0)(A) (1,1)(Ben) (2,1)(Cate){} (3,2)(Daniel);(6pt)
\end{tikzpicture}
\end{tzcode}

\remark
The first optional argument |[<dot opt>]| of |\tzcoorsquick*| is for only dots.
You can use the \Tikz\ option |every label/.style={...}| to control all the labels together.
You can also control each labels using |[<label opt>]| for each coordinate.

\begin{tzcode}{.3}
% \tzcoorsquick*: every label/.style
\begin{tikzpicture}
\tzhelplines(4,3)
\tikzset{every label/.style={draw,red}} %%
\tzcoorsquick*[fill=none,blue,very thick]
  (0,0)(A)(1,1)(B-1)(2,1)(C)(3,3)(D)[[blue]-45];(8pt)
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzgetxyval}}
\label{s:tzgetxyval}

\icmd{\tzgetxyval} extracts the values of x-coordinate and the y-coordinate \xem{in the unit of centimeter} from a specified coordinate and saves the values in the user-defined macros, so that you can use them later.
For example, |\tzgetxyval(3,2){\xval}{\yval}| results in |\xval=3| and |\yval=2|.

\begin{tzdef}
% syntax
\tzgetxyval(<coor>){<\macroXval>}{<\macroYval>}
% default
(<m>){<m>}{<m>}
\end{tzdef}

\begin{tzcode}{.3}
\begin{tikzpicture}
\tzhelplines(4,3)
\tzfn"dem"{3-(3/4)*\x}[0:4]
\tzfn"sup"{\x}[0:4]
% intersection point: (E)
\tzXpoint*{dem}{sup}(E)(5pt)
% extract x/y-coordinate from (E)
\tzgetxyval(E){\Ex}{\Ey}
\tzdots*(\Ex,\Ey){E}(\Ex+1,\Ey){F}(\Ex,\Ey+1){G};
\tzdot(E)(10pt)
\tznodeframe(2,0){x\;=\;\Ex\,cm\\ y\;=\;\Ey\,cm}
  [font=\ttfamily\scriptsize,align=left]
\end{tikzpicture}
\end{tzcode}


%%==================================
\chapter{Plot Coordinates: \protect\cmd{\tzplot}: Semicolon Versions}
\label{c:plotcoordinates}

%%------------------------------------------------------------
\section{\protect\cmd{\tzplot} and \protect\cmd{\tzplot*}: Syntax}
\label{s:tzplot}

\icmd{\tzplot} takes an \xem{arbitrary number of coordinates} as arguments. Internally, |\tzplot| uses the |plot coordinates| operation of |\Tikz|.

Each |(<coor>)| can be followed by the optional arguments |{<label>}| and |[<angle>]| to label the coordinate. This is a \xem{semicolon version} and the whole repeating pattern is the triple |(<coor>){<label>}[<angle>]|. It is required to type a semicolon `|;|' to indicate when the coordinate iteration ends.

The macro |\tzplot| draws connected line segments that link specified coordinates.

\begin{tzdef}
% syntax: minimum
\tzplot(<coor>)(<coor>)..repeated..(<coor>) ;
% syntax: medium
\tzplot(<coor>){<label>}[<angle>]..repeated..(<coor>){<label>}[<angle>] ;
% syntax:full
\tzplot[<opt>]{<tension>} [<plot opt>]<shift coor>"<path name>"
       (<coor>){<label>}[<[label opt]angle>] 
       ..repeated.. 
       (){}[] ; (<mark size>) <code.append>
% defaults
  [tzmark=2pt]{0}[smooth]  <>"" (<m>){}[] ..repeated.. (){}[] ; (2pt) <>
  - [<plot opt>] is [smooth] by default
  - It can be changed to [smooth cycle]
\end{tzdef}

The starred version |\tzplot*| prints dot marks at specified coordinates, without drawing line segments connecting the coordinates, by default.

|\tzplot*| is equivalent to |\tzplot[draw=none,mark=*]|.
The style \ixxw{tzmark} is defined as follows:

\begin{tzsty}
% style: tzmark
\tikzset{
  tzmark/.style=
    {mark options={solid,thin},mark size=#1},
  tzmark/.default=\tzmarksize
}
\end{tzsty}

\icmd{\tzmarksize} is the \xem{radius} of a |mark| and the default is |2pt| as in \Tikz.
The value of |\tzmarksize| can be changed by the macro \icmd{\settzmarksize}, like |\settzmarksize{3pt}|.




%%------------------------------------------------------------
\section{\protect\cmd{\tzplot*}: Dots and marks}
\label{s:tzplot-dots}

The starred version |\tzplot*| prints \Tikz\ marks (|*| by default) at specified coordinates.
You can change the mark color and mark style using the first bracket optional argument.

\begin{tztikz}
\tzplot*(0,0)(1,2)(2,2)(3,3); % works like:
  \draw [draw=none,mark=*] plot coordinates { (0,0)(1,1)(2,2)(3,3) } ;
\end{tztikz}


\begin{tzcode}{.3}
% \tzplot*
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot*(0,0)(1,1)(2,1)(3,3);
\tzplot*[mark=o](0,3)(1,3)(2,2)(3,1) ;   % semicolon
\tzplot*[red](0,2)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}

\paragraph{Labels, marks, and mark size} 
You can also add labels to specified coordinates with the optional arguments |{<label>}| and |[<angle>]| immediately after each |(<coor>)|.

\begin{tztikz}
\tzplot*(0,0){A}[90](1,2)(2,2)(3,3){D}[0]; % works like:
  \draw [draw=none,mark=*] plot coordinates { (0,0)(1,1)(2,2)(3,3) } 
                           (0,0) node [label={90:A}] {}
                           (3,3) node [label={0:D}] {} ;
\end{tztikz}

There are \textsc{Three Ways} to change the mark size.

\begin{enumerate}
\item The simplest way is to use the parenthesis optional argument |(<mark size>)|, \xem{immediately after the semicolon}.
\item You can use the style |tzmark|, like |tzmark=3pt|.
\item You can also use the macro |\settzmarksize|, which is effective until the end of |tikzpicture| environment.
\end{enumerate}

\begin{tzcode}{.3}
% \tzplot*: label, size
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot*(0,0){A}[-135](1,1)(2,1)(3,3){D}[[blue]0];(1mm)
\tzplot*[mark=o,tzmark=6pt](0,3)(1,3)(2,2)(3,1);
\settzmarksize{4pt}
\tzplot*[red](0,2){A}(1,2){B}(2,0){C}[[blue]0](3,2){D};
\end{tikzpicture}
\end{tzcode}

\remark You can use strings such as |a|, |b|, |ar|, and so on, instead of angles, from the version 2 of the |tzplot| package. These strings are replaced by the corresponding positioning words such as |above|, |below|, |above right|, and so on. (See also Section \ref{ss:string-replacement} on page \pageref{ss:string-replacement} for more details.)

\begin{tzcode}{.3}
% \tzplot*: label: strings instead of angles
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot*(0,0){A}[bl](1,1)(2,1)(3,3){D}[[blue]r];(1mm)
\tzplot*[mark=o,tzmark=6pt](0,3)(1,3)(2,2)(3,1);
\settzmarksize{4pt}
\tzplot*[red](0,2){A}(1,2){B}(2,0){C}[[blue]r](3,2){D};
\end{tikzpicture}
\end{tzcode}

With |\tzplot*|, you can draw line segments by giving the \Tikz's option |draw| in the first bracket optional argument, like |\tzplot*[draw]|.

\begin{tzcode}{.3}
% \tzplot*: line, more marks, size
\begin{tikzpicture}[scale=1]
\tzhelplines(4,3)
\settzmarksize{3pt}
\tzplot*[draw,mark=x]
        (0,0)(1,1)(2,1)(3,3);
\tzplot*[blue,mark=diamond*]
        (0,3)(1,3)(2,2)(3,1);(10pt)
\tzplot*[draw,dashed,red,mark=heart]
        (0,2)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}

\remark In \Tikz, the |mark| shapes are affected by |scale|, |xscale|, and |yscale|.

\begin{tzcode}{.3}
% \tzplot*: marks: distorted
\begin{tikzpicture}[yscale=.5]
\tzhelplines(4,3)
\settzmarksize{3pt}
\tzplot*[draw,mark=x]
        (0,0)(1,1)(2,1)(3,3);
\tzplot*[blue,mark=diamond*]
        (0,3)(1,3)(2,2)(3,1);(10pt)
\tzplot*[draw,dashed,red,mark=heart]
        (0,2)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}

\paragraph{Shift}
You can move specified coordinates using the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"| if it exists).
The \xem{empty} shift option |<>| is \xem{not allowed}.


\begin{tzcode}{.3}
% \tzplot*: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoors(1,3)(A)(2,3)(B)(3,3)(C)(4,3)(D);
\tzplot*[draw]           (A){A}(B)(C)(D){D}[0];
\tzplot*[draw,red]<-1,-1>(A){A}(B)(C)(D){D}[0];
\tzplot*[draw,blue]<0,-3>(A){A}(B)(C)(D){D}[0];
\end{tikzpicture}
\end{tzcode}

\paragraph{Extending path}
You can use |<code.append>| as the last optional argument after a semicolon.

\begin{tzcode}{.3}
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplot*[draw](0,0)(1,1)(2,2){C}(3,2){D};
  < arc (-90:0:1cm) node [a] {ends here!}>
\end{tikzpicture}
\end{tzcode}

\icmd{\tzplotAtBegin} and \icmd{\tzplotAtEnd} are also available.
These work with |\tzplot*[draw]| and |\tzplot| to extend the paths at the beginning and at the end, respectively. Specifying |<code.append>| extends the path after |\tzplotAtEnd|. 

\begin{tzcode}{.3}
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotAtBegin{(0,2) to [bend right]} % ERROR!!!
\tzplotAtEnd{arc (90:0:1cm) node [b] {here?}}
\tzplot*[draw,blue](0,0)(1,1)(2,2){C}(3,2){D};
  <arc (-90:0:1cm) node [r] {ends here!}>
\tzplot*[draw,red]<.5,1>(0,0)(1,1)(2,2){C}(3,2){D};
  <arc (-90:0:1cm) node [r] {ends here!}>
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzplot}: Lines}
\label{s:tzplot-lines}

|\tzplot| draws connected line segments connecting specified coordinates.
(By default, |tension=0|.)


\begin{tztikz}
\tzplot(0,0)(1,2)(2,2)(3,3); % works like:
  \draw [tension=0] plot [smooth] coordinates { (0,0)(1,1)(2,2)(3,3) } ;
\end{tztikz}

|\tzplot*| is equivalent to |\tzplot[draw=none,mark=*]|.


\paragraph{Options: draw, mark, mark options, etc.}
You can use the optional argument |[<opt>]| to change the style of lines and marks.

\begin{tzcode}{.3}
% \tzplot: line
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot        (0,0)(1,1)(2,1)(3,3);
\tzplot[dashed,mark=o](0,3)(1,3)(2,2)(3,1);
\tzplot[red,mark=ball,mark options={ball color=purple}]
               (0,1)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}

To close the path of |\tzplot| you can use the option |smooth cycle| in the first bracket optional argument |[<opt>]| or in the second bracket optional argument |[<plot opt>]|.

\begin{tzcode}{.3}
% \tzplot: smooth cycle
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot        (0,0)(1,1)(2,1)(3,3);
\tzplot[dashed,mark=o,smooth cycle]
       (0,3)(1,3)(2,2)(3,1);
\tzplot[red,mark=*,mark options={blue}]
       [smooth cycle] %% default tension=0
       (0,1)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}



\paragraph{Labels} You can label specified coordinates with the options |{<label>}| and |[<angle>]| immediately after each |(<coor>)|.

\begin{tzcode}{.3}
% \tzplot: label
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot(0,0){A}(1,1){B}[-90](2,1)(3,3){Da}[[draw]0];
\tzplot[mark=o](0,3)(1,3){B}(2,2)(3,1){Db}[0];
\tzplot[red,mark=*,draw=blue]
  (0,1)(1,2){B}(2,0)(3,2){Dc}[[blue]0];
\end{tikzpicture}
\end{tzcode}

\paragraph{Shift} You can also move the line segments by specifying the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"| if it exists).
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% \tzplot: shift
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzcoors(0,0)(A)(1,1)(B)(2,1)(C)(3,3)(D);
\tzplot           <1,0>(A)(B)(C)(D){Da}[0];
\tzplot[mark=o]   <1,0>(0,3)(1,3)(2,2)(3,1){Db}[0];
\tzplot*[draw,red]<1,0>(0,1)(1,2)(2,0)(3,2){Dc}[0];
\end{tikzpicture}
\end{tzcode}

\paragraph{\texttt{name path} for intersections}

To find the intersection points of two lines, you may want to name the paths first, like |[name path=<path name>]| in \Tikz. With |\tzplot|, you can do it by specifying the quote optional argument |"<path name>"| immediately before the first coordinate.

\begin{tzcode}{.3}
% \tzplot: "path name"
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot[name path=Da] (0,0)(1,1)(2,1)(3,3){Da}[0];
\tzplot[mark=o]   "Db"(0,3)(1,3)(2,2)(3,1){Db}[0];
\tzplot*[draw,red]"Dc"(0,1)(1,2)(2,0)(3,2){Dc}[0];
% intersection points
\tzXpoint*[gray]{Da}{Db}
\tzXpoint*[blue]{Da}{Dc}
\end{tikzpicture}
\end{tzcode}

\paragraph{Extending the path}
In order to \xem{extend a path}, formed by |\tzplot|, \xem{from the last coordinate}, you can write \Tikz\ code in the very last optional argument |<code.append>|, \xem{after the semicolon}.

\begin{tzcode}{.3}
% \tzplot: "path name"
\begin{tikzpicture}[scale=.8]
\tzhelplines(6,4)
\tzplot(0,0)(1,1)(2,1)(3,3){Da}[0];< -- (6,4) >
\tzplot[mark=o](0,3)(1,3)(2,2)(3,1){Db}[0];(4pt)
\tzplot[mark=ball,red](0,1)(1,2)(2,0)(3,2){Dc}[0];
  (5pt)< to [bend left] ++(2,-2) node {ends here!} >
\end{tikzpicture}
\end{tzcode}

You can also use \icmd{\tzplotAtBegin} and \icmd{\tzplotAtEnd} to extend the path of |\tzplot| at the beginning and at end, respectively. Specifying |<code.append>| extends the path after |\tzploAtEnd|.


%%------------------------------------------------------------
\section{\protect\cmd{\tzplot}: Curves}
\label{s:tzplot:curves}

With |\tzplot|, the default value of |tension| is |0|.
You can draw a curve with |\tzplot|, by specifying the optional argument |{<tension>}| before the coordinates or between the first and second bracket options (if they exist).

\begin{tztikz}
\tzplot[blue,smooth cycle]{1}(0,0)(1,2)(2,2)(3,3); % works like:
  \draw [blue,tension=1] plot [smooth cycle] coordinates { (0,0)(1,1)(2,2)(3,3) } ;
\end{tztikz}

\begin{tzcode}{.3}
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot[tension=1](0,0)(1,1)(2,1)(3,3);
\tzplot[mark=o]   (0,3)(1,3)(2,2)(3,1); % tension=0
\tzplot*[draw,red,smooth cycle]{1}      % tension=1
                  (0,1)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}

To plot curves, the macro |\tzplotcurve| is provided. 
Basically, |\tzplotcurve| is the |tension=1| version of |\tzplot|.
(See Section \ref{s:tzplotcurve} on page \pageref{s:tzplotcurve}.)


%%------------------------------------------------------------
\section{\protect\cmd{\tzplot}: Bars and combs}
\label{s:tzplot-bars}

With |\tzplot|, you can draw bars or combs, using the \Tikz\ options |ybar|, |xbar|, |ycomb|, and |xcomb|.

\begin{tzcode}{.3}
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot*[draw](0,0)(1,1)(2,1)(3,3);
\tzplot[ybar](0,3)(1,3)(2,2)(3,1);
\tzplot[dashed,red,mark=heart](0,1)(1,2)(2,0)(3,2);
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot[xbar](.5,2.5)(1,3)(2,2)(3,1);
\tzplot[xbar,bar width=2mm,fill,red!50]
       (1,2.5)(1.5,2)(2,0)(3,1.5);(3pt)
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
\begin{tikzpicture}[yscale=1.5]
\tzhelplines(0,-1)(4,1)
\tzplot[ycomb,mark=*,very thick,blue]
       (.5,.1)(1,.3)(1.5,.4)(2,.5)
       (4,-.1)(3.5,-.3)(3,-.4)(2.5,-.5);
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
\begin{tikzpicture}[scale=.8]
\tzhelplines(4,3)
\tzplot[xcomb,mark=*,very thick]
       (1,2.5)(1.5,2)(2,0)(3,1.5);
\end{tikzpicture}
\end{tzcode}

\remark
\begin{itemize}
\item
Do not use |<shift coor>| for plotting bars or combs to avoid getting unexpected results. It gives you wrong bars because |<shift coor>| moves coordinates but not bars. 

%\item Use the option |shift={(coor)}| to move bars.
%\begin{tzcode}{.3}
%% shift : shift={(1,1)}
%\begin{tikzpicture}[scale=1]
%\tzhelplines(4,3)
%\tzplot*[draw]<1,1>(0,0)(1,1)(2,1)(3,3);
%\tzplot[ybar,shift={(1,1)}](0,3)(1,3)(2,2)(3,1); %%
%\tzplot[red,mark=heart]<1,1>(0,2)(1,2)(2,0)(3,2);
%\end{tikzpicture}
%\end{tzcode}

\item
It can be a mess when using the \Tikz\ option |shift={(coor)}| with the type of \xem{mixed} coordinates: \xem{native} and \xem{named} coordinates.

%\begin{tzcode}{.3}
%% \tzplot(*)
%% shift : mixed coor : shift={(1,1)} : chaos
%\begin{tikzpicture}[scale=1]
%\tzhelplines(4,3)
%\tzcoors(0,3)(A)(1,3)(B)(2,2)(C)(3,1)(D);
%\tzcoors(0,2)(a)(1,2)(b)(2,0)(c)(3,2)(d);
%\tzplot*[draw]<1,1>(0,0)(1,1)(2,1)(3,3);
%\tzplot[ybar,shift={(1,1)}](A)(1,3)(C)(D); %%
%\tzplot[dashed,red,mark=heart]<1,1>(a)(1,2)(c)(d);
%\end{tikzpicture}
%\end{tzcode}

\end{itemize}



%%-----------------------------------
%%------------------------------------------------------------
\section{\protect\cmd{\tzplotcurve(*)}}
\label{s:tzplotcurve}

\icmd{\tzplotcurve} draws a curve connecting specified coordinates with |tension=1|, by default. Basically, it is equivalent to |\tzplot| with |[tension=1]|.

The starred version \icmd{\tzplotcurve*} draws a curve and displays marks |*|, by default.
Basically, this is equivalent to |\tzplot*[draw,tension=1]|.

\begin{tzdef}
% syntax: minimum
\tzplotcurve(<coor>)(<coor>)..repeated..(<coor>) ;
% syntax: full
\tzplotcurve*[<opt>]{<tension>} [<plot opt>]<shift coor>"<path name>"
             (<coor>){<label>}[<[label opt]angle>] 
             ..repeated.. 
             (){}[] ; (<mark size>) <code.append>
% defaults
 *[tzmark=2pt]{1}[smooth] <>"" (<m>){}[] ..repeated.. (){}[] ; (2pt) <>
\end{tzdef}

\begin{tztikz}
\tzplotcurve(0,0)(1,2)(2,2)(3,3); % works like:
  \draw [tension=1] plot [smooth] coordinates { (0,0)(1,1)(2,2)(3,3) } ;
\end{tztikz}

\begin{tztikz}
\tzplotcurve[blue,smooth cycle]{2}(0,0)(1,2)(2,2)(3,3); % works like:
  \draw [blue,tension=2] plot [smooth cycle] coordinates { (0,0)(1,1)(2,2)(3,3) } ;
\end{tztikz}

Since |\tzplotcurve| is a \xem{semicolon version}, you need to enter a semicolon to indicate when the coordinate iteration ends.
In repeating coordinates, each mandatory coordinate can have a label.
So the whole repeating pattern is the triple |(<coor>){<text>}[<pos>]|.
For example, |(A){here}[above]| represents |(A) node [above] {here}| in \Tikz.

\paragraph{Options: lines, labels, colors, smooth cycle} 
Use the first bracket option to control the colors of lines or labels.

\begin{tztikz}
\tzplotcurve(0,0)(1,2)(2,2){A}[below](3,3){B}[right]; % works like:
  \draw [tension=1] plot [smooth] coordinates { (0,0)(1,1)(2,2)(3,3) } 
        (2,2) node [below] {A} 
        (3,3) node [right] {B} ;
\end{tztikz}

You can change the color of all labels together by adding |[text=<color>]| to the first bracket option list.

\begin{tzcode}{.3}
% \tzplotcurve(*)
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve*[red,text=blue]
  (0,0)(1,2){B}(2,2)(3,3)(4,1){E}[0];
\tzplotcurve(1,.5)(2,3)(3,2)(2,1)(3,1);
\end{tikzpicture}
\end{tzcode}

The simplest way to change the mark size is to specify |(<mark size>)| immediately after the semicolon |;|.
To close the path of |\tzplotcurve|, you can use the \Tikz\ option |smooth cycle| in the first bracket option or in the second bracket option.

\begin{tzcode}{.3}
% \tzplotcurve(*): smooth cycle, mark size
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve*[red,text=blue][smooth cycle]
  (0,0)(1,2){B}(2,2)(3,3)(4,1){E}[0];(3pt) %%
\tzplotcurve*[smooth cycle](1,.5)(2,3)(3,2)(2,1)(3,1);
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
% abridges strings: label position
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve*[red,text=blue][smooth cycle]
  (0,0)(1,2){B}[[red]l](2,2)(3,3)(4,1){E}[[draw]r];(3pt)
\tzplotcurve*[smooth cycle](1,.5)(2,3)(3,2)(2,1)(3,1);
\end{tikzpicture}
\end{tzcode}

\paragraph{Tension}
You can change the value of |tension| (|tension=1| by default) by specifying the option |{<tension>}| before the coordinates or between the two bracket options if they exist.

\begin{tzcode}{.3}
% \tzplotcurve: tension
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoor(.5,.5)(A)
\tzplotcurve[blue]{2}(1,3)(A)(4,0);
\tzplotcurve[thick](1,3)(A)(4,0); % default: tension=1
\tzplotcurve[red]{.5}(1,3)(A)(4,0);
\tzplotcurve[dashed]{0}(1,3)(A)(4,0);
\end{tikzpicture}
\end{tzcode}


\paragraph{Shift} Use the optional argument |<shift coor>| before the first coordinate (to be precise, immediately before |"<path name>"|, if it exists).
The empty shift option |<>| is not allowed.

\begin{tzcode}{.3}
% \tzplotcurve(*): shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoors(0,0)(A)(1,2)(B)(2,2)(C)(3,3)(D)(4,1)(E);
\tzplotcurve*[red,text=blue,smooth cycle]
  <0,1>(A)(B){B}(C)(D)(E){E}[0];(3pt) %%
\tzplotcurve*[smooth cycle]
  (1,.5)(2,3)(3,2)(2,1)(3,1);
\end{tikzpicture}
\end{tzcode}


\paragraph{Extending the path} In order to extend the path created by |\tzplotcurve(*)| from the last coordinate, you can directly write \Tikz\ code in the very last optional argument |<code.append>|, after the semicolon.

\begin{tzcode}{.3}
% \tzplotcurve(*): <code.append>
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve*[red,text=blue,thick]
  (0,0)(1,2){B}(2,2)(3,3)(4,1){E}[-45];(3pt)
  < arc (-90:90:1cm) node [above] {up} > %%
\tzplotcurve[dashed]
  (1,.5)(2,3)(3,2)(2,1)(3,1);
  < -- ++(-1,-1) node [below] {down} >   %%
\end{tikzpicture}
\end{tzcode}

You can also use |<--cycle>| to \xem{close} the path \xem{with a straight line} from the last coordinate to the first coordinate.

\begin{tzcode}{.3}
% \tzplotcurve(*): <--cycle>
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve*[red,text=blue]
  (0,0)(1,2)(2,2)(3,3)(4,1){A}[right] ; (3pt)<--cycle>
\tzplotcurve
  (1,.5)(2,3)(3,2)(2,1)(3,1) ; <--cycle>
\end{tikzpicture}
\end{tzcode}

You can also use \icmd{\tzplotcurveAtBegin} and \icmd{\tzplotcurveAtEnd} to extend the path of |\tzplotcurve| at the beginning and at the end, respectively.
Specifying |<code.append>| extends the path after |\tzplotcurveAtEnd|.

\begin{tzcode}{.3}
% \tzplotcurve(*)
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve*[red,text=blue]
  (0,0)(1,2){B}(2,2)(3,3)(4,1){E}[0];
\tzplotcurveAtBegin{(0,2) |-}  % ERROR!!!
\tzplotcurveAtEnd{arc (180:270:1cm) node {End!}}
\tzplotcurve(1,.5)(2,3)(3,2)(2,1)(3,1);
\end{tikzpicture}
\end{tzcode}

\paragraph{\texttt{name path} for intersection points}
You can name the path of |\tzplotcurve| by specifying the option |"<path name>"| immediately before the first coordinate.

\begin{tzcode}{.3}
% \tzplotcurve(*): name path
\begin{tikzpicture}
\tzhelplines(4,3)
\tzplotcurve[blue]
  "IC"(.5,3)(1.5,1.2)(4,.5){$u$}[0];
\tzplot[draw=red]
  "bgt"(0,3)(4,0){budget}[-90];
% intersection points
\tzXpoint{IC}{bgt}(K)
\tzdots*(K){$A_1$}[30](K-2){$A_2$};
\end{tikzpicture}
\end{tzcode}


%%==================================
\chapter{Nodes}
\label{c:nodes}

%%------------------------------------------------------------
\section{\protect\cmd{\tznode} and \protect\cmd{\tznode*}}
\label{s:tznode}

The macro \icmd{\tznode} allows you to put \xem{text} at a specified \xem{coordinate}. |\tznode| expects two mandatory arguments: |(<coor>)| and |{<text>}|.
You can also \xem{optionally} name a node so that you can refer to the \iisw{node coordinate} later.

The starred version \icmd{\tznode*} is equivalent to |\tznode[draw]|, which draws the perimeter of the specified node. The default node shape is a |rectangle|.

\begin{tzdef}
% syntax: minimal
\tznode(<coor>){<text>}
% syntax: full
\tznode[<opt>]<shift coor>(<coor>)(<node name>){<text>}[<node opt>]<node.code>
% defaults: two mandatory arguments
  []<>(<m>)(){<m>}[]<>
\end{tzdef}

\begin{tztikz}
\tznode(0,0){text} % works like:
  \path (0,0) node {text};
  % or
  \node at (0,0) {text};
\end{tztikz}

\begin{tztikz}
\tznode[draw] (0,0)(A){text}[above right] % works like:
  \node [draw] (A) at (0,0) [above right] {text};
\end{tztikz}

|\tznode*| prints the perimeter of a node, which is a |rectangle| by default.

\begin{tzdef}
% syntax: minimal
\tznode*(<coor>){<text>}
% syntax: full
\tznode*[<opt>]<shift coor>(<coor>)(<name>){<text>}[<node opt>]<node.code>
% defaults
 *[draw]<>(<m>)(){}[]<>
\end{tzdef}

\begin{tztikz}
\tznode* (0,0)(A){text}[above right] % works like:
  \node [draw] (A) at (0,0) [above right] {text};
\end{tztikz}

\paragraph{Putting text} You can use \Tikz\ options in the first bracket optional argument |[<opt>]| or the second bracket option |[<node opt>]| to put text with different colors, fonts, and so on.

\begin{tzcode}{.3}
% \tznode(*)
\begin{tikzpicture}
\tzhelplines(4,3)
\tznode(1,1){text}
\tznode(2,2){another\\text}[align=left]
\tznode*(3,1){\textbf{text}}
\tznode*[blue](3,0){\scshape Text}[r] % right
\tznode*(4,2){another\\text}[align=center,font=\itshape]
\end{tikzpicture}
\end{tzcode}

\paragraph{Abbreviations} You can use \xem{abbreviations} (or aliases) such as |a| for |above|, |l| for |left|, |ar| for |above right|, |bl| for |below left|, and so on to indicate where the \xem{text} of a \xem{main node} is placed. (See also Section \ref{s:stylenames} on page \pageref{s:stylenames}.)

\begin{quote}
\remark
\begin{itemize}\firmlist
\item A \iisw{label node} is placed by angles or the corresponding positioning words. 
\item A \iisw{main node} is placed by the placement words or their aliases.
\item You cannot use angles to place main nodes.
\end{itemize}
\end{quote}


\begin{tzcode}{.3}
% \tznode(*): main node, label node
\begin{tikzpicture}
\tzhelplines(4,3)
\tzdot*(1,1)
\tznode*(1,1){A}[ar]
\tznode*[red](1,1){B}[b]
\tznode(1,1){C}[l]
\tznode*[inner sep=0pt,text=blue,scale=2]
  (3,2){Text}[label=180:Left,pin=45:Above Right]
\tznode*[inner sep=0pt,text=red,scale=2]
  (3,2){Text}[b=2cm] %% below=2cm
\end{tikzpicture}
\end{tzcode}

\paragraph{Naming nodes}
You can name a node at a specified coordinate |(<coor>)| by specifying |(<name>)| immediately after the coordinate. You can use the node name as a \iisw{node coordinate}.

\begin{tzcode}{.3}
% \tznode(*): name nodes
\begin{tikzpicture}
\tzhelplines(4,3)
\tznode*(1,1)(A){A}
\tznode*[fill=blue,text=yellow](2,3)(B){B}
\tznode*[circle,text=red](4,1)(C){C}
\tzline[->](A)(B)
\tzto[->,bend left,dashed](B)(C)
\end{tikzpicture}
\end{tzcode}

\paragraph{Shift}
You can move the coordinates by specifying the option |<shift coor>| immediately before the coordinate |(<coor>)|.
The empty shift option |<>| is not allowed.

\begin{tzcode}{.3}
% \tznode(*): shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tznode*<-1,0>(1,1)(A){A}
\tznode*[fill=blue,text=yellow]<1,-1>(2,3)(B){B}
\tznode*[circle,text=red]<-2,-1>(4,1)(C){C}
\tzline[->](A)(B)
\tzto[->,bend left,dashed](B)(C)
\end{tikzpicture}
\end{tzcode}


\paragraph{Repetition: \texttt{foreach}}
The \xem{last} optional argument |<node.code>| can be used to iterate over to place multiple nodes.

\begin{tzcode}{.3}
% \tznode(*): foreach, shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tznode(\x,0){\x}
  < foreach \x in {1,2,3} >
\tznode*<1,2>(\x,0){\x}[circle,blue,fill=yellow]
  < foreach \x in {1,2,3} >
\end{tikzpicture}
\end{tzcode}

\begin{tztikz}
\tznode(\x,0){\x}<foreach \x in {1,2,3}> % works like
  \node foreach \x in {1,2,3} at (\x,0) {\x};
\end{tztikz}

\begin{tzcode}{.3}
% \tznode: foreach
\begin{tikzpicture}
\tzhelplines(4,3)
\tznode(\x,\y){$P_{\x\y}$}
  < foreach \x in {1,2,3,4}
    foreach \y in {1,2,3}   >
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tznodes} and \protect\cmd{\tznodes*}: Semicolon versions}
\label{s:tznodes}

\icmd{\tznodes} accepts any number of \xem{mandatory} pairs of coordinates and their names to defined node coordinates at specified coordinates.

\begin{tzdef}
% syntax: minimum
\tznodes(<coor>)(<node name>)..repeated..(<coor>)(<node name>) ;
% syntax: medimum
\tznodes(<coor>)(<node name>){<text>}[<node opt>]..repeated..()(){}[] ;
% syntax: full
\tznodes[<every node opt>]<shift coor> 
        (<coor>)(<node name>){<text>}[<node opt>]..repeated..()(){}[] ;
% defaults
  []    <> (<m>)(<m>){}[]..repeated..()(){}[] ; 
 *[draw]<> (<m>)(<m>){}[]..repeated..()(){}[] ; 
\end{tzdef}

Each pair of a coordinate and a node coordinate name can be followed by the optional arguments |{<text>}| and |[<node opt>]| to print node text.
Since this is a semicolon version, it is required to type a semicolon |;| to indicate when the repetition ends.
|\tznodes| works similarly to |\tzcoors|, but the former uses main nodes and the latter uses label nodes.

The starred version \icmd{\tznodes*} is equivalent to |\tznodes[draw]|. That is, all node perimeters are drawn.

\begin{tzcode}{.3}
% \tznodes
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodes(0,0)(A){A}
        (1,1)(B){B}
        (2,1)(C){C}[r]
        (3,2)(D){D}[b]
        (4,0)(E){E};        % semicolon
\tzlines(A)(B)(C)(D)(E);
\end{tikzpicture}
\end{tzcode}


\begin{tzdef}
% syntax: minimum
\tznodes(<coor>)(<node name>)..repeated..(<coor>)(<node name>) ;
% syntax: medimum
\tznodes(<coor>)(<node name>){<text>}[<node opt>]..repeated..()(){}[] ;
% syntax: full
\tznodes[<every node opt>]<shift coor> 
        (<coor>)(<node name>){<text>}[<node opt>]..repeated..()(){}[] ;
% defaults
  []    <> (<m>)(<m>){}[]..repeated..()(){}[] ; 
 *[draw]<> (<m>)(<m>){}[]..repeated..()(){}[] ; 
\end{tzdef}



\begin{tzcode}{.3}
% \tznodes*: retangle nodes (default)
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodes*(0,0)(A){A}
        (1,1)(B){B}
        (2,1)(C){C}[r]
        (3,2)(D){D}[b]
        (4,0)(E){E};        % semincolon
\tzlines(A)(B)(C)(D)(E);
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% \tznodes*: ellipse nodes
\begin{tikzpicture}
\tzhelplines*(5,4)
\tznodes*[ellipse,fill=yellow,text=blue]
        (0,0)(A){Ann}
        (1,1)(B){Bryn}
        (2,0)(C){C}[r]
        (3,2)(D){Donald}[b,font=\scshape]
        (4,0)(E){End!}[rectangle,fill=green];
\tzlines(A)(B)(C)(D)(E);
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% \tznodes: shift
\begin{tikzpicture}
\tzhelplines*(5,4)
\tznodes*[ellipse,fill=yellow,text=blue]
   <1,1>(0,0)(A){Ann}
        (1,1)(B){Bryn}
        (2,0)(C){C}[r]
        (3,2)(D){Donald}[b,font=\scshape]
        (4,0)(E){End!}[rectangle,fill=green];
\tzlines(A)(B)(C)(D)(E);
\end{tikzpicture}
\end{tzcode}



%%------------------------------------------------------------
\section{\protect\cmd{\tznodedot(*)}}
\label{s:tznodedot}

\icmd{\tznodedot} names a node and prints a circle node dot (of the size |2.4pt|, by default).
|\tznodedot| is basically the same as |\tzdot|, except for one thing.
|\tznodedot| names a node.

The starred version \icmd{\tznodedot*} prints a filled circle node dot (of the size |2.4pt|, by default), just like |\tzdot*|. But it \xem{optionally} names a node.

\begin{tzdef}
% syntax: medium
\tznodedot(<coor>)(<node name>){<label>}[<angle>]
% syntax: full
\tznodedot*[<opt>]<shift coor>
           (<coor>)(<node name>){<label>}[<[label opt]angle>] (<dot size>)
% defaults
  [tzdot]     <>(<m>)(){}[](2.4pt)
 *[tzdot,fill]<>(<m>)(){}[](2.4pt)
\end{tzdef}

Since |\tznodedot(*)| prints a node dot, its |<label>| is placed by |<angle>|.

\begin{tztikz}
\tznodedot*(1,1)(A){Ace}[180]  % works like:
  \path (1,1) node (A) [tzdot,fill,label={180:Ace}] {} ;
\end{tztikz}

\begin{tzcode}{.3}
% \tznodedot(*): label, color
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodedot(0,0)
\tznodedot(1,1)(A){A}[180]
\tznodedot*(2,3)(B){\textbf{B}}
\tznodedot[rectangle](4,1)(C){C}[[red]0]
\tzline[->](A)(B)
\tzto[->,bend left,dashed](B)(C)
\end{tikzpicture}
\end{tzcode}

You can apply the \threeways\ (on page \pageref{ss:threeways}) to change the size of node dots.
The simplest way is to use the last parenthesis option |(<dot size>)|.

\begin{tzcode}{.3}
% \tznodedot(*): size
\begin{tikzpicture}
\tzhelplines(4,3)
\settzdotsize{5pt} %%
\tznodedot(1,1)(A){A}[180]
\tznodedot*(2,3)(B){B}
\tznodedot[rectangle](4,1)(C){C}[0](10pt) %%
\tzline[->](A)(B)
\tzto[->,bend left,dashed](B)(C)
\end{tikzpicture}
\end{tzcode}


You can move the coordinates of dots by specifying the |<shift coor>| option immediately before the  coordinate.
The empty shift option |<>| is not allowed.

\begin{tzcode}{.3}
% \tznodedot(*): shift
\begin{tikzpicture}
\tzhelplines(4,3)
\settzdotsize{5pt}
\tznodedot(1,1)(A){A}[180]
\tznodedot*(2,3)(B){B}
\tznodedot[rectangle]<-1,-1>(4,1)(C){C}[0](10pt) %%
\tzline[->](A)(B)
\tzto[->,bend left,dashed](B)(C)
\end{tikzpicture}
\end{tzcode}

You can use the abridges strings instead of angles. (See also Section \ref{ss:string-replacement} on page \pageref{ss:string-replacement}.)

\begin{tzcode}{.3}
% abridged strings: label position
\begin{tikzpicture}
\tzhelplines(4,3)
\settzdotsize{5pt}
\tznodedot(1,1)(A){A}[[draw,blue]l]
\tznodedot*(2,3)(B){B}
\tznodedot[rectangle]<-1,-1>(4,1)(C){C}[br](10pt) %%
\tzline[->](A)(B)
\tzto[->,bend left,dashed](B)(C)
\end{tikzpicture}
\end{tzcode}




%%------------------------------------------------------------
\section{\protect\cmd{\tznodedots(*)}: Semicolon versions}
\label{s:tznodedots}

\icmd{\tznodedots} accepts any number of \xem{mandatory} pairs of coordinates and their names to print multiple node circle dots at specified coordinates.
It works just like |\tzdots|, for one exception. It names multiple node coordinates.
Everything else is the same as in |\tzdots|.

The starred version \icmd{\tznodedots*} prints filled node circle dots.

\begin{tzdef}
% syntax: minimum
\tznodedots(<coor>)(<node name>)..repeated..(<coor>)(<node name>) ;
% syntax: full
\tznodedots[<dot opt>]<shift coor>
           (<coor>)(<node name>){<label>}[<[label opt]angle>]
                                        ..repeated.. ()(){}[] ; (<dot size>)
% defaults
  [tzdot=2.4pt]     <> (<m>)(<m>){}[] ..repeated.. ()(){}[] ; (2.4pt)
 *[tzdot=2.4pt,fill]<> (<m>)(<m>){}[] ..repeated.. ()(){}[] ; (2.4pt)
\end{tzdef}



\begin{tzcode}{.3}
% \tznodedots: label
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodedots(0,0)(A){A}
    (1,1)(B)
    (2,1)(C){C}[0]
    (3,2)(D){D}[-90]
    (4,0)(E){E} ;   % semicolon
\tzlines[red](A)(B)(C)(D)(E);
\tznodedots*
    (0,3)(A)(1,2)(B){B}(2,2)(C){C}[45](3,3)(D)(4,3)(E);
\tzlines(A)(B)(C)(D)(E);
\end{tikzpicture}
\end{tzcode}



The simple first bracket option of |\tznodedots(*)| controls dots rather than labels.
If you want to control all the labels, you can use \Tikz's |every label| style as follows:

\begin{tzcode}{.3}
% every label/.style
\begin{tikzpicture}
\tzhelplines(4,3)
\begin{scope}[every label/.style={draw,text=red}]
\tznodedots*[green]
  (0,0)(Ace){Ace}[[font=\LARGE\ttfamily]-90]
  (2,1)(Bob){\textbf{Bob}}[[blue]135]
  (3,2)(Cate){$C_1$\\$N_o$}[[align=center]0]
  (4,0)(D){Done!};(5pt)
\end{scope}
\end{tikzpicture}
\end{tzcode}



\remark Comparison of connecting nodes and coordinates:


\begin{tzcode}{.3}
% connecting \tznodedots
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodedots(0,0)(A){A}
       (1,1)(B)
       (2,1)(C){C}[[red]-90]
       (3,2)(D){D}[[draw,blue]a]
       (4,0)(E){E}; (6pt)
\tzlines[thick](A)(B)(C)(D)(E); % connects nodes
\end{tikzpicture}
\end{tzcode}

While the previous example shows that |\tzlines| connects nodes,
the following example shows that |\tzlines| connects coordinates.


\begin{tzcode}{.3}
% connecting \tzcoors
\begin{tikzpicture}
\tzhelplines(4,3)
\tzcoors*[fill=none](0,0)(A){A}
       (1,1)(B)
       (2,1)(C){C}[[red]-90]
       (3,2)(D){D}[[draw,blue]a]
       (4,0)(E){E}; (6pt)
\tzlines[thick](A)(B)(C)(D)(E); % connects coordinates
\end{tikzpicture}
\end{tzcode}




%%------------------------------------------------------------
\section{\protect\cmd{\tznodeframe} and \protect\cmd{\tznodeframe*}}
\label{s:tznodeframe}

\icmd{\tznodeframe} draws and \xem{optionally} names a rectangle node with (black, by default) text in it.

%\icmd{\tznoderectangle} and \icmd{\tznodebox} are aliases of |\tznodeframe|.

\begin{tzdef}
% syntax: 
\tznodeframe[<opt>](<coor>)(<node name>){<text>}[<node opt>]
% defaults
 [draw]<>(<m>)(){}[text=black]
\end{tzdef}

\begin{tztikz}
\tznodeframe(2,1)(A){Here}[a]         % works like
  \node [draw,rectangle] (A) at (2,1) [above] {Here} ;
\end{tztikz}


\begin{tzcode}{.3}
% \tznodeframe
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodeframe(0,0)(A)
\tznodeframe(4,2)(B)[circle]
\tzline[blue,thick](A)(B)
\tznodeframe[scale=1.5](2,1){Node frame}
            [label=180:Left, pin=-45:pin]
\end{tikzpicture}
\end{tzcode}

\begin{tzcode}{.3}
% \tznodeframe: fill (opacity=1)
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodeframe(0,3)
\tznodeframe(0,0)(A)
\tznodeframe(4,2)(B)[circle]
\tzline[blue,thick](A)(B)
\tznodeframe[fill=green,scale=1.5](2,1){Node frame}
            [label=180:Left, pin=-45:pin]
\end{tikzpicture}
\end{tzcode}

The starred version |\tznodeframe*| fills the rectangle with color (|black!50| by default) with |fill opacity=.3| and |text opacity=1|, by default.

%\icmd{\tznoderectangle*} and \icmd{\tznodebox*} are aliases of |\tznodeframe*|.

\begin{tzdef}
% syntax: 
\tznodeframe*[<opt>]<shift coor>
             (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>}
% defaults
 *[fill=black!50,fill opacity=.3,text opacity=1] <>
  (<m>)(){}[draw=black,text=black]{.3}
\end{tzdef}

\remark
|\tznodeframe| works very similar to |\tznode|, but their `starred versions' work differently.
While |\tznode*| draws the perimeter of a node, |\tznodeframe*| fills a node with color.

\begin{tzcode}{.3}
% \tznodeframe*: opacity=.3 (by default)
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodeframe(0,0)(A)
\tznodeframe(4,2)(B)[circle]
\tzline[blue,thick](A)(B)
\tznodeframe*[green,scale=1.5](2,1){Node frame}
             [label=180:Left, pin=-45:pin]
\end{tikzpicture}
\end{tzcode}

\icmd{\tznoderectangle} and \icmd{\tznodebox} are aliases of |\tznodeframe|.
\icmd{\tznoderectangle*} and \icmd{\tznodebox*} are aliases of |\tznodeframe*|.


You can change the |fill opacity| of \icmd{\tznodeframe*} by specifying the last curly brace option |{<fill opacity>}|. You can also move the node by specifying the |<shift coor>| option immediately before the coordinate.
(The \xem{empty} shift option |<>| is \xem{not allowed}.)


\begin{tzcode}{.3}
% \tznodeframe(*): opacity, shift
\begin{tikzpicture}
\tzhelplines[solid](4,3)
\tznodebox(0,0)
\tznoderectangle*(1,2)(A){A}{.1} % opacity
\tznodeframe[fill=yellow](2,2)(B){B}
\tznodeframe*[red](3,2)(C){Cat}
\tznodebox[fill=green]<-1,-2>(4,2)(D){Dog} % shift
\tzto[->,bend left=45](A.north)(C.90)
\tzto[->,bend right=45,dashed](B.-135)(D.west)
\end{tikzpicture}
\end{tzcode}

\remark
In addition to using the option |{<fill opacity>}|, you can use a macro to change the default value.
\begin{itemize}
\item The default fill opacity can be changed by the macro \icmd{\settzfillopacity}.
\item
The default fill color is |black!50|. You can use the macro \icmd{\settzfillcolor} to change the default fill color.
\item With |\tznodeframe|, you can change the color of the perimeter and text with the second bracket option |[<node opt>]|.
\end{itemize}


%%------------------------------------------------------------
\section{\protect\cmd{\tznodecircle} and \protect\cmd{\tznodecircle*}}
\label{s:tznodecircle}

\icmd{\tznodecircle} works just like |\tznodeframe| but with a circle node.

\begin{tzdef}
% syntax
\tznodecircle[<opt>]<shift coor>(<coor>)(<node name>){<text>}[<node opt>]
% defaults
  [draw,circle]<>(<m>)(){}[text=black]
\end{tzdef}

\icmd{\tznodecircle*} works just like |\tznodeframe*| but with a circle node.

\begin{tzdef}
% syntax
\tznodecircle*[<opt>]<shift coor>
              (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>}
% defaults
 *[circle,fill=black!50,fill opacity=.3,text opacity=1] <>
  (<m>)(){}[draw=black,text=black]{.3}
\end{tzdef}

\begin{tzcode}{.3}
% \tznodecircle
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodecircle(0,0)(A)
\tznodecircle(4,2)(B)[circle]
\tzline[red,thick](A)(B)
\tznodecircle[blue,scale=1.5](2,1){Node frame}
            [label=180:Left, pin=-45:pin]
\end{tikzpicture}
\end{tzcode}

You can change the |fill opacity| of |\tznodecircle*| by specifying the last curly brace option |{<fill opacity>}| or using |\settzfillopacity|. You can also move the node by specifying the |<shift coor>| option immediately before the coordinate.
The \xem{empty} shift coordinate option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% opacity, shift
\begin{tikzpicture}
\tzhelplines[solid](4,3)
\tznodecircle(0,0)
\tznodecircle*(1,2)(A){A}{.1} % opacity
\tznodecircle[fill=yellow](2,2)(B){B}
\tznodecircle*[red](3,2)(C){Cat}
\tznodecircle[fill=green]<-1,-2>(4,2)(D){Dog} % shift
\tzto[->,bend left=45](A.north)(C.90)
\tzto[->,bend right=45,dashed](B.-135)(D.west)
\end{tikzpicture}
\end{tzcode}



%%------------------------------------------------------------
\section{\protect\cmd{\tznodeellipse} and \protect\cmd{\tznodeellipse*}}
\label{s:tznodeellipse}

\icmd{\tznodeellipse} works just like |\tznodeframe| but with an ellipse node.

\begin{tzdef}
% syntax: 
\tznodeellipse[<opt>]<shift coor>(<coor>)(<node name>){<text>}[<node opt>]
% defaults
  [ellipse]<>(<m>)(){}[text=black]
\end{tzdef}

The starred version \icmd{\tznodeellipse*} works just like |\tznodeframe*| but with an ellipse node.

\begin{tzdef}
% syntax: 
\tznodeellipse*[<opt>]<shift coor>
               (<coor>)(<node name>){<text>}[<node opt>]{<fill opacity>}
% defaults
 *[ellipse,fill=black!50,fill opacity=.3,text opacity=1] <>
  (<m>)(){}[draw=black,text=black]{.3}
\end{tzdef}


\begin{tzcode}{.3}
% \tznodeellipse
\begin{tikzpicture}
\tzhelplines(4,3)
\tznodeellipse(0,3)
\tznodeellipse(0,0)(A)
\tznodeellipse(4,2)(B)[circle]
\tzline[blue,thick](A)(B)
\tznodeellipse[scale=1.5](2,1){Node frame}
            [label=180:Left, pin=-45:pin]
\end{tikzpicture}
\end{tzcode}

\icmd{\tznodeoval} and \icmd{\tznodeoval*} are aliases of |\tznodeellipse| and |\tznodeellipse*|, respectively.

You can change the |fill opacity| of |\tznodeellipse*| by specifying the last curly brace option |{<fill opacity>}|. You can also move the node by specifying the |<shift coor>| option immediately before the coordinate.
The \xem{empty} shift option |<>| is \xem{not allowed}.

\begin{tzcode}{.3}
% opacity, shift
\begin{tikzpicture}
\tzhelplines[solid](4,3)
\tznodeellipse(0,0)
\tznodeoval*(1,2)(A){A}{.1} % opacity
\tznodeoval[fill=yellow](2,2)(B){B}
\tznodeellipse*[red](3,2)(C){Cat}
\tznodeellipse[fill=green]<-1,-2>(4,2)(D){Dog} % shift
\tzto[->,bend left=45](A.north)(C.90)
\tzto[->,bend right=45,dashed](B.-135)(D.west)
\end{tikzpicture}
\end{tzcode}


%%==================================
\chapter{Lines}
\label{c:lines}

%%------------------------------------------------------------
\section{\protect\cmd{\tzline}: Connecting two points}
\label{s:tzline}

\icmd{\tzline} connects two points with a straight line.

\begin{tzdef}
% syntax: miminum
\tzline(<coor1>)(<coor2>)
% syntax: medium
\tzline[<opt>](<coor1>){<text1>}[<node opt1>]
              (<coor2>){<text2>}[<node opt2>]
% syntax: full
\tzline[<opt>]<shift coor>"<path name>"
       (<coor1>){<text1>}[<node opt1>]
       (<coor2>){<text2>}[<node opt2>]<code.append>
% defaults
  []<>""(<m>){}[above](<m>){}[]<>
\end{tzdef}


\begin{tztikz}
\tzline(0,1)(2,1) % works like:
  \draw (0,1) -- (2,1);
\end{tztikz}


\subsection{Line styles}
\label{ss:tzline:linestyles}

You can use the first optional argument |[<opt>]| to control the line styles.

\begin{tztikz}
\tzline[blue](0,1)(2,1) % works like:
  \draw [blue] (0,1) -- (2,1);
\end{tztikz}

\begin{tzcode}{.3}
% \tzline
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline[blue,->](0,0)(3,3)
\tzline[<->](0,2)(3,0)
\tzline[dashed](1,2)(4,0)
\tzdots*(1,2)(4,0);
\end{tikzpicture}
\end{tzcode}

\subsection{Adding text}
\label{ss:tzline:addingtext}

You can add text by specifying the optional arguments |{<text>}| and |[<node opt>]|.

\paragraph{Text next to the line}
With the options |{<text1>}[<node opt1>]| \xem{in-between} two coordinates, you can add text next to the line, with the option |[above,midway]| by default.

\begin{tztikz}
\tzline[blue](0,1){my line}[sloped](2,1) % works like:
  \draw [blue] (0,1) -- node [above,sloped] {my line} (2,1) ;
\end{tztikz}

\begin{tzcode}{.3}
% \tzline: text next to line
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline(0,0){Above}(4,0)              % default [above]
\tzline[blue](0,1){Near end}[b,near end](4,1)  % below
\tzline[->](0,2){Sloped}[sloped](3,3) % default [above]
\end{tikzpicture}
\end{tzcode}

You can use the \xem{abbreviations} (or aliases) of \Tikz\ basic placement options such as |a| for |above|, |bl| for |below left|, and so on. (For more details, see page \pageref{abbreviations}.)


\paragraph{Text at or around the last coordinate}

You can also add text at (by default) or around the second coordinate by specifying |{<text2>}| and |[<node opt2>]| immediately \xem{after} the second coordinate.

\begin{tztikz}
\tzline[blue](0,1)(2,1){my line}[r]     % works like:
  \draw [blue] (0,1) -- (2,1) node [right] {my line};
\end{tztikz}


\begin{tzcode}{.3}
% \tzline
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline[blue,->](0,0)(3,3){\textbf{line A}}[r]
\tzline[<->](0,2)(3,0){line B}[red,draw=blue,b=1mm]
\tzline[dashed](1,2){dashed}[sloped](4,0){line C}[ar]
\tzdots*(1,2)(4,0);
\end{tikzpicture}
\end{tzcode}

%\subsection{Relative coordinates: \texttt{+} or \texttt{++}}
%\label{ss:tzline:relative}
%
%You can make the second coordinate relative to the first.
%You can even select `|+| relative' or `|++| relative' by specifying the option |<+>| or |<++>| immediately before the second coordinate.
%
%\begin{tztikz}
%\tzline+(0,0)<+>(2,1) % works like:
%  \draw (1,1) -- + (2,1);
%\end{tztikz}
%
%\begin{tzcode}{.3}
%% \tzline
%\begin{tikzpicture}
%\tzhelplines(4,3)
%\tzline[blue,->](0,0)       (3,3) {A}[r]
%\tzline[<->]    (0,2){b} <+>(3,-2){B}[r]
%\tzline[dashed] (1,2){c}<++>(3,-2){C}[r]
%\tzdots*(1,2)(4,0);
%\end{tikzpicture}
%\end{tzcode}
%
%Notice that, with |\tzline|, |<+>| and |<++>| make no difference.
%But with the macro |\tzlines| it is not the case.
%
%\remark
%Notice that using |<+>| and |<++>| makes no difference in |\tzline|.
%But it is not the case with the macro |\tzlines| that connects multiple coordinates.

\subsection{Moving lines: \texttt{shift}}
\label{ss:tzline:shift}

You can move the line generated by |\tzline| by specifying the option |<shift coor>| before the first coordinate (to be precise, immediately before the option |"<path name>"|, which is put immediately before the first coordinate, if it exists).
The empty shift coor |<>| is not allowed.

\begin{tzcode}{.3}
% \tzline: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline[blue,->]     (0,0)(3,3){A}[r]
\tzline[blue]   <1,0>(0,0)(3,3){A}[r]
\tzline[dashed]         (1,2)(4,0){C}[r]
\tzline[dashed]<-.5,-.5>(1,2)(4,0){C}[r]
\tzdots*(1,2)(4,0);
\end{tikzpicture}
\end{tzcode}



\subsection{Extending paths}
\label{ss:tzline:extendingpath}

You can extend the path of |\tzline| from the last coordinate, by writing \Tikz\ code in the last optional argument |<code.append>|.

\begin{tzcode}{.3}
% \tzline: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline[blue,->](0,0)(3,3)<arc(0:-60:1cm)>
\tzline[dashed,->](1,2)(4,0)
       <to[bend left] ++(-4,1) node [a] {ends here!}>
\end{tikzpicture}
\end{tzcode}

You can also use \icmd{\tzlineAtBegin} and \icmd{\tzlineAtEnd} to extend a path of |\tzline| at the beginning and at end, respectively.
Specifying |<code.append>| extends the path after |\tzlineAtEnd|.

\begin{tzcode}{.3}
% \tzline: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline[blue,->](0,0)(3,3)<arc(0:-60:1cm)>
\tzlineAtBegin{(2,3) -|}
\tzlineAtEnd{ arc (-90:90:.5) node [a] {here?} }
\tzline[dashed,->](1,2)(4,0)
  < to[bend left] ++(-4,1) node [a] {ends here!} >
\end{tikzpicture}
\end{tzcode}

\subsection{Naming paths: Intersection points}
\label{ss:tzline:namepath}

When you specify the option |"<path name>"| immediately before the first coordinate, it works like |[name path=<path name>]| in the option list of |[<opt>]|.
You can use this name of path to find intersection points.

\begin{tzcode}{.3}
% \tzline+: name path
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline[blue,->]  "dem" (0,0)(3,3){demand}[r]
\tzline[dashed,->]"supp"(1,2)(4,0){supply}[ar]
% intersection point
\tzXpoint*{dem}{supp}
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzline+}: Relative coordinates}
\label{s:tzline+}

The \iisw{plus version} \icmd{\tzline+} takes the second coordinate |(<coor2>)| relative (with |++|) to the first coordinate |(<coor1>)|.
%That is, |\tzline+(A)(B)| is equivalent to |\tzline(A)<++>(B)|.

\xem{Everything else is the same as in} |\tzline|.

\begin{tzdef}
% syntax: full
\tzline+[<opt>]<shift coor>"<path name>"
        (<coor1>){<text1>}[<node opt1>]
        (<coor2>){<text2>}[<node opt2>]<code.append>
% defaults
 +[]<>""(<m>){}[above](<m>){}[]<>
\end{tzdef}


\begin{tztikz}
\tzline+(0,1)(2,1) % works like:
  \draw (0,1) -- ++ (2,1);
\end{tztikz}

\begin{tztikz}
\tzline+[dashed]"AA"(0,1){A}[red](2,1){B}[right,blue] % works like:
  \draw [dashed,name path=AA] 
        (0,1) -- node [red] {A} ++ (2,1) node [right,blue] {B};
\end{tztikz}


\begin{tzcode}{.3}
% \tzline+
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline+[blue,->](0,1)(3,2) {A}[r]
\tzline+[<->]        (0,2){b}(3,-2){B}[r]
\tzline+[dashed]<1,0>(0,2){b}(3,-2){B}[r]
\end{tikzpicture}
\end{tzcode}


\begin{tzcode}{.3}
% \tzline+: name path
\begin{tikzpicture}
\tzhelplines(4,3)
\tzline+[blue,->]  "dem" (0,0)(3,3){demand}[r]
\tzlineAtBegin{(0,1) to [bend left] }
\tzline+[dashed,->]"supp"(1,2)(3,-2){supply}[ar]
% intersection point
\tzXpoint*{dem}{supp}
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{Styles: \texttt{tzshorten} and \texttt{tzextend}}
\label{s:tzshorten}

The styles \ixxw{tzshorten} and \ixxw{tzextend} are defined as follows:

\begin{tzsty}
% tzshorten
\tikzset{%
  tzshorten/.style 2 args ={shorten <=#1, shorten >=#2},
  tzshoretn/.default={2pt}{2pt}
}

% tzextend (negative tzshorten)
\tikzset{%
  tzextend/.style 2 args ={shorten <=-#1, shorten >=-#2},
  tzextend/.default={2pt}{2pt}
}
\end{tzsty}

For example, |[tzshorten={2mm}{1mm}]| is equivalent to |[shorten <=2mm,shorten >=1mm]| in \Tikz. Simple |[tzshorten]| means that |[tzshorten={2pt}{2pt}]| by default.

The style |tzextend| is a negative |tzshorten|. For example, |tzextend{2mm}{1mm}| is equivalent to |tzshorten{-2mm}{-1mm}|.


\begin{tzcode}{.3}
% tzshorten, tzextend
\begin{tikzpicture}
\tzhelplines(4,3)
\tzdots(0,0)(3,0);  \tzline(0,0)(3,0)
\tzdots(0,1)(3,1);
\tzline[->,thick,blue,tzshorten={2mm}{1mm}](0,1)(3,1)
\tzdots(1,2)(3,2);
\tzline[<->,thick,red,tzextend={1cm}{1cm}](1,2)(3,2)
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzlines}: Connecting multiple points: Semicolon version}
\label{s:tzlines}

\icmd{\tzlines} connects two or more points with connected line segments.
Since |\tzlines| takes an arbitrary number of coordinates as arguments, it is a \xem{semicolon version}. So, you need to enter a semicolon `|;|' to indicate when the coordinate iteration ends.

\begin{tzdef}
% syntax: minimum
\tzlines(<coor>)(<coor>)..repeated..(<coor>) ;
% syntax: medium
\tzlines(<coor>){<text>}[<node opt>]..repeatd..(<coor>){<text>}[<node opt>] ;
% syntax: full
\tzlines[<opt>]<shift coor>"<path name>" 
        (<coor>){<text>}[<node opt>]
        ..repeated.. (){}[] ; <code.append>
% defaults
  []<>"" (<m>){}[] ..repeated.. (){}[] ; <>
\end{tzdef}


\begin{tztikz}
\tzlines(1,1)(2,2)(3,1)(4,3); % works like:
  \draw (1,1) -- (2,2) -- (3,1) -- (4,3);
\end{tztikz}

The whole repeating pattern in |\tzlines| is the triple |(<coor>){<text>}[<node opt>]|. 
%Any |<+ or ++>| after the last coordinate, if any, is ignored.

\begin{tztikz}
\tzlines(1,1)(2,2)(3,1){C}(4,3){D}[r]; % works like:
  \draw (1,1) -- (2,2) -- (3,1) -- node {C} (4,3) node [right] {D};
\end{tztikz}

\paragraph{Line styles}
Use the first optional argument |[<opt>]| to control the style of the connected line drawn by |\tzlines|.

\begin{tzcode}{.3}
% \tzlines: line style
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines[blue,<->](0,1)(1,2)(3,1)(4,3); % semicolon
\tzlines[dashed](0,0)(1,1)(2,1)(3,0);
\end{tikzpicture}
\end{tzcode}

\paragraph{Adding text}

You can add text in the |midway|, by default, of each line segment by specifying the options |{<text>}| and |[<node opt>]| immediately after each coordinate (except the last one).
The options |{<text>}| and |[<node opt>]| after the last coordinate put |<text>| at or around the last coordinate.


\begin{tzcode}{.3}
% \tzlines: adding text
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines[red,thick,<->,text=blue]
        (0,1){Up}
        (1,2){Down}[a,sloped]
        (3,1){Up}
        (4,3){line A} ;
\tzlines[dashed](0,0)(1,1)(2,1)(3,0){line B}[r];
\end{tikzpicture}
\end{tzcode}

%\paragraph{Relative coordinates: \texttt{+} and \texttt{++}}
%
%You can make the coordinates (from the second coordinate) relative to the previous one by specifying the option |<+>| and |<++>| immediately before the coordinates.
%(In \Tikz, only |<++>| refreshes the \xem{current point} to new one.)
%
%\begin{tzcode}{.3}
%% \tzlines
%\begin{tikzpicture}
%\tzhelplines(4,3)
%\tzlines[red,thick,<->,text=blue]
%        (0,1){Up}
%     <+>(1,1){Down}[a,sloped] % current point: (0,1)
%    <++>(3,0){Up} % new current point: (3,1)
%    <++>(1,2){line A} ;
%\tzlines[dashed](0,0)(1,1)(2,1)<++>(1,-1){line B}[r];
%\end{tikzpicture}
%\end{tzcode}

\paragraph{Shift}
You can move the connected line by specifying |<shift coor>| before the first coordinate or immediately before the option |"<path name>"| if it exists.
(The empty shift option |<>| is not allowed.)

\begin{tzcode}{.3}
% \tzlines: shift
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines[red,thick,<->,text=blue]
  <0,-1>(0,1)
        (1,2)
        (3,1)
        (4,3){shifted\\line A}[align=left,ar] ;
\tzlines[dashed]<1,0>(0,0)(1,1)(2,1)(3,0){line B}[r] ;
\end{tikzpicture}
\end{tzcode}


\paragraph{Naming paths}
You can name the path of |\tzlines| by specifying the option |"<path name>"| immediately before the first coordinate.

\begin{tzcode}{.3}
% \tzlines: shift, intersection
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines[red,thick,<->,text=blue]
  <0,-1>"AA"(0,1)
  (1,2)(3,1)(4,3){shifted\\line A}[align=left,ar] ;
\tzlines[dashed]
  <1,0>"BB"(0,0)(1,1)(2,1)(3,0){line B}[r] ;
% intersection points
\tzXpoint*{AA}{BB}(X){X1}[-90] % [<angle>] for point
\tzdot(X-2){X2}[0]             % [<angle>] for dot
\end{tikzpicture}
\end{tzcode}



\paragraph{Extending paths}
You can extend the path of |\tzlines| by writing \Tikz\ code in the \xem{last} (even \xem{after the semicolon}) optional argument |<code.append>|.

\begin{tzcode}{.3}
% \tzlines: <code.append>
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines[red,thick,<->,text=blue]
        (0,1){Up}
        (1,2){Down}[a,sloped]
        (3,1){Up}
        (4,3) ;
        <arc(0:90:1cm)>
\tzlines[dashed]
        (0,0)(1,1)(2,1)(3,0) ; 
        <to[bend right] ++(2,2) node{Here!}>
\end{tikzpicture}
\end{tzcode}

You can close the path with a straight line by |<--cycle>|.

\begin{tzcode}{.3}
% \tzlines: closed path
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines[red,thick,<->,text=blue]
        (0,1){Up}
        (1,2){Down}[a,sloped]
        (3,1){Up}
        (4,3){line A} ; <--cycle>
\tzlines[dashed]
  (0,0)(1,1)(2,1)(3,0){line B}[r] ; <--cycle>
\end{tikzpicture}
\end{tzcode}

You can also use \icmd{\tzlinesAtBegin} and \icmd{\tzlinesAtEnd} to extend a path of |\tzlines| at the beginning and at the end, respectively.
Specifying |<code.append>| extends the path after |\tzlinesAtEnd|, if it exists.

\begin{tzcode}{.3}
% \tzlines: extending paths
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlinesAtBegin{(1,3) to [bend right]}
\tzlinesAtEnd{arc(0:90:1cm)}
\tzlines[red,thick,<->,text=blue]
        (0,1){Up}
        (1,2){Down}[a,sloped]
        (3,1){Up}
        (4,3) ;
\tzlinesAtEnd{to[bend right] ++(2,2) node{Here!}}
\tzlines[dashed]
        (0,0)(1,1)(2,1)(3,0){not here}[b];
        < -| ++(-1,-1) node [draw,b] {Ends here!!} >
\end{tikzpicture}
\end{tzcode}


%%------------------------------------------------------------
\section{\protect\cmd{\tzlines+}: Relative coordinates: Semicolon version}
\label{s:tzlines+}

The \iisw{plus version} \icmd{\tzlines+} connects two or more points with connected line segments, but each coordinate (except the first one) is \xem{relative} to the previous coordinate. 
%For example, |\tzline+(A)(B)(C)(D);| is equivalent to |\tzline(A)<++>(B)<++>(C)<++>(D);|.

\xem{Everything else is the same as in} |\tzlines|.
It is also required to enter a \xem{semicolon} to indicate when the coordinate iteration ends.


\begin{tzdef}
% syntax: minimum
\tzlines+ (<coor>)(<coor>) ..repeat.. (<coor>) ;
% syntax: full
\tzlines+[<opt>]<shift coor>"<path name>" 
         (<coor>){<text>}[<node opt>]
         ..repeated.. (){}[] ; <code.append>
% defaults
  []<>"" (<m>){}[] ..repeated.. (){}[] ; <>
\end{tzdef}


\begin{tztikz}
\tzlines+(0,1)(1,1)(2,-1)(1,2); % works like:
  \draw (0,1) -- ++(1,1) -- ++(2,-1) -- ++(1,2);
\end{tztikz}


\begin{tztikz}
\tzlines+[dashed]"AA"(0,1){A}(1,1){B}(2,-1){C}(1,2){D}[right]; % works like:  
  \draw [dashed,name path=AA] 
      (0,1) -- node {A} ++(1,1) 
            -- node {B} ++(2,-1) 
            -- node {C} ++(1,2)  node [right] {D} ;
\end{tztikz}


\begin{tzcode}{.3}
% \tzlines+
\begin{tikzpicture}
\tzhelplines(4,3)
\tzlines+[red,thick,<->,text=blue]
         (0,1){Up}
         (1,1){Down}[a,sloped]
         (2,-1){Up}
         (1,2){line A} ;
\tzlines+[dashed,auto,text=red]
         (0,0){A}
         (1,1){B}
         (1,0){C}
         (1,-1){line B}[blue,draw,r] ;
\end{tikzpicture}
\end{tzcode}



\begin{tzcode}{.3}
% \tzlines+: shift
\begin{tikzpicture}
\tzhelplines*(4,3)
\tzlines+[red,thick,<->,text=blue]
       <1,1>  (0,1){Up}
         (1,1){Down}[a,sloped]
         (2,-1){Up}
         (1,2){line A} ;
\tzcoors(0,0)(A)(1,1)(B)(1,0)(C)(1,-1)(D);
\tzlines+[dashed,auto,text=red]
        <-1,.5> (A){A}
         (B){B}
         (C){C}
         (D){line B}[blue,draw,r] ;
\end{tikzpicture}
\end{tzcode}