summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/rubik/rubiktwocube.dtx
blob: 3e243cd8029af08c0ed86b32405d1cfefc39e4c9 (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
% \iffalse meta-comment
%  rubiktwocube.dtx
% 
%  version v5.0  
%  February 25, 2018
%
%
%  Copyright 2018 
%  RWD Nickalls (dick@nickalls.org) and 
%  A Syropoulos (asyropoulos@yahoo.com)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
%
% This work consists of the files rubiktwocube.dtx and rubiktwocube.ins
% and the derived file rubiktwocube.sty.
%
%<*readme>
%
% The rubikcube package provides a collection of LaTeX commands and macros 
% for the typesetting of Rubik cube configurations and rotation 
% sequences using the TikZ graphic language.
%
% Please report errors or suggestions for improvement to
%
%         Dick Nickalls or Apostolos Syropoulos
%
% This package requires the basic TikZ package to be loaded already
%</readme>
%
%<*driver>
\listfiles
\documentclass{ltxdoc}
\IfFileExists{rubiktwocube.sty}{\usepackage{rubiktwocube}}{%
    \GenericWarning{rubiktwocube.dtx}{Package file rubiktwocube.sty not found.
    Documentation will be messed up!^^J
    (Generate rubiktwocube.sty by (La)TeXing rubiktwocube.ins, and then^^J
    process rubiktwocube.dtx again)^^J}\stop
}%
\pagestyle{myheadings}
\markright{\texttt{rubiktwocube} \ \ (Rubik bundle v5.0, 2018) \ \ \texttt{www.ctan.org/pkg/rubik}}
\usepackage{rubikcube}  %% we require macros  @join and  rubikfont 
\usepackage{ifpdf}
\usepackage{url,path}     %% for references
\usepackage{supertabular} %% for Notation table
\usepackage{hypdoc}       %% for hyperref documenting of LaTeX packages
%%\OnlyDescription
\EnableCrossrefs
\PageIndex
\CodelineIndex
\CodelineNumbered
\RecordChanges
\setcounter{StandardModuleDepth}{1}
\begin{document}
  \DocInput{rubiktwocube.dtx}
  \PrintChanges
  \PrintIndex
\end{document}
%</driver>
% \fi
%
%
% 
%%% \CheckSum{2308} 
%
%%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
%
% \title{%
%       \ifpdf\pdfbookmark[1]{Title}{Title}\else\fi%
%        The \rubiktwocube\ package}
%
% \author{
%      RWD Nickalls (dick@nickalls.org) \\
%     A Syropoulos (asyropoulos@yahoo.com)
%       }
%  \date{This file describes version \RTCfileversion\ (\RTCfiledate)\\
%   \texttt{www.ctan.org/pkg/rubik}}
%  \maketitle
%
%  \begin{abstract}
%  The \rubiktwocube\ package provides LaTeX commands and macros 
%  for  typesetting  TwoCube (2x2x2) notation,  configurations, and 
%  rotation sequences  using the  TikZ graphic language. It is part of the 
%   Rubik `bundle'.
%  \end{abstract}
%
% 
% \begin{minipage}{12cm}
% \centering
% \ifpdf
%  \strut\hspace{5mm}\includegraphics[width=12cm]{rubiktwo-doc-figA.pdf}
% \else
% \fi
% \end{minipage}
% 
%
%  \tableofcontents
%
% \pagebreak
%
% \section{Introduction}
%
% The  \rubiktwocube\  package (part of the \textsc{rubik} `bundle') provides  a 
% collection of \LaTeX\ commands 
% and macros for  typesetting  Rubik 2x2x2 cube  configurations  using the  
% PGF/TikZ graphic languages. 
% This package is a minor extension of the \textsc{rubikcube} package, and users are
% therefore  assumed to be familiar with  both the \textsc{rubikcube} and \textsc{rubikrotation}
%  packages. For examples of use see the file \texttt{rubikexamples.pdf}.
%
%
%      \subsection{Requirements}
%
%  The \rubiktwocube\ package requires the TikZ package (since it makes  
%  use  of the TikZ picture environment), and  also  the 
%  \textsc{rubikcube}   package.
%
%  For full functionality the complementary packages \textsc{rubikrotation}  and 
%  \textsc{rubikpatterns} also need to be loaded.
%  Note that the \textsc{rubikrotation}  package requires  Perl to be installed.
%  See  the `Installation' section in the \textsc{rubikcube} package documentation
% (\texttt{rubikcube.pdf}) for more  details.

% 
% 
%
%  \subsection{Copyright}
%  Copyright 2014--2018 RWD Nickalls and A Syropoulos.
%
% \medskip
% {\noindent}This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or any
% later version. The latest version of this licence is in 
%  |www.latex-project.org/lppl.txt|
%
%
% \section{Installation}
%
% The Rubik bundle consists of the four packages \textsc{rubikcube}, \textsc{rubikrotation},
% \textsc{rubikpatterns} and  \textsc{rubiktwocube}.
%
% Here we describe only the installation of the \textsc{rubiktwocube} package, 
% which  consists of the  following files:
%\begin{verbatim}
%   rubiktwocube.ins
%   rubiktwocube.dtx
%   rubiktwocube.pdf         --documentation of the rubiktwocube package
%   rubiktwo-doc-figA.pdf
%\end{verbatim}
% Before installing the \textsc{rubiktwocube} package make sure the following packages
% are already installed  (TikZ graphics system and the \textsc{rubikcube} package).
%
%
%  \subsection{\texttt{rubiktwocube.sty}}
%
%  The  style option \texttt{rubiktwocube.sty} is generated by  running (pdf)\LaTeX\ on  
% the file \texttt{rubiktwocube.ins}  as follows:
%\begin{verbatim}
%   pdflatex  rubiktwocube.ins 
%\end{verbatim}
%
%
%  \subsection{\texttt{rubiktwocube.pdf}}
%
% The documentation file (\texttt{rubiktwocube.pdf}) is then generated using the following
% steps\,\footnote{Several pdflatex runs are required, since the documentation includes 
% an index as well as hyperef links (the package \texttt{hypdoc}
% is used). Prior to the first run it is
% a good idea to delete any relevant \texttt{.toc}, \texttt{.aux}, \texttt{.out} files.}:
%\begin{verbatim}
%   pdflatex   rubiktwocube.dtx
%   pdflatex   rubiktwocube.dtx
%   makeindex -s gind.ist  rubiktwocube
%   makeindex -s gglo.ist -o rubiktwocube.gls  rubiktwocube.glo
%   pdflatex   rubiktwocube.dtx
%   pdflatex   rubiktwocube.dtx
%\end{verbatim}
%
%
%  \subsection{Placing the files}
%
% Place the files either in the local working directory, or where your system 
% will find them. For a Linux system with a standard \TeX\ Directory Structure (TDS), then:
%
%\medskip
%{\noindent}*.sty  $\rightarrow$ 
%   \texttt{/usr/local/texlive/texmf-local/tex/latex/rubik/}
%{\newline}*.pdf  $\rightarrow$  \texttt{/usr/local/texlive/texmf-local/doc/rubik/}
%
% \medskip
% {\noindent}Finally, (depending on your system) update the  \TeX\ file database.
% For~example, on a Linux system one uses the  \texttt{texhash} command.
%
%
% \subsection{Usage}
%
% Load the package by using the command \cmd{\usepackage\{rubiktwocube\}}.
% Note that the \rubiktwocube\ package requires the TikZ package, and so always load TikZ 
% before \rubiktwocube\  as follows:
% \begin{quote}
%\begin{verbatim}
% \usepackage{tikz}
% \usepackage{rubikcube,rubikrotation,rubikpatterns,rubiktwocube}
%\end{verbatim}
% \end{quote}
%
%
%
%  \subsection{\texttt{rubikexamples.pdf}}
%
% The Rubik bundle includes a  `RubikExamples' file (\texttt{rubikexamples.pdf})
% as well as associated  \texttt{.sh} (Linux) and \texttt{.bat} (Microsoft) batch 
% files which can be used to facilitate processing the source file (\texttt{rubikexamples.tex}). 
% See  the `Installation' section in the \textsc{rubikcube} package documentation
% (\texttt{rubikcube.pdf}) for details regarding processing the  examples source file.
%
%
%
%  \pagebreak
%
%        \section{Command conventions}
%        \label{sec:conventions}
%
%  The examples given in  the file \texttt{rubikexamples.pdf} present a good overview of 
%  the commands and how to use them.
% 
%
%
%   \subsection[Keywords Two and Rubik]{The keywords Two and Rubik in commands}
%
% In order to try and keep commands intuitive\,\footnote{This is a tricky problem 
% given the large number of commands, so any  feedback or  ideas on how to avoid ambiguity, 
% including  pruning or revising `bad' commands, is always welcome.} 
% we adopt the convention that  the word `Two' in a command  reflects the fact that 
% the command  relates to a 2x2x2 cube (a `Two' cube). Similarly, commands which relate 
% to a 3x3x3 cube (a `Rubik' cube) ---see the \textsc{rubikcube} package--- 
% use instead the word `Rubik'. 
%
%
%
% It is assumed that users are familiar with the \textsc{rubikcube} 
% and \textsc{rubikrotation} packages, since virtually all \rubiktwocube\  
% commands  mirror  the Rubik (3x3x3) cube commands, such that  the word  `Rubik'  
% is  replaced by the word `Two' (exceptions are highlighted). 
% For example, the commands for drawing a 2x2x2 cube  and a 3x3x3 cube from a RU viewpoint
% are respectively \cmd{\DrawTwoCubeRU} and \cmd{\DrawRubikCubeRU}.
%  The examples given in  the file \texttt{rubikexamples.pdf} present a good overview of 
% the commands and how to use them.
%
%  For more detailed information see (a)~the `code' section (Section~\ref{sec:thecode}), 
%  or (b)~see the equivalent  3x3x3 commands in the \textsc{rubikcube} package.
%
%
%
%
%
%  \section{Colour commands}
%   \label{sec:listofcolourcommands}
%
% The following  list  shows the \rubiktwocube\  colour commands  paired 
% (for convenience) with the equivalent 3x3x3 version from the 
% \textsc{rubikcube} package. The \texttt{..} indicates that mandatory arguments are required.
%
% 
%\begin{verbatim}
%  RubikCube           TwoCube
%  3x3x3               2x2x2
%
% \RubikCubeSolved       \TwoCubeSolved
% \RubikCubeSolvedWY     \TwoCubeSolvedWY
% \RubikCubeSolvedWB     \TwoCubeSolvedWB
% \RubikCubeGrey         \TwoCubeGrey
% \RubikCubeGray         \TwoCubeGray
% \RubikCubeGreyWY
% \RubikCubeGrayWY
% \RubikCubeGreyWB
% \RubikCubeGrayWB
% \RubikCubeGreyAll      \TwoCubeGreyAll
% \RubikCubeGrayAll      \TwoCubeGrayAll
% \RubikSolvedConfig..   \TwoSolvedConfig..
%
% \RubikFaceUp..         \TwoFaceUp..
% \RubikFaceDown..       \TwoFaceDown..
% \RubikFaceLeft..       \TwoFaceLeft..
% \RubikFaceRight..      \TwoFaceRight..
% \RubikFaceFront..      \TwoFaceFront..
% \RubikFaceBack..       \TwoFaceBack..
% \RubikFaceUpAll..      \TwoFaceUpAll..
% \RubikFaceDownAll..    \TwoFaceDownAll..
% \RubikFaceLeftAll..    \TwoFaceLeftAll..
% \RubikFaceRightAl..    \TwoFaceRightAll..
% \RubikFaceFrontAl..    \TwoFaceFrontAll..
% \RubikFaceBackAll..    \TwoFaceBackAll..
%
% \RubikSidebarWidth..   \TwoSidebarWidth..          
% \RubikSidebarLength..  \TwoSidebarLength..          
% \RubikSidebarSep..     \TwoSidebarSep..          
%
% \RubikSliceTopL..      \TwoSliceTopL..
% \RubikSliceTopR..      \TwoSliceTopR..
% \RubikSliceBottomL..   \TwoSliceBottomL..
% \RubikSliceBottomR..   \TwoSliceBottomR..
%\end{verbatim}
%
%
%
%  \section{Draw commands}
%   \label{sec:listofdrawcommands}
%
% The following  list  shows the \rubiktwocube\  Draw commands  paired 
% (for convenience) with the equivalent 3x3x3 version from the 
% \textsc{rubikcube} package. Commands in round brackets show short-hand 
% equivalents.
%
%
%\begin{verbatim}
%  RubikCube               TwoCube
%  3x3x3                   2x2x2
%
% \DrawRubikCubeRU         \DrawTwoCubeRU
% \DrawRubikCubeRD         \DrawTwoCubeRD
% \DrawRubikCubeLU         \DrawTwoCubeLU
% \DrawRubikCubeLD         \DrawTwoCubeLD
% \DrawRubikCubeF          \DrawTwoCubeF
% \DrawRubikCubeSF         \DrawTwoCubeSF
%
% \DrawRubikCubeSidebarFL..  \DrawTwoCubeSidebarFL..
% \DrawRubikCubeSidebarFR..  \DrawTwoCubeSidebarFR..
% \DrawRubikCubeSidebarFU..  \DrawTwoCubeSidebarFU..
% \DrawRubikCubeSidebarFD..  \DrawTwoCubeSidebarFD..
% \DrawRubikCubeSidebarBL..  \DrawTwoCubeSidebarBL..
% \DrawRubikCubeSidebarBR..  \DrawTwoCubeSidebarBR..
% \DrawRubikCubeSidebarBU..  \DrawTwoCubeSidebarBU..
% \DrawRubikCubeSidebarBD..  \DrawTwoCubeSidebarBD..
%
% \DrawRubikFaceUp         \DrawTwoFaceUp         (= \DrawTwoFaceU )
% \DrawRubikFaceDown       \DrawTwoFaceDown       (= \DrawTwoFaceD )
% \DrawRubikFaceLeft       \DrawTwoFaceLeft       (= \DrawTwoFaceL )
% \DrawRubikFaceRight      \DrawTwoFaceRight      (= \DrawTwoFaceR )
% \DrawRubikFaceFront      \DrawTwoFaceFront      (= \DrawTwoFaceF )
% \DrawRubikFaceBack       \DrawTwoFaceBack       (= \DrawTwoFaceB )
%
% \DrawRubikFaceUpSide     \DrawTwoFaceUpSide     (= \DrawTwoFaceUS )
% \DrawRubikFaceDownSide   \DrawTwoFaceDownSide   (= \DrawTwoFaceDS )
% \DrawRubikFaceLeftSide   \DrawTwoFaceLeftSide   (= \DrawTwoFaceLS )
% \DrawRubikFaceRightSide  \DrawTwoFaceRightSide  (= \DrawTwoFaceRS )
% \DrawRubikFaceFrontSide  \DrawTwoFaceFrontSide  (= \DrawTwoFaceFS )
% \DrawRubikFaceBackSide   \DrawTwoFaceBackSide   (= \DrawTwoFaceBS )
%
% \DrawRubikFlatUp..       \DrawTwoFlatUp..
% \DrawRubikFlatDown..     \DrawTwoFlatDown..
% \DrawRubikFlatLeft..     \DrawTwoFlatLeft..
% \DrawRubikFlatRight..    \DrawTwoFlatRight..
% \DrawRubikFlatFront..    \DrawTwoFlatFront..
% \DrawRubikFlatBack..     \DrawTwoFlatBack..
%
%\end{verbatim}
%
%
%
%
%  \section{Rotation commands}
%   \label{sec:rotationcommands}
%
%  \bigskip
%
%
%\begin{verbatim}
%  RubikCube           TwoCube
%  3x3x3               2x2x2
%
% \RubikRotation..     \TwoRotation..
% \SaveRubikState..    \SaveTwoState..
% \ShowErrors          \ShowErrors
% \CheckState          \CheckState
%\end{verbatim}
%
%
%  \subsection{List of rotation commands}
%   \label{sec:listofrotationcommands}
%
%
% All the commands presented here also have a \cmd{\Two\{\}} equivalent form which 
% typesets both the hieroglyph and its lettercode in a vertical format. 
% These have been omitted  here owing to the difficulty of including this form easily 
% in the following table.
%
% 2x2x2 \textsc{changes}: Note that all these command names mirror their 3x3x3 equivalents in 
% the \textsc{rubikcube} package; the changes in the command prefixes 
% are as follows: 
%
% \cmd{\tr} $\leftarrow$ \cmd{\rr}
%
% \cmd{\trh} $\leftarrow$ \cmd{\rrh}
%
% \cmd{\Two} $\leftarrow$ \cmd{\Rubik}
%
% \cmd{\textTwo} $\leftarrow$ \cmd{\textRubik}
%
% \pagebreak
%
%  \subsubsection{Face rotations}
%   \label{sec:facerotations}
%
%
%  \newcommand{\dnstrut}{\rule{0pt}{17pt}}
%  \newcommand{\dns}{\hspace{2mm}}
%  \newcommand{\dnsp}{\hspace{2mm}} 
%
%  \newcommand{\dnTwo}[1]{%
%    \dnstrut\tr{#1}\dns\cmd{\tr\{#1\}}%
%    & \trh{#1}\dns\cmd{\trh\{#1\}}%
%    & \Two{#1}\dns\cmd{\Two\{#1\}} \nonumber\\%
%    }%  
%
%  \newcommand{\dntextTwo}[1]{%
%   \dnstrut\tr{#1}\dns\cmd{\tr\{#1\}}%
%   & \trh{#1}\dns\cmd{\trh\{#1\}}%
%   & \textTwo{#1}\dns\cmd{\textTwo\{#1\}} \nonumber\\%
%   }%
%
%
%  \begin{supertabular}[lll]{p{3cm} p{3cm} p{4.5cm}}
%   \dntextTwo{U}
%   \dntextTwo{Up}
%   \dntextTwo{D}
%   \dntextTwo{Dp}
%   \dntextTwo{L}
%   \dntextTwo{Lp}
%   \dntextTwo{R}
%   \dntextTwo{Rp}
%   \dntextTwo{F}
%   \dntextTwo{Fp}
%   \dntextTwo{B}
%   \dntextTwo{Bp}
%  \end{supertabular}
%
%
%
%    \subsubsection{Axis rotations}
%     \label{sec:listofaxisrotations}
%
%  \begin{supertabular}[lll]{p{3cm} p{3cm} p{4.5cm}}
%   \dnTwo{x}
%   \dnTwo{xp}
%   \dnTwo{y}
%   \dnTwo{yp}
%   \dnTwo{z}
%   \dnTwo{zp}
%  \end{supertabular}
%
%
%  \begin{supertabular}[lll]{p{3cm} p{3cm} p{4.5cm}}
%   \dnTwo{u}
%   \dnTwo{up}
%   \dnTwo{d}
%   \dnTwo{dp}
%   \dnTwo{l}
%   \dnTwo{lp}
%   \dnTwo{r}
%   \dnTwo{rp}
%   \dnTwo{f}
%   \dnTwo{fp}
%   \dnTwo{b}
%   \dnTwo{bp}
%  \end{supertabular}
%
%
%  \begin{supertabular}[lll]{p{3cm} p{3cm} p{4.5cm}}
%   \dnTwo{Uc}
%   \dnTwo{Ucp}
%   \dnTwo{Dc}
%   \dnTwo{Dcp}
%   \dnTwo{Lc}
%   \dnTwo{Lcp}
%   \dnTwo{Rc}
%   \dnTwo{Rcp}
%   \dnTwo{Fc}
%   \dnTwo{Fcp}
%   \dnTwo{Bc}
%   \dnTwo{Bcp}
%  \end{supertabular}
%
%
%  \begin{supertabular}[lll]{p{3cm} p{3cm} p{4.5cm}}
%   \dnTwo{CR}
%   \dnTwo{CRp}
%   \dnTwo{CL}
%   \dnTwo{CLp}
%   \dnTwo{CU}
%   \dnTwo{CUp}
%   \dnTwo{CD}
%   \dnTwo{CDp}
%   \dnTwo{CF}
%   \dnTwo{CFp}
%   \dnTwo{CB}
%   \dnTwo{CBp}
%  \end{supertabular}
%
%
%
%    \section{References}
%  
%  See the \textsc{rubikcube} package documentation for a full list of references.  
%
%
%    \section{Change history}
% 
% \begin{itemize}
%
% \item Version 5.0 (February 2018)
%
%  ---First release.
%
% \end{itemize}
%  
%
%
%
% ^^A =======================
% \StopEventually{\PrintIndex}
%
% \bigskip\bigskip\bigskip\bigskip
%
% \section{The code} 
%   \label{sec:thecode}
%  
%  All the 2x2x2 code here is essentially a  cut-down version of the  
%  3x3x3  code (\textsc{rubikcube} package); i.e.,~we have mostly just 
%  removed the 3x3x3 code relating to middle columns and rows, exchanged the 
%  word `Rubik' for the word `Two' in command names, and refashioned some of the commands 
%  involved in writing the  temporary file \texttt{rubikstate.dat}.
%  We assume that users are familiar with the \textsc{rubikcube} and 
%  \textsc{rubikrotation} package  documentation.
%
%  In order to avoid much repetition,  we describe here only the 
%  essential details for understanding the relatively minor changes made in order to 
%  transform the earlier 3x3x3  \textsc{rubikcube} package code into 
%  working 2x2x2 code. In the following, the various instances of the 
%  heading `\textsc{changes:}' imply that more extensive details will be found 
%  with the equivalent `Rubik' commands in  the \textsc{rubikcube} or \textsc{rubikrotation} 
%  package documentation.
%
%  Relatively  few 2x2x2 square hieroglyphs are required; some needed
%  reformulating  from their 3x3x3 cousins, ie those associated 
%  with  \texttt{L,\,Lp,\,R,\,Rp,\,U,\,Up,\,D,\,Dp}. 
%  The axis rotations and the rotations \texttt{F,\,Fp,\,B,\,Bp}  simply required 
%  renaming; for~example, as a `TwoRotationHieroglyph' (\cmd{\trh..}) instead of 
%  the 3x3x3 `RubikRotationHieroglyph (\cmd{\rrh..}).   
%
%
%
%
%   \subsection{Package heading}
% 
% The `RTC' in the following refers to the package name RubikTwoCube.
%
%    \begin{macrocode}
%<*rubiktwocube>
\def\RTCfileversion{5.0}%
\def\RTCfiledate{2018/02/25}% February 25, 2018
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{rubiktwocube}[\RTCfiledate\space (v\RTCfileversion)]
%    \end{macrocode}
%  The package requires TikZ (we use the  pgfmathsetmacro command)
%  ---so we load it if not already loaded.
%    \begin{macrocode}
\@ifpackageloaded{tikz}{}{%
  \typeout{---rubiktwocube requires the TikZ package.}%
  \RequirePackage{tikz}}%
%    \end{macrocode}
%
%
%
% {\noindent}The package requires \texttt{rubikcube.sty}. However \texttt{rubikcube.sty}
% is not automatically loaded (for the moment at least) since this makes it difficult 
% to errorcheck new versions, so we just write a message.
%    \begin{macrocode}
\@ifpackageloaded{rubikcube}{}{%
   \typeout{---rubiktwocube requires the rubikcube package.}%
   }%
\@ifpackageloaded{rubikrotation}{}{%
   \typeout{---rubiktwocube requires the rubikrotation package.}%
   }%
%    \end{macrocode}
%
%    \begin{macro}{\rubiktwocube}
%  First we create a suitable logo
%    \begin{macrocode}
\newcommand{\rubiktwocube}{\textsc{rubiktwocube}}%
%    \end{macrocode}
%    \end{macro}
%
%
%
%
%    \subsection{Saving the Two-cube state}
%    \label{sec:codesavingtwostate}
%
% Note that this package   writes  this state data to the same `output' file 
% (\texttt{rubikstate.dat}) as used by the 3x3x3 \textsc{rubikrotation} package, 
% since there is no need to change this (since the TwoCube corners will be processed in
% exactly the same way as for 3x3x3 cube corners).
%
%    \begin{macro}{\@printTWOstate}
%  This internal command  writes the TwoCube  state data to
%  the  `output' file \texttt{rubikstate.dat}, and is used by the \cmd{\TwoRotation} command
%  (see  also \textsc{rubikrotation} package documentation  Sections on \textit{save rubikstate} 
%  and \textit{general overview} for further details).
%  The file \texttt{rubikstate.dat} is read by the Perl script, and represents 
%  the state on which the  \cmd{\TwoRotation} command acts.
% 
%  \textsc{changes}: Since this is a TwoCube all the non-corner facelets 
%  (ie those in middle rows \& columns) are filled with X (grey). 
%  We have also introduced a new line  in the output file (\texttt{rubikstate.dat})
%  namely \texttt{cubesize,two} which is used to inform the Perl program  that we 
%  are dealing with a TwoCube. 
%    \begin{macrocode}
\newcommand{\@printTWOstate}{%
   \@print{cubesize,two}%
   \@print{\space \space up,\Ult,\Umt,\Urt,\Ulm,\Umm,\Urm,\Ulb,\Umb,\Urb}%
   \@print{down,\Dlt,\Dmt,\Drt,\Dlm,\Dmm,\Drm,\Dlb,\Dmb,\Drb}%
   \@print{left,\Llt,\Lmt,\Lrt,\Llm,\Lmm,\Lrm,\Llb,\Lmb,\Lrb}%
   \@print{right,\Rlt,\Rmt,\Rrt,\Rlm,\Rmm,\Rrm,\Rlb,\Rmb,\Rrb}%
   \@print{front,\Flt,\Fmt,\Frt,\Flm,\Fmm,\Frm,\Flb,\Fmb,\Frb}%
   \@print{back,\Blt,\Bmt,\Brt,\Blm,\Bmm,\Brm,\Blb,\Bmb,\Brb}%
}
%    \end{macrocode}
%    \end{macro}
%
%
%
%
%    \subsection{SaveTwoState command}
%    \label{sec:codesavetwostate}
%
%    \begin{macro}{\SaveTwoState}
% We create  a TwoCube version of the existing \cmd{\SaveRubikState} command 
% (\textsc{rubikrotation} package), simply for symmetry and  convenience. 
% This command  is identical to the `Rubik' version, and will require 
% the \textsc{rubikrotation} package to be loaded already (as does the following 
% \cmd{\TwoRotation} command.
%    \begin{macrocode}
\newcommand{\SaveTwoState}{\SaveRubikState}
%    \end{macrocode}
%    \end{macro}
%
%
%
%
%    \subsection{TwoRotation command}
%    \label{sec:codetworotation}
%
% Note that this command writes the data to the same file 
% (\texttt{rubikstate.dat}) as that output  by the  equivalent 3x3x3 
% \cmd{\RubikRotation} command,  since there is no need to change this.
%
%  Note that although the system works perfectly well even if we just continue to use the 
%  3x3x3 \cmd{\RubikRotation} command, it was felt appropriate  to implement  a special 
%  TwoCube version  of this command, since this allows  the Perl script to  be aware 
%  (via the \texttt{cubesize,two} line written to the \texttt{rubikstate.dat} file) 
%  which sort of cube it is dealing with, and hence allows the option for the program to
%  adjust its action accordingly (for example, with regard to the randomisation procedure 
%  which is different for different cubes).
%  
%
%    \begin{macro}{\TwoRotation}
% The \cmd{\TwoRotation}\oarg{integer}\marg{comma separated sequence} 
% command (a)~writes the current TwoCube state to the file \texttt{rubikstate.dat},
% (b)~writes the rotation sequence (either once or multiple times depending 
% on the value of the optional integer argument), and then (c)~CALLs the 
% Perl script \texttt{rubikrotation.pl}.  It~also writes comments to the 
% data file and also to the log file.
%
% The way we allow the user to (optionally) process the main argument multiple
%  times  is simply by writing the associated output command multiple
% times to the output data-file. Consequently, we require the \cmd{\TwoRotation} 
% command to allow a square-bracket optional
% argument (a non-negative integer) to specify the number of such repeats.
%
% \textsc{2x2x2 changes}: (1)~We have  replaced `Rubik' by `Two' in the command-name 
% (2)~we use the command \cmd{\@printTWOstate} (see above) to write the current state data,
% (3)~the \texttt{RTC} in the fileversion and filedate names denotes  `RubikTwoCube'.
%    \begin{macrocode}
\newcommand{\TwoRotation}[2][1]{%
   \typeout{---TeX process}%
   \typeout{---script = TwoRotation cmd (rubiktwocube.sty)%
                         v\RTCfileversion\space (\RTCfiledate)}%
   \typeout{---NEW rotation command}%
   \typeout{---command = TwoRotation[#1]{#2}}%
   \typeout{---writing current TWOcube state to file rubikstate.dat}%
   \@openstatefile% open data file
   \@print{\@comment filename: rubikstate.dat}%
   \@print{\@comment written by TwoRotation cmd (rubiktwocube.sty)%
                              v\RTCfileversion\space (\RTCfiledate)}%
   \@printTWOstate%
   %% countingloop code from Feuersaenger (2015)
   \newcount\ourRRcounter%
   \@countingloop{\ourRRcounter} in 1:{#1}{%
         \immediate\write\outfile{rotation,#2}}%
   \@closestatefile% close data file
   \typeout{---CALLing Perl script (rubikrotation.pl)}%
   \immediate\write18{\rubikperlcmd}%
   \typeout{---inputting NEW datafile (data written by Perl script)}%
   \input{rubikstateNEW.dat}%
   \typeout{-----------------------------------------}%
 }
%    \end{macrocode}
%    \end{macro}
% As usual we require the  \texttt{--shell-escape} command-line option to be used. 
% This is  provided by the \textsf{shellesc} package, and is equivalent 
% to \cmd{\immediate}\cmd{\write18}.
% In the future we may need to replace the \verb!\immediate\write18! with \verb!\ShellEscape!
% ---see the \textsf{shellesc} package documentation.
%
%
%
%
%    \subsection{TwoFaceX macros}
%    \label{sec:codetwoface}
%
% Allocate the four facelet colours to each face
% (only four facelets now).
%    \begin{macrocode}
\newcommand{\TwoFaceUp}[4]{%
   \def\Ult{#1}\def\Urt{#2}\def\Ulb{#3}\def\Urb{#4}}
\newcommand{\TwoFaceFront}[4]{%
   \def\Flt{#1}\def\Frt{#2}\def\Flb{#3}\def\Frb{#4}}
\newcommand{\TwoFaceRight}[4]{%
   \def\Rlt{#1}\def\Rrt{#2}\def\Rlb{#3}\def\Rrb{#4}}
\newcommand{\TwoFaceDown}[4]{%
   \def\Dlt{#1}\def\Drt{#2}\def\Dlb{#3}\def\Drb{#4}}
\newcommand{\TwoFaceLeft}[4]{%
   \def\Llt{#1}\def\Lrt{#2}\def\Llb{#3}\def\Lrb{#4}}
\newcommand{\TwoFaceBack}[4]{%
   \def\Blt{#1}\def\Brt{#2}\def\Blb{#3}\def\Brb{#4}}
\newcommand{\TwoFaceUpAll}[1]{%
   \def\Ult{#1}\def\Urt{#1}\def\Ulb{#1}\def\Urb{#1}}
\newcommand{\TwoFaceFrontAll}[1]{%
   \def\Flt{#1}\def\Frt{#1}\def\Flb{#1}\def\Frb{#1}}
\newcommand{\TwoFaceRightAll}[1]{%
   \def\Rlt{#1}\def\Rrt{#1}\def\Rlb{#1}\def\Rrb{#1}}
\newcommand{\TwoFaceLeftAll}[1]{%
   \def\Llt{#1}\def\Lrt{#1}\def\Llb{#1}\def\Lrb{#1}}
\newcommand{\TwoFaceDownAll}[1]{%
   \def\Dlt{#1}\def\Drt{#1}\def\Dlb{#1}\def\Drb{#1}}
\newcommand{\TwoFaceBackAll}[1]{%
   \def\Blt{#1}\def\Brt{#1}\def\Blb{#1}\def\Brb{#1}}
%    \end{macrocode}
%
%% set the default colour = grey = X
%    \begin{macrocode}
\TwoFaceUpAll{X}%
\TwoFaceDownAll{X}%
\TwoFaceLeftAll{X}%
\TwoFaceRightAll{X}%
\TwoFaceFrontAll{X}%
\TwoFaceBackAll{X}%
%    \end{macrocode}
%
%
%    \begin{macrocode}
\newcommand{\TwoSolvedConfig}[6]{%
  \TwoFaceRightAll{#1}%
  \TwoFaceLeftAll{#2}%
  \TwoFaceUpAll{#3}%
  \TwoFaceDownAll{#4}%
  \TwoFaceFrontAll{#5}%
  \TwoFaceBackAll{#6}%
}
%    \end{macrocode}
%
%
%
%
%    \subsection{Grey cube}
%    \label{sec:greycube}
%
%
%    \begin{macro}{\TwoCubeGrey}
%    \begin{macro}{\TwoCubeGreyAll}
% This command sets up an all-grey Twocube. We accommodate both spellings 
% `grey' and `gray' (as used by TikZ). We include  \cmd{\TwoCubeGreyAll} 
% (exactly the same) to complement the 3x3x3 version just for convenience.
%
% Note that we include the \cmd{\RubikCubeGreyAll} command immediately before
% the \cmd{\TwoSolvedConfig} in order to first initialise all facelets to grey (X),
% (since the \cmd{..Config..} command only sets the corner cubies)
%    \begin{macrocode}
\newcommand{\TwoCubeGrey}{\RubikCubeGreyAll\TwoSolvedConfig{X}{X}{X}{X}{X}{X}}%
\newcommand{\TwoCubeGreyAll}{\TwoCubeGrey}
\newcommand{\TwoCubeGray}{\TwoCubeGrey}
\newcommand{\TwoCubeGrayAll}{\TwoCubeGrey}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
%
% Note that we include the \cmd{\RubikCubeGreyAll} command immediately before
% the \cmd{\TwoSolvedConfig} in order to first initialise all facelets to grey (X),
% (since the \cmd{..Config..} command only sets the corner cubies)
%    \begin{macrocode}
\newcommand{\TwoCubeSolvedWY}{\RubikCubeGreyAll\TwoSolvedConfig{G}{B}{W}{Y}{O}{R}}%
\newcommand{\TwoCubeSolved}{\TwoCubeSolvedWY}%
\newcommand{\TwoCubeSolvedWB}{\RubikCubeGreyAll\TwoSolvedConfig{R}{O}{W}{B}{G}{Y}}%
%    \end{macrocode}
%
%
%
%    \subsection{Slice macros}
%    \label{sec:slice}
%
%
%
% Only top and bottom horizontal slices, 
% as viewed from TopR, TopL,BottomR,BottomL.
%    \begin{macrocode}
\newcommand{\TwoSliceTopR}[4]{%
   \def\Flt{#1}\def\Frt{#2}\def\Rlt{#3}\def\Rrt{#4}}
\newcommand{\TwoSliceTopL}[4]{%
   \def\Llt{#1}\def\Lrt{#2}\def\Flt{#3}\def\Frt{#4}}
\newcommand{\TwoSliceBottomR}[4]{%
   \def\Flb{#1}\def\Frb{#2}\def\Rlb{#3}\def\Rrb{#4}}
\newcommand{\TwoSliceBottomL}[4]{%
   \def\Llb{#1}\def\Lrb{#2}\def\Flb{#3}\def\Frb{#4}}
%%---------------------
\newcommand{\DrawTwoCubeFrontFace}{%
\draw[line join=round,line cap=round,ultra thick,fill=\Flt]%
(0,1) -- (0, 2) -- (1,2) -- (1,1)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Frt]%
(1,1) -- (1, 2) -- (2,2) -- (2,1) -- cycle;
%%
\draw[line join=round,line cap=round,ultra thick,fill=\Flb]%
(0,0) -- (0, 1) -- (1,1) -- (1,0)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Frb]%
(1,0) -- (1, 1) -- (2,1) -- (2,0) -- cycle;
}
%    \end{macrocode}
%
%
%
%
%    \subsection{DrawTwoCube.. macros}
%    \label{sec:drawtwocube}
%
%
%
%    \begin{macrocode}
\newcommand{\DrawTwoCubeRU}{%
%%-----------Front face----------
\DrawTwoCubeFrontFace %% frontface
%%-----------Up face----------
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Ult]%
(0.33,2.33) -- (0.66,2.66) -- (1.66,2.66) -- (1.33,2.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Urt]%
(1.33,2.33) -- (1.66,2.66) -- (2.66,2.66) -- (2.33,2.33)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Ulb]%
(0,2) -- (0.33,2.33) -- (1.33,2.33) -- (1,2)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Urb]%
(1,2) -- (1.33,2.33) -- (2.33,2.33) -- (2,2)  -- cycle;
%%-----------Right face----------
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Rlt]%
(2,1) -- (2, 2) -- (2.33,2.33) -- (2.33,1.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Rrt]%
(2.33,1.33) -- (2.33, 2.33) -- (2.66,2.66) -- (2.66,1.66)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Rlb]%
(2,0) -- (2, 1) -- (2.33,1.33) -- (2.33,0.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Rrb]%
(2.33,0.33) -- (2.33, 1.33) -- (2.66,1.66) -- (2.66,0.66)  -- cycle;
}
%%
\newcommand{\DrawTwoCube}{\DrawTwoCubeRU}
%%
\newcommand{\DrawTwoCubeRD}{%
\DrawTwoCubeFrontFace %% frontface
%%----------Right face--------
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Rlt]%
(2,1) -- (2, 2) -- (2.33,1.66) -- (2.33,0.66)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Rrt]%
(2.33,0.66) -- (2.33, 1.66) -- (2.66,1.33) -- (2.66,0.33)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Rlb]%
(2,0) -- (2, 1) -- (2.33,0.66) -- (2.33,-0.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Rrb]%
(2.33,-0.33) -- (2.33, 0.66) -- (2.66,0.33) -- (2.66,-0.66)  -- cycle;
%%-----------Down face---------
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Dlt]%
(0.33,-0.33) -- (0, 0) -- (1,0) -- (1.33,-0.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Drt]%
(1.33,-0.33) -- (1, 0) -- (2,0) -- (2.33,-0.33)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Dlb]%
(0.66,-0.66) -- (0.33, -0.33) -- (1.33,-0.33) -- (1.66,-0.66)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Drb]%
(1.66,-0.66) -- (1.33, -0.33) -- (2.33,-0.33) -- (2.66,-0.66)  -- cycle;
}
%%
\newcommand{\DrawTwoCubeLD}{%
\DrawTwoCubeFrontFace %% frontface
%%------------Left face--------
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Llt]%
(-0.66,0.33) -- (-0.66, 1.33) -- (-0.33,1.66) -- (-0.33,0.66)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Lrt]%
(-0.33,0.66) -- (-0.33, 1.66) -- (0,2) -- (0,1)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Llb]%
(-0.66,-0.66) -- (-0.66, 0.33) -- (-0.33,0.66) -- (-0.33,-0.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Lrb]%
(-0.33,-0.33) -- (-0.33, 0.66) -- (0,1) -- (0,0)  -- cycle;
%%------------Down face----------
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Dlt]%
(-0.33,-0.33) -- (0, 0) -- (1,0) -- (0.66,-0.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Drt]%
(0.66,-0.33) -- (1, 0) -- (2,0) -- (1.66,-0.33)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Dlb]%
(-0.66,-0.66) -- (-0.33, -0.33) -- (0.66,-0.33) -- (0.33,-0.66)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Drb]%
(0.33,-0.66) -- (0.66, -0.33) -- (1.66,-0.33) -- (1.33,-0.66)  -- cycle;
}
%%
\newcommand{\DrawTwoCubeLU}{%
\DrawTwoCubeFrontFace %% frontface
%%-----------Left face-----------
%%------top row
\draw[line join=round,line cap=round,ultra thick,fill=\Llt]%
(-0.66,1.66) -- (-0.66, 2.66) -- (-0.33,2.33) -- (-0.33,1.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Lrt]%
(-0.33,1.33) -- (-0.33, 2.33) -- (0,2) -- (0,1)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Llb]%
(-0.66,0.66) -- (-0.66, 1.66) -- (-0.33,1.33) -- (-0.33,0.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Lrb]%
(-0.33,0.33) -- (-0.33, 1.33) -- (0,1) -- (0,0)  -- cycle;
%%-----------Up face---------
\draw[line join=round,line cap=round,ultra thick,fill=\Ult]%
(-0.33,2.33) -- (-0.66, 2.66) -- (0.33,2.66) -- (0.66,2.33)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Urt]%
(0.66,2.33) -- (0.33, 2.66) -- (1.33,2.66) -- (1.66,2.33)  -- cycle;
%%---bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Ulb]%
(0,2) -- (-0.33, 2.33) -- (0.66,2.33) -- (1,2)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Urb]%
(1,2) -- (0.66, 2.33) -- (1.66,2.33) -- (2,2)  -- cycle;
}
%    \end{macrocode}
%
%
%    \subsection{DrawTwoFlat.. macros}
%    \label{sec:drawtwoflat}
%
% These `Flat' macros draw a specified face with its origin 
% (left bottom corner of the face) at a specified $(x,y)$ coordinate.
% They allow USERS to place the image of a face at a specific location.
%
%
%    \begin{macrocode}
%%----------------------
\newcommand{\DrawTwoFlatUp}[2]{%
\pgfmathsetmacro{\ux}{#1}%
\pgfmathsetmacro{\uy}{#2}%
%%-----top row
\draw[line join=round,line cap=round,ultra thick,fill=\Ult]%
(\ux + 0,\uy + 1) -- (\ux + 0,\uy + 2) -- (\ux + 1,\uy + 2)%
 -- (\ux + 1,\uy + 1)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Urt]%
(\ux + 1,\uy + 1) -- (\ux + 1,\uy + 2) -- (\ux + 2,\uy + 2)%
 -- (\ux + 2,\uy + 1) -- cycle;
%%----bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Ulb]%
(\ux + 0,\uy + 0) -- (\ux + 0,\uy + 1) -- (\ux + 1,\uy + 1)%
 -- (\ux + 1,\uy + 0)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Urb]%
(\ux + 1,\uy + 0) -- (\ux + 1,\uy + 1) -- (\ux + 2,\uy + 1)%
 -- (\ux + 2,\uy + 0) -- cycle;
}
%%-------------------------
\newcommand{\DrawTwoFlatDown}[2]{%
\pgfmathsetmacro{\ddx}{#1}%
\pgfmathsetmacro{\ddy}{#2}%
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Dlt]%
(\ddx + 0,\ddy + 1) -- (\ddx + 0,\ddy + 2) -- (\ddx + 1,\ddy + 2)%
 -- (\ddx + 1,\ddy + 1)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Drt]%
(\ddx + 1,\ddy + 1) -- (\ddx + 1,\ddy + 2) -- (\ddx + 2,\ddy + 2)%
 -- (\ddx + 2,\ddy + 1) -- cycle;
%%----bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Dlb]%
(\ddx + 0,\ddy + 0) -- (\ddx + 0,\ddy + 1) -- (\ddx + 1,\ddy + 1)%
 -- (\ddx + 1,\ddy + 0)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Drb]%
(\ddx + 1,\ddy + 0) -- (\ddx + 1,\ddy + 1) -- (\ddx + 2,\ddy + 1)%
 -- (\ddx + 2,\ddy + 0) -- cycle;
}
%%-------------------------
\newcommand{\DrawTwoFlatLeft}[2]{%
\pgfmathsetmacro{\lx}{#1}%
\pgfmathsetmacro{\ly}{#2}%
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Llt]%
(\lx + 0, \ly + 1) -- (\lx + 0, \ly +  2) -- (\lx + 1, \ly + 2)%
 -- (\lx + 1, \ly + 1)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Lrt]%
(\lx + 1, \ly + 1) -- (\lx + 1, \ly + 2) -- (\lx + 2, \ly + 2)%
 -- (\lx + 2, \ly + 1) -- cycle;
%%----bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Llb]%
(\lx + 0, \ly + 0) -- (\lx + 0, \ly + 1) -- (\lx + 1, \ly + 1)%
 -- (\lx + 1, \ly + 0)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Lrb]%
(\lx + 1, \ly + 0) -- (\lx + 1, \ly + 1) -- (\lx + 2, \ly + 1)%
 -- (\lx + 2, \ly + 0) -- cycle;
}
%%--------------------------
\newcommand{\DrawTwoFlatRight}[2]{%
\pgfmathsetmacro{\rx}{#1}% 
\pgfmathsetmacro{\ry}{#2}%
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Rlt]%
(\rx + 0, \ry + 1) -- (\rx + 0, \ry + 2) -- (\rx + 1, \ry + 2)%
 -- (\rx + 1, \ry + 1)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Rrt]%
(\rx + 1, \ry + 1) -- (\rx + 1, \ry + 2) -- (\rx + 2, \ry + 2)%
 -- (\rx + 2, \ry + 1) -- cycle;
%%----bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Rlb]%
(\rx + 0, \ry + 0) -- (\rx + 0, \ry + 1) -- (\rx + 1, \ry + 1)%
 -- (\rx + 1, \ry + 0)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Rrb]%
(\rx + 1, \ry + 0) -- (\rx + 1, \ry + 1) -- (\rx + 2, \ry + 1)%
 -- (\rx + 2, \ry + 0) -- cycle;
}
%%--------------
\newcommand{\DrawTwoFlatFront}{%
%% This command is used /only/ by  the \cmd{\DrawRubikFlat} command.
%% NOTE: x, y variables not implemented as not required here
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Flt]%
(0,1) -- (0, 2) -- (1,2) -- (1,1)  -- cycle;
%%
\draw[line join=round,line cap=round,ultra thick,fill=\Frt]%
(1,1) -- (1, 2) -- (2,2) -- (2,1) -- cycle;
%%----bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Flb]%
(0,0) -- (0, 1) -- (1,1) -- (1,0)  -- cycle;
%%
\draw[line join=round,line cap=round,ultra thick,fill=\Frb]%
(1,0) -- (1, 1) -- (2,1) -- (2,0) -- cycle;
}
%%--------------------------
\newcommand{\DrawTwoFlatBack}[2]{%
\pgfmathsetmacro{\bx}{#1}%
\pgfmathsetmacro{\by}{#2}%
%%---top row
\draw[line join=round,line cap=round,ultra thick,fill=\Blt]%
(\bx + 0,\by + 1) -- (\bx + 0,\by + 2) -- (\bx + 1,\by + 2)%
 -- (\bx + 1,\by + 1)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Brt]%
(\bx + 1,\by + 1) -- (\bx + 1,\by + 2) -- (\bx + 2,\by + 2)%
 -- (\bx + 2,\by + 1) -- cycle;
%%----bottom row
\draw[line join=round,line cap=round,ultra thick,fill=\Blb]%
(\bx + 0,\by + 0) -- (\bx + 0,\by + 1) -- (\bx + 1,\by + 1)%
 -- (\bx + 1,\by + 0)  -- cycle;
\draw[line join=round,line cap=round,ultra thick,fill=\Brb]%
(\bx + 1,\by + 0) -- (\bx + 1,\by + 1) -- (\bx + 2,\by + 1)%
 -- (\bx + 2,\by + 0) -- cycle;
}
%%------------------------------
\newcommand{\DrawTwoCubeF}{%
  \DrawTwoFlatUp{0}{2}%
  \DrawTwoFlatDown{0}{-2}%
  \DrawTwoFlatLeft{-2}{0}%
  \DrawTwoFlatFront%
  \DrawTwoFlatRight{2}{0}%
  \DrawTwoFlatBack{4}{0}%
}
%%
\newcommand{\DrawTwoCubeSF}{%
  \DrawTwoCubeRU% RU
  \DrawTwoFlatDown{0}{-2}%
  \DrawTwoFlatLeft{-2}{0}%
  \DrawTwoFlatBack{2.666}{0.66}% 
}
%    \end{macrocode}
%
%
%
%
%
%
% \subsection{Sidebars (Face)}
%  \label{sec:sidebarsfacecode}
%
%
% Making sidebar macros for a TwoCube (converting the 3x3x3x versions
% to the 2x2x2 versions).
% {\newline} (1) change name $\rightarrow$ \verb!TWOside@barX!
% {\newline} (2) change the value   \verb!(3 + \bs)!  $\rightarrow$  \verb!(2 + \tbs)! 
% (as only two squares on a side).
% {\newline} (3) change the Sidebar length parameter names by adding a \cmd{\t} prefix
% to distinguish the TwoCube parameters from those of the RubikCube. Thus we change
% the Rubik names (\cmd{\dx}, \cmd{\dy}, \cmd{\bw}, \cmd{\bl}, \cmd{\blh}, \cmd{\bs})
% to their equivalent Two names (\cmd{\tdx}, \cmd{\tdy}, \cmd{\tbw}, \cmd{\tbl}, 
% \cmd{\tblh}, \cmd{\tbs}).
%
% The coordinates of the bottom left corner of a TwoSidebar are (\cmd{\tdx}, \cmd{\tdy}). 
% The other parameters are width (\cmd{\tbw}), length (\cmd{\tbl}), 
% half length (\cmd{\tblh}), separation (\cmd{\tbs}).
%
%    \begin{macro}{\TwoSidebarWidth}
%    \begin{macro}{\TwoSidebarLength}
%    \begin{macro}{\TwoSidebarSep}
% These commands set the width, length and separation of the Sidebars. 
% Each takes a single scalar argument (no units).
% \newline\textsc{usage}: \cmd{\TwoSidebarWidth}\marg{0.5} 
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macrocode}
\newcommand{\TwoSidebarWidth}[1]{\pgfmathsetmacro{\tbw}{#1}}
\newcommand{\TwoSidebarLength}[1]{\pgfmathsetmacro{\tbl}{#1}}
\newcommand{\TwoSidebarSep}[1]{\pgfmathsetmacro{\tbs}{#1}}
%    \end{macrocode}
%  We  first set some default values. We have set the Sidebar
%  width and separation  to 2/3  those of the Rubik 3x3x3 values 
% (so that when a 3x3x3 cube and a 2x2x2 cube 
%  are scaled to be the same size, then the Sidebar width and sep will be the same)
%  These also seem to look good generally as well.
%  Of course, users can adjust these as they wish anyway. Any new values will
%  will of course act globally unless constrained (either by using curley brackets, or
%  by writing them into a \TeX\ environment).
%    \begin{macrocode}
\TwoSidebarWidth{0.2}
\TwoSidebarLength{1.0}
\TwoSidebarSep{0.2}
%    \end{macrocode}
%
%
%    \begin{macro}{\NoSidebar}
% This command \cmd{\NoSidebar}\marg{colour code}  (defined in the \textsc{rubikcube} package) 
% defines the colour for which sidebars should  \textit{not} be drawn 
% (particularly useful when drawing OLL configurations).  
% This idea was suggested by Robert Ma\v{r}\'{\i}k (May 2017).
% {\newline}The principle is that we let the command \cmd{\NoSidebar} define a face colour, 
% and then  we use the \verb!\ifthenelse{\equal{#2}{\no@sidebar}}{}{...}! structure to either 
% (a)~draw all sidebars as usual (if \cmd{\NoSidebar} is undefined), 
% or (b)~draw all sidebars \textit{except} those having the \cmd{\NoSidebar} colour 
% (if \cmd{\NoSidebar} colour = \verb!#2!). 
% \newline\textsc{usage}: \verb!\NoSidebar{X}! \  If this command in \textit{not} inside 
% an environment, then its action will continue until it is cancelled (undefined) 
% as follows: \verb!\NoSidebar{}!.
%    \end{macro}
%
% \medskip
% 
%    \begin{macro}{\TWOside@barL}
%    \begin{macro}{\TWOside@barR}
%    \begin{macro}{\TWOside@barT}
%    \begin{macro}{\TWOside@barB}

% These commands \cmd{\TWOside@barX}\marg{position no}\marg{facelet location} (where 
% X  is one of L~(Left), R~(Right), T~(Top), B~(Bottom), which denote the side of the 
% 2x2 square representing  a face), draw a  single small bar in a position (1, or 2), 
% having the colour of a specified facelet. The integers 1, 2 denote the facelet number
% (measured from the grid origin = bottom left corner of the face)  
% adjacent to which the bar is positioned.
%
% These macros are used in the various `Sidebar' commands which draw pairs of 
% these small bars  adjacent to specified faces.
% \newline\textsc{changes}:  Rubik $\rightarrow$ Two, \cmd{\bw}  $\rightarrow$ \cmd{\tbw},  
% \cmd{\bl} $\rightarrow$ \cmd{\tbl},  \cmd{\bs} $\rightarrow$ \cmd{\tbs},  
% \cmd{\dx} $\rightarrow$ \cmd{\tdx},  \cmd{\dy} $\rightarrow$ \cmd{\tdy} 
% (see  Section~\ref{sec:sidebarscode} for details of these variables).
% \newline\textsc{usage}: \verb!\TWOside@barL{2}{\Lrt}!
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%    \begin{macrocode}
\newcommand{\TWOside@barL}[2]{%
  %% #1 = cubie possn no, #2 = colour
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{0 - \tbs - \tbw}%
  \pgfmathsetmacro{\tdy}{#1-1+0.5-\tblh}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbl)
  -- (\tdx+\tbw,\tdy+\tbl) -- (\tdx+\tbw,\tdy) -- cycle;
}}
%% changed  Rubik value  (3 + \bs)  --> (2 + \tbs) (as only TWO squares)
\newcommand{\TWOside@barR}[2]{%
  %% #1 = cubie possn no, #2 = colour
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{2 + \tbs}%
  \pgfmathsetmacro{\tdy}{#1 -1+0.5-\tblh}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbl)
  -- (\tdx+\tbw,\tdy+\tbl) -- (\tdx+\tbw,\tdy) -- cycle;
}}
%%  changed Rubik value  (3 + \bs)  --> (2 + \tbs) (as only TWO squares)
\newcommand{\TWOside@barT}[2]{%
  %% #1 = cubie possn no, #2 = colour
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{#1 -1+0.5-\tblh}%
  \pgfmathsetmacro{\tdy}{2 +\tbs}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbw)
  -- (\tdx+\tbl,\tdy+\tbw) -- (\tdx+\tbl,\tdy) -- cycle;
}}
\newcommand{\TWOside@barB}[2]{%
  %% #1 = cubie possn no, #2 = colour
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{#1 -1+0.5-\tblh}%
  \pgfmathsetmacro{\tdy}{0 -\tbs-\tbw}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbw)
  -- (\tdx+\tbl,\tdy+\tbw) -- (\tdx+\tbl,\tdy) -- cycle;
}}
%    \end{macrocode}
%


