-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubikcustomizations.tex
118 lines (115 loc) · 3.04 KB
/
rubikcustomizations.tex
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
%
% Original file rubikcube.dtx
%
% Customizations:
% - \RubikRR: Sequence for R2
% - \RubikUU: Sequence for U2
% - \RubikMM: Sequence for M2
% - \Rubikxx: Sequence for x
% - \RubikBO: Open Bracket
% - \RubikBC: Close Bracket and repeat x times
% - \RubikEmpty: Phantom sequence for spacing
% Settings
\newcommand{\rubikfont}{\fontsize{10}{12pt}\usefont{T1}{cmss}{sbx}{n}}
\pgfmathsetmacro{\sd}{0.25} % a small horiz space
\pgfmathsetmacro{\sdd}{2*\sd} % 2x horiz space
\pgfmathsetmacro{\sddd}{3*\sd} % 3x horiz space
\pgfmathsetmacro{\sh}{0.6} % height
\pgfmathsetmacro{\sb}{0.2} % base
\pgfmathsetmacro{\sbh}{\sb + \sh} % UP
\pgfmathsetmacro{\scx}{\sdd+0.2} % Start of CircleX arc
\pgfmathsetmacro{\scy}{\sd*2/3} % Start of CircleY arc
\pgfmathsetmacro{\sqcx}{\scx-0.13} %% SQuare CenterX coord
\pgfmathsetmacro{\sqcy}{\scy+0.25} %% SQuare CenterY cpprd
% Squares
\newcommand{\SquareRR}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick] (\sd, \sb) -- (\sd, \sbh);
\draw [thick] (\sdd,\sb) -- (\sdd, \sbh);
\draw [thick, ->] (\sddd, \sb) -- (\sddd, \sbh);
\draw [thick, ->] (\sddd, \sb) -- (\sddd, \sbh - 0.2);
\end{tikzpicture}%
}
\newcommand{\SquareUU}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick, <-] (\sb,\sddd) -- (\sbh, \sddd);
\draw [thick, <-] (\sb + 0.2,\sddd) -- (\sbh, \sddd);
\draw [thick] (\sb,\sdd) -- (\sbh, \sdd);
\draw [thick] (\sb,\sd) -- (\sbh, \sd);
\end{tikzpicture}%
}
\newcommand{\SquareMM}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick] (\sd, \sb) -- (\sd, \sbh);
\draw [thick, <-] (\sdd,\sb) -- (\sdd, \sbh);
\draw [thick, <-] (\sdd,\sb + 0.2) -- (\sdd, \sbh);
\draw [thick] (\sddd, \sb) -- (\sddd, \sbh);
\end{tikzpicture}%
}
\newcommand{\Squarexx}{%
\begin{tikzpicture}[scale=0.5]
\DrawNotationBox;
\draw [thick, ->] (\sd, \sb) -- (\sd, \sbh);
\draw [thick, ->] (\sdd,\sb) -- (\sdd, \sbh);
\draw [thick, ->] (\sddd, \sb) -- (\sddd, \sbh);
\end{tikzpicture}%
}
% Custom \Rubik commands
\newcommand{\RubikRR}{%
{\rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquareRR\\
\rrR\textbf{2}%
\end{minipage}%%
}}
\newcommand{\RubikUU}{%
{\rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquareUU\\
\rrU\textbf{2}%
\end{minipage}%%
}}
\newcommand{\RubikMM}{%
{\rubikfont%
\begin{minipage}{0.6cm}
\centering%
\SquareMM\\
\rrM\textbf{2}%
\end{minipage}%%
}}
\newcommand{\Rubikxx}{%
{\rubikfont%
\begin{minipage}{0.6cm}
\centering%
\Squarexx\\
\textbf{x}%
\end{minipage}%%
}}
\newcommand{\RubikBO}{%
{\rubikfont%
\begin{minipage}{0.25cm}
\centering%
\textbf{\Large(}%
\end{minipage}%
}}
\newcommand{\RubikBC}[1]{%
{\rubikfont%
\begin{minipage}{0.5cm}
\centering%
\textbf{\Large){#1}}%
\end{minipage}%
}}
\newcommand{\RubikEmpty}{%
{\rubikfont%
\begin{minipage}{0.6cm}
\phantom{
\SquareM\\
\rrM%
}
\end{minipage}%
}}