%
% \subsubsection{DrawTwoFaceXSide macros}
%  \label{sec:drawtwofacexside}
%
% Only 2 bars on each side for a TwoCube.
% Change from 3x3x3: we remove the middle cols \& row sections
% change name  DrawRubikLayerSide --> DrawTwoLayerSide 
%
% RWDN 16 Feb 2018  
% v5: removed many (duplicated and unnecessary) macros, and replaced them
% with these TwoFace.. macros using just the basic \cmd{\TWOside@bar..} macros
% for drawing small single bars.
%
% These new macros draw a specified face (using the ..Flat.. commands) 
% as well as all the associated sidebars. 
% Note we continue to use the key-word `Side' here to indicate we are 
% drawing all the sidebars, since we are drawing a face.
% (only for 3D cubes do we use the word `SidebarXX' for denoting a particular
% Sidebar to be drawn etc.)
%
%    \begin{macrocode}
\newcommand{\DrawTwoFaceUpSide}{%
 \DrawTwoFlatUp{0}{0}%
 \TWOside@barT{1}{\Brt}%
 \TWOside@barT{2}{\Blt}%
 \TWOside@barL{2}{\Llt}%
 \TWOside@barL{1}{\Lrt}%
 \TWOside@barR{2}{\Rrt}%
 \TWOside@barR{1}{\Rlt}%
 \TWOside@barB{1}{\Flt}%
 \TWOside@barB{2}{\Frt}%
}
\newcommand{\DrawTwoFaceFrontSide}{%
 \DrawTwoFlatFront{0}{0}%
 \TWOside@barT{1}{\Ulb}%
 \TWOside@barT{2}{\Urb}%
 \TWOside@barL{2}{\Lrt}%
 \TWOside@barL{1}{\Lrb}%
 \TWOside@barR{2}{\Rlt}%
 \TWOside@barR{1}{\Rlb}%
 \TWOside@barB{1}{\Dlt}%
 \TWOside@barB{2}{\Drt}%
}
\newcommand{\DrawTwoFaceRightSide}{%
 \DrawTwoFlatRight{0}{0}%
 \TWOside@barT{1}{\Urb}%
 \TWOside@barT{2}{\Urt}%
 \TWOside@barL{2}{\Frt}%
 \TWOside@barL{1}{\Frb}%
 \TWOside@barR{2}{\Blt}%
 \TWOside@barR{1}{\Blb}%
 \TWOside@barB{1}{\Drt}%
 \TWOside@barB{2}{\Drb}%
}
\newcommand{\DrawTwoFaceLeftSide}{%
 \DrawTwoFlatLeft{0}{0}%
 \TWOside@barT{1}{\Ult}%
 \TWOside@barT{2}{\Ulb}%
 \TWOside@barL{2}{\Brt}%
 \TWOside@barL{1}{\Brb}%
 \TWOside@barR{2}{\Flt}%
 \TWOside@barR{1}{\Flb}%
 \TWOside@barB{1}{\Dlb}%
 \TWOside@barB{2}{\Dlt}%
}
\newcommand{\DrawTwoFaceBackSide}{%
 \DrawTwoFlatBack{0}{0}%
 \TWOside@barT{1}{\Urt}%
 \TWOside@barT{2}{\Ult}%
 \TWOside@barL{2}{\Rrt}%
 \TWOside@barL{1}{\Rrb}%
 \TWOside@barR{2}{\Llt}%
 \TWOside@barR{1}{\Llb}%
 \TWOside@barB{1}{\Drb}%
 \TWOside@barB{2}{\Dlb}%
}
\newcommand{\DrawTwoFaceDownSide}{%
 \DrawTwoFlatDown{0}{0}%
 \TWOside@barT{1}{\Flb}%
 \TWOside@barT{2}{\Frb}%
 \TWOside@barL{2}{\Lrb}%
 \TWOside@barL{1}{\Llb}%
 \TWOside@barR{2}{\Rlb}%
 \TWOside@barR{1}{\Rrb}%
 \TWOside@barB{1}{\Brb}%
 \TWOside@barB{2}{\Blb}%
}
%%
%% v5: made Face versions (for USER) without the (x,y) coordinates
\newcommand{\DrawTwoFaceUp}{\DrawTwoFlatUp{0}{0}}
\newcommand{\DrawTwoFaceDown}{\DrawTwoFlatDown{0}{0}}
\newcommand{\DrawTwoFaceLeft}{\DrawTwoFlatLeft{0}{0}}
\newcommand{\DrawTwoFaceRight}{\DrawTwoFlatRight{0}{0}}
\newcommand{\DrawTwoFaceFront}{\DrawTwoFlatFront{0}{0}}
\newcommand{\DrawTwoFaceBack}{\DrawTwoFlatBack{0}{0}}
%%
%% v5: made short forms --> abbreviations
\newcommand{\DrawTwoFaceU}{\DrawTwoFlatUp{0}{0}}
\newcommand{\DrawTwoFaceD}{\DrawTwoFlatDown{0}{0}}
\newcommand{\DrawTwoFaceL}{\DrawTwoFlatLeft{0}{0}}
\newcommand{\DrawTwoFaceR}{\DrawTwoFlatRight{0}{0}}
\newcommand{\DrawTwoFaceF}{\DrawTwoFlatFront{0}{0}}
\newcommand{\DrawTwoFaceB}{\DrawTwoFlatBack{0}{0}}
%%
%% v5: made short forms --> abbreviations
\newcommand{\DrawTwoFaceUS}{\DrawTwoFaceUpSide}
\newcommand{\DrawTwoFaceDS}{\DrawTwoFaceDownSide}
\newcommand{\DrawTwoFaceLS}{\DrawTwoFaceLeftSide}
\newcommand{\DrawTwoFaceRS}{\DrawTwoFaceRightSide}
\newcommand{\DrawTwoFaceFS}{\DrawTwoFaceFrontSide}
\newcommand{\DrawTwoFaceBS}{\DrawTwoFaceBackSide}
%    \end{macrocode}
%
%
%
%
%
% \subsection{Sidebars (Cube)}
%  \label{sec:sidebarscubecode}
%
%
% In order to position sidebars adjacent to a TwoCube (ie in 3D) 
% requires that we first make  some  new  \cmd{\TWOside@bar..}
% commands which draw sidebars adjacent to the \textsc{back} face 
% (we have already made the macros for the front 
% face sidebars---see Section~\ref{sec:sidebarsfacecode}).
% Furthermore, these new macros need to be tailored  to each of the 
% four standard cube  viewing directions RU, LU, RD, LD.
%
% Finally, the USER commands for drawing these sidebars need 
% to accommodate (a)~some code for identifying each set of sidebars, 
% and (b)~the viewing direction. So, for example,  a USER command for 
% drawing  the sidebars associated with the cube edge formed 
% by the \textsc{right} face and the \textsc{back} face 
% (lets define this as the RB sidebar) as viewed from the RU direction, 
% might be something like \cmd{\DrawTwoCubeSidebarRBRU}. 
% Since this is not particularly user-friendly, 
% we can improve on this slightly for the USER by 
% (a)~defining the sidebar as \texttt{SidebarRB}, and 
% (b)~appending the view direction in a curly bracket, say as \verb!{RU}!. 
% This allows a more intuitive command structure for the USER, 
%  as follows: \verb!\DrawTwoCubeSidebarRB{RU}!.
% We then use the \cmd{\@join} command to append the string \verb!RU! to the string 
% \verb!DrawTwoCubeSidebarRB! forming the (internal) 
% command \cmd{\DrawTwoCubeSidebarRBRU}.
%
% In the following we will group the development according to to the view direction.
%
%
%
%  \subsubsection{Sidebars: RU view}
%
%  \subsubsection*{Right-Back vert sidebar (RU view)}
%
% Need to write a new  \cmd{\TWOside@barR..} command 
% (see Section~\ref{sec:sidebarsfacecode}).
% This draws only a single small bar. 
% Each of the two small bars has a numbered position (1,2);
% (dx,dy) = bottom Left corner of single  bar
%
%    \begin{macrocode}
\newcommand{\TWOside@barRbackRU}[2]{%
  %% #1 = cubie possn no, #2 = colour
  %% tdx --> tdx + (2/3)
  %% tdy --> tdy + (2/3)
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{2 + \tbs        +0.666}% 
  \pgfmathsetmacro{\tdy}{#1 -1+0.5-\tblh +0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbl)
  -- (\tdx+\tbw,\tdy+\tbl) -- (\tdx+\tbw,\tdy) -- cycle;%
}}
%    \end{macrocode}
% Now make the RB (RightBack)  vertical sidebar command;
% ie bar~1 is at the bottom; bar~2 is at the top.
%
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarRBRU}{%
 \TWOside@barRbackRU{2}{\Blt}%
 \TWOside@barRbackRU{1}{\Blb}%
}
%    \end{macrocode}
% Now make the reverse command (BR) = RB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBRRU}{\DrawTwoCubeSidebarRBRU}
%    \end{macrocode}
% Finally, make the join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarRB}[1]{\@join{\DrawTwoCubeSidebarRB}{#1}}
\newcommand{\DrawTwoCubeSidebarBR}[1]{\@join{\DrawTwoCubeSidebarBR}{#1}}
%    \end{macrocode}
%
%
%
%  \medskip
%
%  \subsubsection*{Up-Back horiz sidebar (RU view)}
%
%
%    \begin{macrocode}
\newcommand{\TWOside@barTbackRU}[2]{%
  %% #1 = cubie possn no; #2 = colour
  %% tdx --> tdx + (2/3)
  %% tdy --> tdy + (2/3)
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{#1 -1+0.5-\tblh +0.666}%
  \pgfmathsetmacro{\tdy}{2 +\tbs         +0.666}% 
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbw)
  -- (\tdx+\tbl,\tdy+\tbw) -- (\tdx+\tbl,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the UB (Up-Back) horizontal sidebar command;
% ie bar~1 is on the left, bar~2 is on the right (as we look at the cube).
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarUBRU}{%
 \TWOside@barTbackRU{1}{\Brt}%
 \TWOside@barTbackRU{2}{\Blt}%
}
%    \end{macrocode}
% Now make the reverse command (BU) = UB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBURU}{\DrawTwoCubeSidebarUBRU}
%    \end{macrocode}
% Now make the join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarUB}[1]{\@join{\DrawTwoCubeSidebarUB}{#1}}
\newcommand{\DrawTwoCubeSidebarBU}[1]{\@join{\DrawTwoCubeSidebarBU}{#1}}
%    \end{macrocode}
%
%
%
% \medskip
%
%  \subsubsection*{Front-Left vert sidebar (RU view)}
%
% Since this is a front-face sidebar we can use the regular 
% \cmd{TWOside@barL..} command.
% Now make the FL (Front-Left) vertical sidebar command;
% ie bar~1 is at the bottom; bar~2 is at the top.
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFLRU}{%
 \TWOside@barL{2}{\Lrt}%
 \TWOside@barL{1}{\Lrb}%
}
%    \end{macrocode}
% Now do the reverse (LF)
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarLFRU}{\DrawTwoCubeSidebarFLRU}
%    \end{macrocode}
% Now do the two join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFL}[1]{\@join{\DrawTwoCubeSidebarFL}{#1}}
\newcommand{\DrawTwoCubeSidebarLF}[1]{\@join{\DrawTwoCubeSidebarLF}{#1}}
%    \end{macrocode}
%
%
%
%  \medskip
%
%  \subsubsection*{Front-Down horiz sidebar (RU view)}
%
% Since this is a front face sidebar we can use the regular 
% \cmd{TWOside@barL..} command.
%
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFDRU}{%
 \TWOside@barB{1}{\Dlt}%
 \TWOside@barB{2}{\Drt}%
}
%    \end{macrocode}
% Now do the reverse (DF) = FD
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarDFRU}{\DrawTwoCubeSidebarFDRU}
%    \end{macrocode}
% Now do the two join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFD}[1]{\@join{\DrawTwoCubeSidebarFD}{#1}}
\newcommand{\DrawTwoCubeSidebarDF}[1]{\@join{\DrawTwoCubeSidebarDF}{#1}}
%    \end{macrocode}
% But FD-LU  is the same as FD-RU, so we need to make copies of each.
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarDFLU}{\DrawTwoCubeSidebarDFRU}
\newcommand{\DrawTwoCubeSidebarFDLU}{\DrawTwoCubeSidebarFDRU}
%    \end{macrocode}
%
%
%
%  \medskip
%
%  \subsubsection{Sidebars: LU view}
%
%
%  \subsubsection*{Left-Back vert sidebar (LU view)}
%
%    \begin{macrocode}
\newcommand{\TWOside@barLbackLU}[2]{%
  %% #1 = cubie possn no, #2 = colour
  %% tdx --> tdx - 2/3
  %% tdy --> tdy + 2/3
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{0 - \tbs -\tbw   -0.666}%
  \pgfmathsetmacro{\tdy}{#1 -1+0.5-\tblh +0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbl)
  -- (\tdx+\tbw,\tdy+\tbl) -- (\tdx+\tbw,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the LB (LeftBack) vertical sidebar command;
% bar~1 is at the bottom
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarLBLU}{%
 \TWOside@barLbackLU{2}{\Brt}%
 \TWOside@barLbackLU{1}{\Brb}%
}
%    \end{macrocode}
% Now do the reverse (BL) = LB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBLLU}{\DrawTwoCubeSidebarLBLU}
%    \end{macrocode}
% Now make the join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarLB}[1]{\@join{\DrawTwoCubeSidebarLB}{#1}}
\newcommand{\DrawTwoCubeSidebarBL}[1]{\@join{\DrawTwoCubeSidebarBL}{#1}}
%    \end{macrocode}
%
%
% \medskip
%
%  \subsubsection*{Up-Back horizontal sidebar (LU view)}
%
%    \begin{macrocode}
\newcommand{\TWOside@barTbackLU}[2]{%
  %% #1 = cubie possn no; #2 = colour
  %% tdx --> tdx-2/3
  %% tdy --> tdy+2/3
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{#1 -1+0.5-\tblh  -0.666}%
  \pgfmathsetmacro{\tdy}{2 +\tbs          +0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbw)
  -- (\tdx+\tbl,\tdy+\tbw) -- (\tdx+\tbl,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the UB (Up-Back) version
% bar~1 is at the left, 2 on the right.
%
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarUBLU}{%
 \TWOside@barTbackLU{1}{\Brt}%
 \TWOside@barTbackLU{2}{\Blt}%
}
%    \end{macrocode}
% Now do the reverse (BU) = UB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBULU}{\DrawTwoCubeSidebarUBLU}
%    \end{macrocode}
% We do NOT need to make the join commands here
% as the USER commands for BU and UB are the same as for the RU
%
%
%
% \medskip
%
%  \subsubsection*{Front-Right vertical sidebar (LU view)}
%
%
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFRLU}{%
 \TWOside@barR{2}{\Rlt}%
 \TWOside@barR{1}{\Rlb}%
}
%    \end{macrocode}
% Now do the reverse (RF)
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarRFLU}{\DrawTwoCubeSidebarFRLU}
%    \end{macrocode}
% Now do the two join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFR}[1]{\@join{\DrawTwoCubeSidebarFR}{#1}}
\newcommand{\DrawTwoCubeSidebarRF}[1]{\@join{\DrawTwoCubeSidebarRF}{#1}}
%    \end{macrocode}
%
%
%  \subsubsection{Sidebars: RD view}
%
% \medskip
%
%  \subsubsection*{Front-Up horizontal sidebar (RD view)}
%
%
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFURD}{%
 \TWOside@barT{1}{\Ulb}%
 \TWOside@barT{2}{\Urb}%
}
%    \end{macrocode}
% Now do the reverse (UF) = FU
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarUFRD}{\DrawTwoCubeSidebarFURD}
%    \end{macrocode}
% Now do the two join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFU}[1]{\@join{\DrawTwoCubeSidebarFU}{#1}}
\newcommand{\DrawTwoCubeSidebarUF}[1]{\@join{\DrawTwoCubeSidebarUF}{#1}}
%    \end{macrocode}
%
%
% \medskip
%
%  \subsubsection*{Front-Left vertical sidebar (RD view)}
%
%
% Only need to copy an earlier command here since  FL, RD view = same as for RU view.
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFLRD}{\DrawTwoCubeSidebarFLRU}
\newcommand{\DrawTwoCubeSidebarLFRD}{\DrawTwoCubeSidebarLFRU}
%    \end{macrocode}
%
%
%
%
% \medskip
%
%  \subsubsection*{Right-Back vertical sidebar (RD view)}
%
%
%    \begin{macrocode}
\newcommand{\TWOside@barRbackRD}[2]{%
  %% #1 = cubie possn no, #2 = colour
  %% tdx --> tdx + (2/3)
  %% tdy --> tdy - (2/3)
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{2 + \tbs        +0.666}%
  \pgfmathsetmacro{\tdy}{#1 -1+0.5-\tblh -0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbl)
  -- (\tdx+\tbw,\tdy+\tbl) -- (\tdx+\tbw,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the RB (RightBack) version
% bar~1 is at the bottom
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarRBRD}{%
\TWOside@barRbackRD{2}{\Blt}%
\TWOside@barRbackRD{1}{\Blb}%
}
%    \end{macrocode}
% now do the reverse (BR) = RB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBRRD}{\DrawTwoCubeSidebarRBRD}
%    \end{macrocode}
% Do NOT need to make the join commands (as same as for the RU view)
%
%
%
%
% \medskip
%
%  \subsubsection*{Down-Back horizotal sidebar (RD view)}
%
%
%    \begin{macrocode}
\newcommand{\TWOside@barBbackRD}[2]{%
  %% #1 = cubie possn no; #2 = colour
  %% tdx --> tdx+2/3
  %% tdy --> tdy-2/3
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{#1 -1+0.5-\tblh +0.666}%
  \pgfmathsetmacro{\tdy}{0 -\tbs - \tbw   -0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbw)
  -- (\tdx+\tbl,\tdy+\tbw) -- (\tdx+\tbl,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the DB (Down-Back) version
% bar~1 is at the left, 2 on the right (as we look at the cube)
% 
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarDBRD}{%
 \TWOside@barBbackRD{1}{\Brb}%
 \TWOside@barBbackRD{2}{\Blb}%
}
%    \end{macrocode}
% Now do the reverse (BD) = DB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBDRD}{\DrawTwoCubeSidebarDBRD}
%    \end{macrocode}
%% Now make the join commands
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarDB}[1]{\@join{\DrawTwoCubeSidebarDB}{#1}}
\newcommand{\DrawTwoCubeSidebarBD}[1]{\@join{\DrawTwoCubeSidebarBD}{#1}}
%    \end{macrocode}
%
%
%  \subsubsection{Sidebars:  LD  view}
%
%
% \medskip
%
%  \subsubsection*{Front-Up horizotal sidebar (LD view)}
%
% But FU (LD view) is the same as for (RU view), (see above)
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFULD}{\DrawTwoCubeSidebarFURD}
\newcommand{\DrawTwoCubeSidebarUFLD}{\DrawTwoCubeSidebarUFRD}
%    \end{macrocode}
%
% \medskip
%
%  \subsubsection*{Front-Right vertical sidebar (LD view)}
%
% But FR  (LDview) is the  same as for (LU view),  (see above)
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarFRLD}{\DrawTwoCubeSidebarFRLU}
\newcommand{\DrawTwoCubeSidebarRFLD}{\DrawTwoCubeSidebarRFLU}
%    \end{macrocode}
%
%
%
% \medskip
%
%  \subsubsection*{Left-Back vertical sidebar (LD view)}
%
%    \begin{macrocode}
\newcommand{\TWOside@barLbackLD}[2]{%
  %% #1 = cubie possn no, #2 = colour
  %% tdx --> tdx-2/3
  %% tdy --> tdy-2/3
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{0 - \tbs -\tbw   -0.666}%
  \pgfmathsetmacro{\tdy}{#1 -1+0.5-\tblh -0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbl)
  -- (\tdx+\tbw,\tdy+\tbl) -- (\tdx+\tbw,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the LB (LeftBack) version  
% bar~1 is at the bottom
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarLBLD}{%
 \TWOside@barLbackLD{2}{\Brt}%
 \TWOside@barLbackLD{1}{\Brb}%
}
%    \end{macrocode}
% Now do the reverse (BL) = LB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBLLD}{\DrawTwoCubeSidebarLBLD}
%    \end{macrocode}
% Do NOT need to make the join commands (same as for the LU view)
%
%
%
% \medskip
%
%  \subsubsection*{Down-Back horizontal sidebar (LD view)}
%
%
%
%    \begin{macrocode}
\newcommand{\TWOside@barBbackLD}[2]{%
  %% #1 = cubie possn no; #2 = colour
  %% tdx --> tdx-2/3
  %% tdy --> tdy-2/3
  \ifthenelse{\equal{#2}{\no@sidebar}}{}{%
  \pgfmathsetmacro{\tblh}{\tbl*(0.5)}%
  \pgfmathsetmacro{\tdx}{#1 -1+0.5-\tblh -0.666}%
  \pgfmathsetmacro{\tdy}{0 -\tbs - \tbw   -0.666}%
  \draw[fill=#2] (\tdx,\tdy) -- (\tdx,\tdy + \tbw)
  -- (\tdx+\tbl,\tdy+\tbw) -- (\tdx+\tbl,\tdy) -- cycle;
}}
%    \end{macrocode}
% Now make the DB (Down-Back) version
% bar~1 is at the left, 2 on the right (as we look at the cube)
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarDBLD}{%
\TWOside@barBbackLD{1}{\Brb}%
\TWOside@barBbackLD{2}{\Blb}%
}
%    \end{macrocode}
% Now do the reverse (BD) = DB
%    \begin{macrocode}
\newcommand{\DrawTwoCubeSidebarBDLD}{\DrawTwoCubeSidebarDBLD}
%    \end{macrocode}
% Do NOT need to make any join commands (same as for the RD view)
%
%
%
%
%  \subsection{\hspace{3mm}Hieroglyphs}
%   \label{sec:codehieroglyphs}
%
% Not many changes to make (from rubikcube sty). In general we try to 
% keep things fairly intuitive by changing  Rubik $\rightarrow$ Two, 
% and  changing r $\rightarrow$ t.
% Note that  since this package uses a lot of commands  defined in the 
% \texttt{rubikcube} package, eg the  `join' utility and the rubikfont, 
% consequently  rubikcube sty needs to be loaded when running this package.
%
% We only need to make significant changes to the 
% following hieroglyphs: L,R,U,D,Lp,Rp,Up,Dp.
%
% Unchanged are: axis rotations (eg Rc) and letter rotations (eg B),
% so these  hieroglyphs just need newdefs making for them;  
% eg trF $\leftarrow$ rrF, etc
%
% We need to rename some of the `square' furniture associated with the L,R,U,D etc face 
% rotation hieroglyphs: for example, the D heiroglyph requires the following: 
%{\newline} change rr         $\rightarrow$ tr
%{\newline} change SquareD    $\rightarrow$ SquaretD
%{\newline} change RubikD     $\rightarrow$ TwoD
%{\newline} change textRubikD $\rightarrow$ textTwoD
%
% For a TWOcube we only need to make two lines in a square;
% ie we want to  shift the top line down/sideways 
% and  shift the  bottom line up/sideways by
% an amount which makes the final position = 1/3 of the square.
% Since  the  top and bottom lines (and also the  left and right lines)
% are at 0.25 unit,
% then the extra distance = 0.25/3 = 0.0833;
% so for horiz lines we add/subtract @ty, and 
% for vertical lines we add/subtract @tx.
%
%  \begin{macro}{\@tx}
%  \begin{macro}{\@ty}
%\begin{macrocode}
\pgfmathsetmacro{\@tx}{0.0833} 
\pgfmathsetmacro{\@ty}{0.0833} 
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
% We continue to use the rubikfont.
%
%  \begin{macro}{\@tr}
%  \begin{macro}{\@trp}
% \begin{macrocode}
\newcommand{\@tr}[1]{{\@rubikfont #1}}
\newcommand{\@trp}[1]{{\@rubikfont #1\@rubikprime}}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%
% We need to rename the basic `join' commands: ie change  Rubik $\rightarrow$ Two, and 
% change r $\rightarrow$ t, as follows: 
%
%  \begin{macro}{\tr}
%  \begin{macro}{\trh}
%  \begin{macro}{\Two}
%  \begin{macro}{\textTwo}
% \begin{macrocode}
\newcommand*{\tr}[1]{\@join{\tr}{#1}}
\newcommand*{\trh}[1]{\@join{\trh}{#1}}
\newcommand*{\Two}[1]{\@join{\Two}{#1}}
\newcommand*{\textTwo}[1]{\@join{\textTwo}{#1}}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%
%  \subsubsection{\hspace{3mm}Rotation B}
%   \label{sec:coderotationB}
%
%  \begin{macro}{\trB}
%  \begin{macro}{\trhB}
%  \begin{macro}{\TwoB}
%  \begin{macro}{\textTwoB}
% \begin{macrocode}
\newcommand{\trB}{\rrB}
\newcommand{\trBp}{\rrBp}
\newcommand{\trhB}{\rrhB}
\newcommand{\trhBp}{\rrhBp}
\newcommand{\TwoB}{\RubikB}
\newcommand{\TwoBp}{\RubikBp}
\newcommand{\textTwoB}{\textRubikB}
\newcommand{\textTwoBp}{\textRubikBp}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%
%  \subsubsection{\hspace{3mm}Rotation D}
%   \label{sec:coderotationD}
%
% We need to rename some of the items as follows:
%{\newline} change rr         $\rightarrow$ tr
%{\newline} change SquareD    $\rightarrow$ SquaretD
%{\newline} change RubikD     $\rightarrow$ TwoD
%{\newline} change textRubikD $\rightarrow$ textTwoD
%
%  \begin{macro}{\trD}
%  \begin{macro}{\SquaretD}
%  \begin{macro}{\trhD}
%  \begin{macro}{\TwoD}
%  \begin{macro}{\textTwoD}
%  These commands  all draw forms which denote the D rotation.
%
%  Feb 2017 (RWDN): \ added the  \cmd{\@tlen} length to the \cmd{\trhD} command to improve the 
%  spacing between two `arrow' square hieroglyphs; and also removed the terminal \cmd{\,}
%  space. The same changes were made to all the `arrow' hieroglyphs.
% \begin{macrocode}
%% 
\newcommand{\trD}{\@tr{D}}
%%
\newcommand{\SquaretD}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick] (\@sb,\@sddd - \@ty) -- (\@sbh, \@sddd - \@ty);
\draw [thick, ->]     (\@sb,\@sd + \@ty) --   (\@sbh, \@sd + \@ty);
\end{tikzpicture}%
}
\newcommand{\trhD}{\raisebox{-0.333\height}{\@tlen\SquaretD\@tlen}}
%%
\newcommand{\TwoD}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretD\\
\trD%
\end{minipage}%
}}
\newcommand{\textTwoD}{\trD\,\trhD}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%  \subsubsection{\hspace{3mm}Rotation Dp}
%
%  \begin{macro}{\trDp}
%  \begin{macro}{\SquaretDp}
%  \begin{macro}{\trhDp}
%  \begin{macro}{\TwoDp}
%  \begin{macro}{\textTwoDp}
%  These commands  all draw forms which denote the Dp rotation.
% \begin{macrocode}
\newcommand{\trDp}{\@trp{D}}
%%
\newcommand{\SquaretDp}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick]     (\@sb,\@sddd - \@ty) -- (\@sbh, \@sddd - \@ty);
\draw [thick, <-] (\@sb,\@sd   + \@ty)  -- (\@sbh, \@sd + \@ty);
\end{tikzpicture}%
}
\newcommand{\trhDp}{\raisebox{-0.333\height}{\@tlen\SquaretDp\@tlen}}
%%
\newcommand{\TwoDp}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretDp\\
\trDp%
\end{minipage}%
}}
\newcommand{\textTwoDp}{\trDp\,\trhDp}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%  \subsubsection{\hspace{3mm}Rotation F}
%
%  \begin{macro}{\trF}
%  \begin{macro}{\trhF}
%  \begin{macro}{\TwoF}
%  \begin{macro}{\textTwoF}
% \begin{macrocode}
\newcommand{\trF}{\rrF}
\newcommand{\trFp}{\rrFp}
\newcommand{\trhF}{\rrhF}
\newcommand{\trhFp}{\rrhFp}
\newcommand{\TwoF}{\RubikF}
\newcommand{\TwoFp}{\RubikFp}
\newcommand{\textTwoF}{\textRubikF}
\newcommand{\textTwoFp}{\textRubikFp}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%  \subsubsection{\hspace{3mm}Rotation L}
%
%  \begin{macro}{\trL}
%  \begin{macro}{\SquaretL}
%  \begin{macro}{\trhL}
%  \begin{macro}{\TwoL}
%  \begin{macro}{\textTwoL}
%  These commands  all draw forms which denote the L rotation.
% \begin{macrocode}
\newcommand{\trL}{\@tr{L}}
%%
\newcommand{\SquaretL}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick, <-] (\@sd + \@tx, \@sb) -- (\@sd + \@tx, \@sbh);
\draw [thick] (\@sddd - \@tx, \@sb) -- (\@sddd - \@tx, \@sbh);
\end{tikzpicture}%
}
\newcommand{\trhL}{\raisebox{-0.333\height}{\@tlen\SquaretL\@tlen}}
%%
\newcommand{\TwoL}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretL\\
\trL%
\end{minipage}%
}}
\newcommand{\textTwoL}{\trL\,\trhL}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%  \subsubsection{\hspace{3mm}Rotation Lp}
%
%  \begin{macro}{\trLp}
%  \begin{macro}{\SquaretLp}
%  \begin{macro}{\trhLp}
%  \begin{macro}{\TwoLp}
%  \begin{macro}{\textTwoLp}
%  These commands  all draw forms which denote the Lp rotation.
% \begin{macrocode}
\newcommand{\trLp}{\@trp{L}}
%%
\newcommand{\SquaretLp}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick,->] (\@sd + \@tx, \@sb) -- (\@sd + \@tx, \@sbh);
\draw [thick] (\@sddd - \@tx, \@sb) -- (\@sddd - \@tx, \@sbh);
\end{tikzpicture}%
}
\newcommand{\trhLp}{\raisebox{-0.333\height}{\@tlen\SquaretLp\@tlen}}
%%
\newcommand{\TwoLp}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretLp\\
\trLp%
\end{minipage}%
}}
\newcommand{\textTwoLp}{\trLp\,\trhLp}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%
%  \subsubsection{\hspace{3mm}Rotation R}
%
%  \begin{macro}{\trR}
%  \begin{macro}{\SquaretR}
%  \begin{macro}{\trhR}
%  \begin{macro}{\TwoR}
%  \begin{macro}{\textTwoR}
%  These commands  all draw forms which denote the R rotation.
% \begin{macrocode}
\newcommand{\trR}{\@tr{R}}
%%
\newcommand{\SquaretR}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
%% draw three lines in the square, one with an arrow
\draw [thick] (\@sd + \@tx, \@sb) -- (\@sd + \@tx, \@sbh);
\draw [thick, ->] (\@sddd - \@tx, \@sb) -- (\@sddd - \@tx, \@sbh);
\end{tikzpicture}%
}
\newcommand{\trhR}{\raisebox{-0.333\height}{\@tlen\SquaretR\@tlen}}
%%
\newcommand{\TwoR}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretR\\
\trR%
\end{minipage}%
}}
\newcommand{\textTwoR}{\trR\,\trhR}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%  \subsubsection{\hspace{3mm}Rotation Rp}
%
%  \begin{macro}{\trRp}
%  \begin{macro}{\SquaretRp}
%  \begin{macro}{\trhRp}
%  \begin{macro}{\TwoRp}
%  \begin{macro}{\textTwoRp}
%  These commands  all draw forms which denote the Rp rotation.
% \begin{macrocode}
\newcommand{\trRp}{\@trp{R}}
%%
\newcommand{\SquaretRp}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick] (\@sd + \@tx, \@sb) -- (\@sd + \@tx, \@sbh);
\draw [thick, <-] (\@sddd - \@tx, \@sb) -- (\@sddd - \@tx, \@sbh);
\end{tikzpicture}%
}
\newcommand{\trhRp}{\raisebox{-0.333\height}{\@tlen\SquaretRp\@tlen}}
%%
\newcommand{\TwoRp}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretRp\\
\trRp%
\end{minipage}%
}}
\newcommand{\textTwoRp}{\trRp\,\trhRp}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%  \subsubsection{\hspace{3mm}Rotation U}
%
%  \begin{macro}{\trU}
%  \begin{macro}{\SquaretU}
%  \begin{macro}{\trhU}
%  \begin{macro}{\TwoU}
%  \begin{macro}{\textTwoU}
%  These commands  all draw forms which denote the U rotation.
% \begin{macrocode}
\newcommand{\trU}{\@tr{U}}
%%
\newcommand{\SquaretU}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick, <-] (\@sb,\@sddd - \@ty) -- (\@sbh, \@sddd - \@ty);
\draw [thick]     (\@sb,\@sd + \@ty) --   (\@sbh, \@sd + \@ty);
\end{tikzpicture}%
}
\newcommand{\trhU}{\raisebox{-0.333\height}{\@tlen\SquaretU\@tlen}}
%%
\newcommand{\TwoU}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretU\\
\trU%
\end{minipage}%%
}}
\newcommand{\textTwoU}{\trU\,\trhU}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%
%  \subsubsection{\hspace{3mm}Rotation Up}
%
%  \begin{macro}{\trUp}
%  \begin{macro}{\SquaretUp}
%  \begin{macro}{\trhUp}
%  \begin{macro}{\TwoUp}
%  \begin{macro}{\textTwoUp}
%  These commands  all draw forms which denote the Up rotation.
% \begin{macrocode}
\newcommand{\trUp}{\@trp{U}}
%%
\newcommand{\SquaretUp}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick, ->] (\@sb,\@sddd - \@ty) -- (\@sbh, \@sddd - \@ty);
\draw [thick]     (\@sb,\@sd + \@ty) --   (\@sbh, \@sd + \@ty);
\end{tikzpicture}%
}
\newcommand{\trhUp}{\raisebox{-0.333\height}{\@tlen\SquaretUp\@tlen}}
%%
\newcommand{\TwoUp}{%
{\@rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquaretUp\\
\trUp%
\end{minipage}%%
}}
\newcommand{\textTwoUp}{\trUp\,\trhUp}
%    \end{macrocode}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%    \end{macro}
%
%
%    \subsection{\hspace{3mm}Axis rotations}
%     \label{sec:codeaxisversions}
%
%  For completeness we include a \cmd{\textTwo} version of all the 
% axis rotation codes (making them equal to their hieroglyphic \cmd{\rrh} version).
% Obviously this list must go at the end of this file. While these commands are perhaps 
% strictly unnecessary, the motivation is to allow users to include them in
% a \cmd{\ShowSequence} command when using the \cmd{\textTwo} font argument.  
%
%
% \begin{macrocode}
\newcommand{\trx}{\rrx}
\newcommand{\trxp}{\rrxp}
\newcommand{\try}{\rry}
\newcommand{\tryp}{\rryp}
\newcommand{\trz}{\rrz}
\newcommand{\trzp}{\rrzp}
\newcommand{\trl}{\rrl}
  \newcommand{\trlp}{\rrlp} %%new
\newcommand{\trr}{\rrr}
  \newcommand{\trrp}{\rrrp} %%new
\newcommand{\tru}{\rru}
  \newcommand{\trup}{\rrup} %%new
\newcommand{\trd}{\rrd}
  \newcommand{\trdp}{\rrdp} %%new
\newcommand{\trf}{\rrf}
  \newcommand{\trfp}{\rrfp} %%new
\newcommand{\trb}{\rrb}
  \newcommand{\trbp}{\rrbp} %%new
%
\newcommand{\trLc}{\rrLc}
\newcommand{\trLcp}{\rrLcp}
\newcommand{\trRc}{\rrRc}
\newcommand{\trRcp}{\rrRcp}
\newcommand{\trUc}{\rrUc}
\newcommand{\trUcp}{\rrUcp}
\newcommand{\trDc}{\rrDc}
\newcommand{\trDcp}{\rrDcp}
\newcommand{\trFc}{\rrFc}
\newcommand{\trFcp}{\rrFcp}
\newcommand{\trBc}{\rrBc}
\newcommand{\trBcp}{\rrBcp}
\newcommand{\trCL}{\rrCL}
\newcommand{\trCLp}{\rrCLp}
\newcommand{\trCR}{\rrCR}
\newcommand{\trCRp}{\rrCRp}
\newcommand{\trCU}{\rrCU}
\newcommand{\trCUp}{\rrCUp}
\newcommand{\trCD}{\rrCD}
\newcommand{\trCDp}{\rrCDp}
\newcommand{\trCF}{\rrCF}
\newcommand{\trCFp}{\rrCFp}
\newcommand{\trCB}{\rrCB}
\newcommand{\trCBp}{\rrCBp}
%    \end{macrocode}
%
%
% \begin{macrocode}
\newcommand{\trhx}{\rrhx}
\newcommand{\trhxp}{\rrhxp}
\newcommand{\trhy}{\rrhy}
\newcommand{\trhyp}{\rrhyp}
\newcommand{\trhz}{\rrhz}
\newcommand{\trhzp}{\rrhzp}
\newcommand{\trhl}{\rrhl}
   \newcommand{\trhlp}{\rrhlp} % new
\newcommand{\trhr}{\rrhr}
   \newcommand{\trhrp}{\rrhrp} % new
\newcommand{\trhu}{\rrhu}
   \newcommand{\trhup}{\rrhup} % new
\newcommand{\trhd}{\rrhd}
   \newcommand{\trhdp}{\rrhdp} % new
\newcommand{\trhf}{\rrhf}
   \newcommand{\trhfp}{\rrhfp} % new
\newcommand{\trhb}{\rrhb}
   \newcommand{\trhbp}{\rrhbp} % new
\newcommand{\trhLc}{\rrhLc}
\newcommand{\trhLcp}{\rrhLcp}
\newcommand{\trhRc}{\rrhRc}
\newcommand{\trhRcp}{\rrhRcp}
\newcommand{\trhUc}{\rrhUc}
\newcommand{\trhUcp}{\rrhUcp}
\newcommand{\trhDc}{\rrhDc}
\newcommand{\trhDcp}{\rrhDcp}
\newcommand{\trhFc}{\rrhFc}
\newcommand{\trhFcp}{\rrhFcp}
\newcommand{\trhBc}{\rrhBc}
\newcommand{\trhBcp}{\rrhBcp}
\newcommand{\trhCL}{\rrhCL}
\newcommand{\trhCLp}{\rrhCLp}
\newcommand{\trhCR}{\rrhCR}
\newcommand{\trhCRp}{\rrhCRp}
\newcommand{\trhCU}{\rrhCU}
\newcommand{\trhCUp}{\rrhCUp}
\newcommand{\trhCD}{\rrhCD}
\newcommand{\trhCDp}{\rrhCDp}
\newcommand{\trhCF}{\rrhCF}
\newcommand{\trhCFp}{\rrhCFp}
\newcommand{\trhCB}{\rrhCB}
\newcommand{\trhCBp}{\rrhCBp}
%    \end{macrocode}
%
%
% \begin{macrocode}
\newcommand{\Twox}{\Rubikx}
\newcommand{\Twoxp}{\Rubikxp}
\newcommand{\Twoy}{\Rubiky}
\newcommand{\Twoyp}{\Rubikyp}
\newcommand{\Twoz}{\Rubikz}
\newcommand{\Twozp}{\Rubikzp}
\newcommand{\Twol}{\Rubikl}
   \newcommand{\Twolp}{\Rubiklp} % new
\newcommand{\Twor}{\Rubikr}
   \newcommand{\Tworp}{\Rubikrp} % new
\newcommand{\Twou}{\Rubiku}
   \newcommand{\Twoup}{\Rubikup} % new
\newcommand{\Twod}{\Rubikd}
   \newcommand{\Twodp}{\Rubikdp} % new
\newcommand{\Twof}{\Rubikf}
   \newcommand{\Twofp}{\Rubikfp} % new
\newcommand{\Twob}{\Rubikb}
   \newcommand{\Twobp}{\Rubikbp} % new
\newcommand{\TwoLc}{\RubikLc}
\newcommand{\TwoLcp}{\RubikLcp}
\newcommand{\TwoRc}{\RubikRc}
\newcommand{\TwoRcp}{\RubikRcp}
\newcommand{\TwoUc}{\RubikUc}
\newcommand{\TwoUcp}{\RubikUcp}
\newcommand{\TwoDc}{\RubikDc}
\newcommand{\TwoDcp}{\RubikDcp}
\newcommand{\TwoFc}{\RubikFc}
\newcommand{\TwoFcp}{\RubikFcp}
\newcommand{\TwoBc}{\RubikBc}
\newcommand{\TwoBcp}{\RubikBcp}
\newcommand{\TwoCL}{\RubikCL}
\newcommand{\TwoCLp}{\RubikCLp}
\newcommand{\TwoCR}{\RubikCR}
\newcommand{\TwoCRp}{\RubikCRp}
\newcommand{\TwoCU}{\RubikCU}
\newcommand{\TwoCUp}{\RubikCUp}
\newcommand{\TwoCD}{\RubikCD}
\newcommand{\TwoCDp}{\RubikCDp}
\newcommand{\TwoCF}{\RubikCF}
\newcommand{\TwoCFp}{\RubikCFp}
\newcommand{\TwoCB}{\RubikCB}
\newcommand{\TwoCBp}{\RubikCBp}
%    \end{macrocode}
%
% \begin{macrocode}
\newcommand{\textTwox}{\rrhx}
\newcommand{\textTwoxp}{\rrhxp}
\newcommand{\textTwoy}{\rrhy}
\newcommand{\textTwoyp}{\rrhyp}
\newcommand{\textTwoz}{\rrhz}
\newcommand{\textTwozp}{\rrhzp}
\newcommand{\textTwol}{\rrhl}
   \newcommand{\textTwolp}{\rrhlp} %new
\newcommand{\textTwor}{\rrhr}
   \newcommand{\textTworp}{\rrhrp} %new
\newcommand{\textTwou}{\rrhu}
   \newcommand{\textTwoup}{\rrhup} %new
\newcommand{\textTwod}{\rrhd}
   \newcommand{\textTwodp}{\rrhdp} %new
\newcommand{\textTwof}{\rrhf}
   \newcommand{\textTwofp}{\rrhfp} %new
\newcommand{\textTwob}{\rrhb}
   \newcommand{\textTwobp}{\rrhbp} %new
\newcommand{\textTwoLc}{\rrhLc}
\newcommand{\textTwoLcp}{\rrhLcp}
\newcommand{\textTwoRc}{\rrhRc}
\newcommand{\textTwoRcp}{\rrhRcp}
\newcommand{\textTwoUc}{\rrhUc}
\newcommand{\textTwoUcp}{\rrhUcp}
\newcommand{\textTwoDc}{\rrhDc}
\newcommand{\textTwoDcp}{\rrhDcp}
\newcommand{\textTwoFc}{\rrhFc}
\newcommand{\textTwoFcp}{\rrhFcp}
\newcommand{\textTwoBc}{\rrhBc}
\newcommand{\textTwoBcp}{\rrhBcp}
\newcommand{\textTwoCL}{\rrhCL}
\newcommand{\textTwoCLp}{\rrhCLp}
\newcommand{\textTwoCR}{\rrhCR}
\newcommand{\textTwoCRp}{\rrhCRp}
\newcommand{\textTwoCU}{\rrhCU}
\newcommand{\textTwoCUp}{\rrhCUp}
\newcommand{\textTwoCD}{\rrhCD}
\newcommand{\textTwoCDp}{\rrhCDp}
\newcommand{\textTwoCF}{\rrhCF}
\newcommand{\textTwoCFp}{\rrhCFp}
\newcommand{\textTwoCB}{\rrhCB}
\newcommand{\textTwoCBp}{\rrhCBp}
%    \end{macrocode}
%
% --------------------------
%    End of this package
% --------------------------
%    \begin{macrocode}
%</rubiktwocube>
%    \end{macrocode}
%
%
% \Finale
%
\endinput