summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/rubik
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-28 23:45:07 +0000
committerKarl Berry <karl@freefriends.org>2018-02-28 23:45:07 +0000
commit940e03ca0b55d204785182f33537a0c75fffbb0e (patch)
tree14a24a13ec433c2afa013b48b3b5242a82ed41ba /Master/texmf-dist/doc/latex/rubik
parente55c20f6da5b06953c9dde74fa78bf1a277eb237 (diff)
rubik (28feb18)
git-svn-id: svn://tug.org/texlive/trunk@46764 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/rubik')
-rw-r--r--Master/texmf-dist/doc/latex/rubik/README.txt205
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdfbin2908 -> 6844 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikcube.pdfbin937760 -> 1026515 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex7
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexamples.pdfbin197642 -> 581089 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexamples.sh1
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikexamples.tex1419
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdfbin277967 -> 303128 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdfbin89246 -> 205408 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh1
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex120
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotation.117
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotation.pdfbin420220 -> 447616 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdfbin266913 -> 354766 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubiktwo-doc-figA.pdfbin0 -> 11367 bytes
-rw-r--r--Master/texmf-dist/doc/latex/rubik/rubiktwocube.pdfbin0 -> 494886 bytes
16 files changed, 1242 insertions, 528 deletions
diff --git a/Master/texmf-dist/doc/latex/rubik/README.txt b/Master/texmf-dist/doc/latex/rubik/README.txt
index 1874d1938a3..232a271069b 100644
--- a/Master/texmf-dist/doc/latex/rubik/README.txt
+++ b/Master/texmf-dist/doc/latex/rubik/README.txt
@@ -1,83 +1,129 @@
- March 3, 2017
---------------------------------------------------------------------------
- The RUBIK bundle 2017/03/03
- - rubikcube package v4.0 -> macros and commands for typesetting
- - rubikrotation package v4.0 -> macros and Perl program for rotations
- - rubikpatterns package v4.0 -> macros and commands for typesetting
---------------------------------------------------------------------------
-
-The RUBIK bundle provides three complementary packages for documenting the
-Rubik cube (3x3x3) notation, configurations and for processing rotation sequences.
-The three packages are (a) the rubikcube package, (b) the rubikrotation package,
-and (c) the rubikpatterns package.
-
- (1) Rubikcube package
-
- The rubikcube package provides a collection of LaTeX commands
- and macros for typesetting Rubik cube configurations and rotation
- instructions using the PGF/TikZ graphic languages.
- (2) Rubikrotation package
-
- The rubikrotation package, is a dynamic extension to
- the rubikcube package. It consists of the Perl script
- rubikrotation.pl and style option rubikrotation.sty.
- The rubikrotation package implements rotation sequences and
- random scrambling of the Rubik cube on-the-fly, using the
- RubikRotation command. It returns the new Rubik state in a form
- which can then be typeset using commands from the rubikcube package.
-
- Since the RubikRotation command works by CALLing the
- Perl script rubikrotation.pl, it follows that the rubikrotation
- package requires (a) Perl to be installed, and (b) (Pdf/Lua)LaTeX needs
- to be run using the --shell-escape command-line switch (LuaLaTeX will
- require access to the recent shellesc package).
-
- (3) New features
-
- rubikcube:
- --- Improved documentation.
- --- Additional notation for middle slice rotations (`m' notation).
- --- Additional notation for whole cube rotations (`c' notation).
- --- Added Randelshofer notation (the `CMST' rotations).
- --- Two new \Draw.. commands which replace earlier (now deprecated
- but still supported) versions.
- --- Six new commands for showing and annotating rotation sequences.
- --- A new command for setting up a `solved' colour configuration.
- --- A new command for setting up a `starter cube' for which the whole
- cube is allocated the default grey colour.
-
- rubikrotation:
- --- better syntax checking
- --- 4 new macros SequenceInfo, SequenceName, SequenceShort, SequenceLong
-
- rubikpatterns:
- --- a new package (a small database of patterns and sequences)
-
---------------------------------------------------------------------------
+--------------------------------------------------------
+The RUBIK bundle (version 5) February 24, 2018
+
+rubikcube package : macros for typesetting 3x3x3 cubes
+rubiktwocube package : macros for typesetting 2x2x2 cubes
+rubikrotation package: macros Perl program for rotations
+rubikpatterns package: macros for typesetting
+--------------------------------------------------------
+
+The RUBIK bundle provides four complementary packages for
+documenting the Rubik cube (3x3x3) and Twocube (2x2x2)
+notation and configurations, and for processing rotation
+sequences for both cubes. A Perl program which processes
+rotation sequences on the fly is also included. The four
+packages are:
+(a) the rubikcube (3x3x3) package,
+(b) the rubiktwocube (2x2x2) package (NEW),
+(c) the rubikrotation package,
+(d) the rubikpatterns package.
+
+
+ (1) rubikcube package (3x3x3 cubes)
+
+ The rubikcube package provides a collection of LaTeX
+ commands and macros for typesetting Rubik cube
+ configurations and rotation instructions using the
+ PGF/TikZ graphic languages.
+
+
+ (2) rubiktwocube package (2x2x2 cubes) NEW
+
+ The rubiktwocube package provides a collection of LaTeX
+ commands and macros for typesetting TwoCube configurations
+ and rotation instructions using the PGF/TikZ graphic
+ languages.
+
+
+ (3) rubikrotation package
+
+ The rubikrotation package, is a dynamic extension to the
+ rubikcube and rubiktwocube packages. It consists of the
+ Perl script rubikrotation.pl and style option
+ rubikrotation.sty. The rubikrotation package implements
+ rotation sequences and random scrambling of the Rubik cube
+ on-the-fly, using the RubikRotation command. It returns
+ the new Rubik state in a form which can then be typeset
+ using commands from the Rubik bundle.
+
+ Since the RubikRotation command works by CALLing the Perl
+ script rubikrotation.pl, it follows that the rubikrotation
+ package requires
+ (a) Perl to be installed, and
+ (b) (Pdf/Lua)LaTeX to be run using the --shell-escape
+ command-line switch (available from the shellesc package).
+
+
+ (4) rubikpatterns package
+
+ The RubikPatterns package is a small database of well-known
+ patterns and sequences in the form of named macros which
+ can be processed easily using the RubikRotation command.
+
+
+ (5) New features
+
+ rubikcube:
+ --- Improved documentation.
+ --- Minor improvements to log-file documentation.
+ --- New commands for drawing cube sidebars adjacent to
+ cube edges.
+ --- Two new commands for setting up WY (White opposite
+ Yellow) and WB (White opposite Blue) `starter grey
+ cubes'.
+ --- Bugfix for the \ShowSequence command (fixes a problem
+ of fonts not being contained appropriately).
+ --- Added some missing lower case rotation notation.
+ --- A new \NoSidebar command for disabling sidebars of a
+ specified colour (mainly for use with OLL displays).
+
+ rubiktwocube:
+ --- this is new package dealing with 2x2x2 cubes, having
+ similar functionality to the rubikcube package.
+
+ rubikrotation:
+ --- minor code improvements in Perl programme, and
+ improved syntax checking.
+ --- some minor bugfixes in Perl programme
+ (eg: a zero or missing integer with random keyword
+ now generates an error message).
+ --- added new keyword `cubesize' to hold cube size
+ ie either `three' or `two' to inform Perl programme
+ as to which sort of cube is being processed.
+
+ rubikpatterns:
+ --- (no change from v4).
+
+
+-------------------------------------------------------
RWD Nickalls email: dick@nickalls.org
A Syropoulos email: asyropoulos@yahoo.com
---------------------------------------------------------------------------
-Copyright 2017 RWD Nickalls & A Syropoulos
+-------------------------------------------------------
+
+Copyright 2018 RWD Nickalls & A Syropoulos
Licence
-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 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.
+-------------------------------------------------------
The RUBIK bundle consists of the following files
-package files:
+Package files:
- rubikcube.ins,
- rubikcube.dtx,
- rubikcube.sty,
+ - rubiktwocube.ins,
+ - rubiktwocube.dtx,
+ - rubiktwocube.sty,
- rubikrotation.ins,
- rubikrotation.dtx,
- rubikrotation.sty,
@@ -85,8 +131,9 @@ package files:
- rubikpatterns.ins
- rubikpatterns.dtx
- rubikpatterns.sty
-documentation and README:
+Documentation and README:
- rubikcube.pdf
+ - rubiktwocube.pdf
- rubikrotation.pdf,
- rubikrotationPL.pdf (Perl script documentation)
- rubikrotationPL.tex
@@ -95,16 +142,18 @@ documentation and README:
- rubikpatternsLIST.pdf
- rubikpatternsLIST.tex
- README.txt (this file)
-image files:
- - pdf -files for the rubikcube documentation (6 pictures)
- - pdf -files for the rubikrotation documentation (4 pictures)
- - pdf -files for the rubikrotation documentation (1 picture)
-examples:
+Examples:
- rubikexamples.pdf,
- rubikexamples.tex
-bash and bat files (for running rubikexamples.tex and rubikpatternsLIST.tex)
---------------------------------------------------------------------------
+Image files:
+ - pdf files for rubikcube documentation (6 pictures)
+ - pdf files for rubiktwocube documentation (1 picture)
+ - pdf files for rubikrotation documentation (4 pictures)
+ - pdf files for rubikpatterns documentation (1 picture)
+Bash and bat files (for processing rubikexamples.tex and
+ rubikpatternsLIST.tex)
+-------------------------------------------------------
-If you have any ideas, suggestions, questions, or bugs to report, please
-feel free to contact us.
---------------------------------------------------------------------------
+If you have any ideas, suggestions, questions, or bugs
+to report, please contact us.
+-------------------------------------------------------
diff --git a/Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf
index 26fb68fe62c..5f33c1e28f4 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubik-doc-figD.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf b/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf
index 769582bad7a..24c67a11725 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikcube.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex b/Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex
deleted file mode 100644
index d21fedf22c5..00000000000
--- a/Master/texmf-dist/doc/latex/rubik/rubikexampfig4.tex
+++ /dev/null
@@ -1,7 +0,0 @@
-%% filename: rubikexampfig4.tex%
-\RubikFaceUp{G}{B}{R}{W}{O}{Y}{Y}{O}{R}%
-\RubikFaceDown{O}{B}{Y}{R}{R}{R}{W}{O}{W}%
-\RubikFaceLeft{Y}{G}{R}{B}{B}{O}{O}{Y}{B}%
-\RubikFaceRight{W}{G}{Y}{W}{G}{G}{O}{W}{R}%
-\RubikFaceFront{G}{G}{B}{Y}{Y}{B}{W}{R}{B}%
-\RubikFaceBack{B}{O}{O}{R}{W}{Y}{G}{W}{G}%
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf b/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf
index 34e91dc761f..18e9af6868d 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexamples.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh b/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh
index 52b86832b02..2ddad50b4d2 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexamples.sh
@@ -1,5 +1,6 @@
## rubikexamples.sh
+## Rubik bundle v5.0, 2018
## run twice to get hyperref links correct
pdflatex --shell-escape rubikexamples.tex
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex b/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex
index 053efe2e17e..7e14e1a6e35 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex
+++ b/Master/texmf-dist/doc/latex/rubik/rubikexamples.tex
@@ -1,26 +1,19 @@
%%
%% rubikexamples.tex
-%% March 03, 2017
-%% Requires rubik bundle v4.0 and also the tikz package
-%% Part of the Rubik bundle (www.ctan.org/pkg/rubik)
+%% February 25, 2018
+%% Requires ALL the rubik bundle packages and also the tikz package
+%% Part of the Rubik bundle v5.0 (www.ctan.org/pkg/rubik)
%% authors: RWD Nickalls & A Syropoulos
%%--------NOTE-------------------------------------------
%% USAGE: (pdf)latex --shell-escape rubikexamples.tex
%% run three times to get all labels and fig nos correct
%%-------------------------------------------------------
\documentclass[a4paper]{article}
+
%------rubik----------
\usepackage{tikz} %% load tikz BEFORE rubikcube
-\usepackage{rubikcube}
-\usepackage{rubikrotation}
-\usepackage{rubikpatterns}
-%------LUA-----------
-% LuaTeX is a Unicode engine (as is XeTeX)
-\usepackage{ifluatex}
-\ifluatex
- \usepackage{fontspec}
-\fi
-%--------------------
+\usepackage{rubikcube,rubikrotation,rubikpatterns,rubiktwocube}
+%----------------------
\usepackage{url}
\usepackage{ifpdf}
\usepackage{lmodern}
@@ -37,64 +30,70 @@
}
\fi
%%-------------------
-
-
-%-------------
\pagestyle{myheadings}
\markright{\texttt{rubikexamples.pdf} \ \
-(Rubik bundle v4.0, March 03, 2017) \hspace{0.5cm}\texttt{www.ctan.org/pkg/rubik}}
-%-----------
-%% brace and bracket
-\newcommand{\Rubikbracket}[1]{$\left(\mbox{#1}\right)$}
-\newcommand{\Rubikbrace}[1]{$\left\{\mbox{#1}\right\}$}
-\newcommand{\cubenumber}[1]{\strut\raisebox{1cm}{#1}}
-\newcommand{\leftface}{\textsc{left}\ face}
-\newcommand{\rightface}{\textsc{right}\ face}
-\newcommand{\upface}{\textsc{up}\ face}
-\newcommand{\downface}{\textsc{down}\ face}
-\newcommand{\frontface}{\textsc{front}\ face}
-\newcommand{\backface}{\textsc{back}\ face}
-%---------------------------------
+(Rubik bundle v5.0, 2018) \ \ \texttt{www.ctan.org/pkg/rubik}}
+
%% increase text height and width
\addtolength{\oddsidemargin}{-1.5cm}
\addtolength{\textwidth}{3cm}
\addtolength{\textheight}{1cm}
%----------------------
+%==========Rubik stuff================
+%----edge sequences for 3x3x3 cubes--------------------------
+\newcommand{\CycleThreeEdgesFlipTwo}{[CycleThreeEdgesFlipTwo],F,R,U,Rp,Up,Fp}%
+\newcommand{\cyclethreeedgesfliptwo}{\CycleThreeEdgesFlipTwo}%
+%
+%----corner sequences--------------------------
+\newcommand{\AllYellow}{[allyellow],R,U,Rp,U,R,Up,Up,Rp}% = SUNE %cross -->allyellow
+\newcommand{\allyellow}{\AllYellow}%
+\newcommand{\CycleThreeCorners}{[cyclethreecorners],Lp,U,R,Up,L,U,Rp,Up}%
+\newcommand{\cyclethreecorners}{\CycleThreeCorners}%
+\newcommand{\SwapTwoCorners}{[swaptwocorners],Rp,F,Rp,B2,R,Fp,Rp,B2,R2,Up}
+\newcommand{\swaptwocorners}{\SwapTwoCorners}
+%
+%% brace and bracket macros
+\newcommand{\Rubikbracket}[1]{$\left(\mbox{#1}\right)$}
+\newcommand{\Rubikbrace}[1]{$\left\{\mbox{#1}\right\}$}
+\newcommand{\cubenumber}[1]{\strut\raisebox{1cm}{#1}}
+%-----------------
+%
\begin{document}
-
+%
\ifpdf\pdfbookmark[1]{Title}{Title}\fi
\title{Rubik examples\\
\smallskip\normalsize\texttt{www.ctan.org/tex-archives/macros/latex/contrib/rubik/rubikexamples.pdf}
-\,\footnote{This file is part of the Rubik bundle. To generate this file,
+\,\footnote{This file is part of the Rubik bundle v5.0. To generate this file,
use the following command: \newline \texttt{\$ pdflatex --shell-escape rubikexamples.tex}}}
\author{RWD Nickalls\,\footnote{email: \textsf{dick@nickalls.org}}%
\ \ \& A Syropoulos\,\footnote{email: \textsf{asyropoulos@yahoo.com}}}
-\date{03 March 2017 (v4.0)}
+\date{25 February, 2018 (Rubik bundle v5.0)}
\maketitle
+\tableofcontents
-
-%%------------------
+\pagebreak
+%%----------------------
\section{Preliminaries}
-
-
These examples were generated using the \TeX\
-Rubik bundle\,\footnote{\url{http://www.ctan.org/pkg/rubik}} v4.0. They assume some
-familiarity with the three complementary packages \textsc{rubikcube},
-\textsc{rubikrotation} and \textsc{rubikpatterns}. For~documentation see the files:
+Rubik bundle\,\footnote{\url{http://www.ctan.org/pkg/rubik}} v5.0.
+They assume some familiarity with the four packages \textsc{rubikcube},
+\textsc{rubikrotation}, \textsc{rubikpatterns} and \textsc{rubiktwocube}.
+For~documentation see the following files:
\begin{quote}
\begin{verbatim}
-rubikcube.pdf
-rubikrotation.pdf
-rubikpatterns.pdf
-rubikpatternsLIST.pdf
+rubikcube.pdf 3x3x3 documentation
+rubikrotation.pdf commands for implementing rotation sequences
+rubikrotationPL.pdf documentation of rubikrotation.pl (Perl program)
+rubikpatterns.pdf small database of well-known 3x3x3 configurations
+rubikpatternsLIST.pdf shows all configurations in the rubikpatterns database
+rubiktwocube.pdf 2x2x2 documentation
\end{verbatim}
\end{quote}
-
This file requires the following packages: \texttt{tikz, rubikcube, rubikrotation,
-rubikpatterns}; note that the \texttt{tikz} package must be loaded \textit{before}
-the \texttt{rubikcube} package.
+rubikpatterns, rubiktwocube}; note that the \texttt{tikz} package must be loaded
+\textit{before} the \texttt{rubikcube} package.
This file needs to be run using the \verb!--shell-escape! command-line option;
for example:
@@ -105,19 +104,35 @@ pdflatex --shell-escape rubikexample.tex
\end{quote}
This is because nearly all the examples make use of the \verb!\RubikRotation!
command, which calls the Perl script \texttt{rubikrotation.pl}.
-If you do forget to use the command-line switch, the file will still run, but
-all the cubes will remain in the initial unprocessed configuration.
-
+If you do forget to use the \verb!--shell-escape! command-line switch,
+the file will still run, but all the cubes will remain in the initial
+unprocessed configuration\,\footnote{As a quick check, run this file
+(\texttt{rubikexamples.tex}) in a separate directory and look at Figure~1;
+if this appears as a `solved' cube then your system has failed to call the Perl
+script \texttt{rubikrotation.pl} correctly for some reason. The most likely
+causes of this are (a)~failure to invoke the \texttt{--shell-escape} command-line
+option correctly, or (b)~failure to use a configuration file correctly
+(ie your system can't find the Perl program)---search the \texttt{.log} file
+to see whether the file \texttt{rubikrotation.pl} has been used.}.
+
+\subsection{3x3x3 vs 2x2x2 command names}
+The introduction of the \textsc{rubiktwocube} package (Rubik bundle v5)
+has necessitated a few command name changes in order to avoid confusion
+(see the \textsc{rubikcube} package documentation \S\,3.1 for details).
+Consequently, command names containing the word `\texttt{Rubik}' denote
+a 3x3x3 cube action; similarly those containing the word `\texttt{Two}'
+denote a 2x2x2 cube action.
\subsection{Environments}
-
When using the Rubik bundle one sometimes needs to be mindful of the various
\LaTeX\ environments in which Rubik commands are placed (e.g.,~the figure,
minipage and TikZ picture environments), since these environments restrict
the actions of commands they contain to the particular environment.
The \verb!\ShowCube! command is also relevant here, since it is a
minipage-wrapper for the TikZ picture environment. Only Rubik \verb!\Draw..!
-commands actually need to be inside a TikZ picture environment.
+commands and TikZ commands (e.g.,~\verb!\draw! and \verb!\node!)
+actually need to be inside a TikZ picture environment, and hence
+inside a \verb!\ShowCube! command.
This issue arises because the Rubik bundle allows you to create figures
showing different stages during a sequence of rotations. Consequently
@@ -129,43 +144,46 @@ See Example~3 for an illustration of how to handle environments.
\pagebreak
%%------------------
-\section{Examples}
+\section{RubikCube examples (3x3x3)}
\subsection{Sixspot}
\typeout{---Example (sixspot)}
-In Figure~\ref{fig:cubeincube} we show the so-called ``sixspot'' configuration,
+In Figure~\ref{fig:sixspot} we show the so-called ``sixspot'' configuration,
generated from a solved cube using the rotation sequence
\rr{U}, \rr{Dp}, \rr{R}, \rr{Lp}, \rr{F}, \rr{Bp}, \rr{U}, \rr{Dp}.
%%--------FIGURE 1 -----------
\begin{figure}[hbt]
\centering
-\RubikCubeSolved
+\RubikCubeSolvedWY
\RubikRotation{\sixspot}
\ShowCube{7cm}{0.7}{\DrawRubikCubeSF}
-\caption{\label{fig:cubeincube}The `sixspot' configuration.}
+\caption{\label{fig:sixspot}The `sixspot' configuration.}
\end{figure}
%----------------
-{\noindent}Creating a macro to hold a rotation sequence greatly facilitates
-their use, as follows:
+{\noindent}Creating a macro to hold a rotation sequence greatly
+facilitates their use, as follows:
\begin{quote}
\begin{verbatim}
\newcommand{\sixspot}{[sixspot],U,Dp,R,Lp,F,Bp,U,Dp}
\end{verbatim}
\end{quote}
-We can now process this sequence using its macro name as an argument for the
-\verb!\RubikRotation! command. The code used for the above Figure uses the
-\verb!\ShowCube{}{}{}! command for which \verb!#1! is the minipage width, \verb!#2!
-is the tikzpicture scale factor (0--1), and \verb!#3! can include \textsc{rubikcube}
-package \verb!\Draw..! commands, and any commands which are valid for use in a
-TikZ \texttt{tikzpicture} environment. The code for the above figure is as follows:
+We can now process this sequence using its macro name as an argument
+for the \verb!\RubikRotation! command. The code used for the above
+Figure uses the \verb!\ShowCube{}{}{}! command for which \verb!#1!
+is the minipage width, \verb!#2! is the tikzpicture scale factor (0--1),
+and \verb!#3! can include \textsc{rubikcube} package \verb!\Draw..!
+commands, and any commands which are valid for use in a TikZ
+\texttt{tikzpicture} environment. The code for the above figure is
+as follows:
+
\begin{quote}
\begin{verbatim}
\begin{figure}[hbt]
\centering
- \RubikCubeSolved
+ \RubikCubeSolvedWY
\RubikRotation{\sixspot}
\ShowCube{7cm}{0.7}{\DrawRubikCubeSF}
\caption{...}
@@ -173,64 +191,64 @@ TikZ \texttt{tikzpicture} environment. The code for the above figure is as follo
\end{verbatim}
\end{quote}
-Note that the sixspot sequence is a so-called `order~3' sequence, which means that
-running the `sixspot' sequence 3 times returns the cube to its original `solved'
-state. The~command for processing it three times is \verb!\RubikRotation[3]{\sixspot}!.
+Note that the sixspot sequence is a so-called `order~3' sequence, which
+means that running the `sixspot' sequence 3 times returns the cube
+to its original `solved' state. The~command for processing it three
+times is \verb!\RubikRotation[3]{\sixspot}!.
Note that the semi-flat form of the cube here is generated by the
- \verb!\DrawRubikCubeSF! command, where the terminal SF denotes the Semi-Flat form.
-
-
+ \verb!\DrawRubikCubeSF! command, where the terminal SF denotes
+ the Semi-Flat form. To draw it completely flat use a terminal F,
+ e.g.,~\verb!\DrawRubikCubeF! (see Figure~\ref{fig:sixspotE}).
\subsubsection{Log-file extract}
+Users may find it instructive to inspect the the log-file and
+follow the dynamic interaction between \LaTeX\ and the Perl script.
+This is easy to follow, since output by \texttt{rubikrotation.sty}
+is prefixed by 3 dashes (\verb!---!), while output by the Perl script
+is prefixed by 3 dots (\verb!...!). Search for the keyword `Example',
+as this is written to the log-file at the start of each example.
-Users may find it instructive to inspect the the log-file and follow the dynamic
-interaction between \LaTeX\ and the Perl script.
-This is easy to follow, since output by \texttt{rubikrotation.sty} is prefixed
-by 3 dashes (\verb!---!), while output by the Perl script is prefixed by
-3 dots (\verb!...!). Search for the keyword `Example', as this is written to
-the log-file at the start of each example.
-
-The following is the log-file extract associated with Example~1 (from the
-author's Debian Linux platform).
+The following is part of the log-file extract associated with Example~1.
\begin{quote}
\begin{verbatim}
---Example (sixspot)
-LaTeX Font Info: Try loading font information for T1+cmss on input line 134.
-(/usr/local/texlive/2016/texmf-dist/tex/latex/base/t1cmss.fd
-File: t1cmss.fd 2014/09/29 v2.5h Standard LaTeX font definitions
-)
----TeX process (rubikrotation.sty)-------
----NEW rotation command------------------
+---TeX process---------------------------
+---script = rubikrotation.sty v5.0 (2018/02/25)
+---NEW rotation command
---command = RubikRotation[1]{[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*, 8f*)>}
----writing current Rubik state to file rubikstate.dat
+---writing current cube state to file rubikstate.dat
\openout7 = `rubikstate.dat'.
-\ourRRcounter=\count121
+\ourRRcounter=\count134
---CALLing Perl script (rubikrotation.pl)
-runsystem(perl rubikrotation.pl -i rubikstate.dat -o rubikstateNEW.dat)...execu
-ted.
+runsystem(perl $HOME/RubikTeX/PERLstuff/dtx-rubikrotation/rubikrotation.pl
+ -i rubikstate.dat -o rubikstateNEW.dat)...executed.
---inputting NEW datafile (data written by Perl script)
(./rubikstateNEW.dat
...PERL process..................................
-...script = rubikrotation.pl v4.0 (03 March 2017)
-...reading the current rubik state (from File: rubikstate.dat)
-...up,W,W,W,W,W,W,W,W,W
-...down,Y,Y,Y,Y,Y,Y,Y,Y,Y
-...left,B,B,B,B,B,B,B,B,B
+...script = rubikrotation.pl v5.0 (25 February 2018)
+...reading the current cube state (from File: rubikstate.dat)
+...
+...command = cubesize,three
+...cube = THREEcube
+...
+......up,W,W,W,W,W,W,W,W,W
+....down,Y,Y,Y,Y,Y,Y,Y,Y,Y
+....left,B,B,B,B,B,B,B,B,B
...right,G,G,G,G,G,G,G,G,G
...front,O,O,O,O,O,O,O,O,O
-...back,R,R,R,R,R,R,R,R,R
+....back,R,R,R,R,R,R,R,R,R
...
-...command=checkstate
+...rotation keyword
...checking state of cube
...cubiesum = 54 (Red=9, Or=9, Ye=9, Gr=9, Bl=9, Wh=9, X=0)
...
-...command=rotation,[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*, 8f*)>
+...command = rotation,[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*, 8f*)>
...dataline = rotation,[SixSpot],U,Dp,R,Lp,F,Bp,U,Dp,<(8q*; 8f*)>
...[SixSpot] is a label OK
...rotation U, OK
@@ -241,7 +259,7 @@ ted.
...rotation Bp, OK
...rotation U, OK
...rotation Dp, OK
-...writing new Rubik state to file rubikstateNEW.dat
+...writing new cube state to file rubikstateNEW.dat
...SequenceName = SixSpot
...SequenceInfo = (8q*; 8f*)
...SequenceShort = [SixSpot],U,Dp,R,Lp,F,Bp,U,Dp
@@ -250,42 +268,41 @@ ted.
\end{verbatim}
\end{quote}
-
-
\pagebreak
-%%-------------------------
-\subsection{ShowRubikErrors}
+\subsection{ShowErrors}
\typeout{---Example (ShowRubikErrors)}
-
- In this example we demonstrate the use of the \verb!\ShowRubikErrors! command,
+ In this example we demonstrate the use of the \verb!\ShowErrors!
+ command\,\footnote{ The \texttt{ {\textbackslash}ShowErrors} command
+ replaces the earlier \texttt{{\textbackslash}ShowRubikErrors} command
+ which is now deprecated. However, the earlier command is still
+ supported (for now) for backward compatibility.},
which places a copy of the Perl output file \verb!rubikstateERRORS.dat!
underneath the graphic so you can see a list of all the errors, if any.
Note that this example is similar to the previous one except that we have
introduced several errors---e.g.,~bad minipage width, typos, as well as
some animals---into the rotation sequence).
- It is important to note that the \verb!\ShowRubikErrors! command must be
+ It is important to note that the \verb!\ShowErrors! command must be
placed \textit{after} the TikZ picture environment (i.e.,~in this case after
the \verb!\ShowCube! command), or even at the end of the document.
-Note that full details of all errors are also included in the .log file.
+Note that full details of all errors are also included in the .log file (search for \texttt{*ERR}).
%%--------FIGURE 2 -----------
-
-\RubikCubeSolved
+%
+\RubikCubeSolvedWY
\RubikRotation{[sixspot],U,Dp,R,Lp,F,Bp,U,Dpppp,cat,dog}
-
\begin{figure}[hbt]
- \centering
- \ShowCubeF{4.5cm}{0.5}{\DrawRubikCubeF}
- \ShowRubikErrors
+\centering
+\ShowCubeF{4.5cm}{0.5}{\DrawRubikCubeF}
+\ShowErrors
\parbox{0.8\textwidth}{%
-\caption{\label{fig:cubeincubeE}The same `sixspot' sequence of rotations as shown
+\caption{\label{fig:sixspotE}The same `sixspot' sequence of rotations as shown
in Example~1, but now with some errors (wrong minipage width, typos and some
animals\,!) in the rotation sequence (it \textit{should} be just
\texttt{U,Dp,R,Lp,F,Bp,U,Dp}).}}
\end{figure}
-
+%
{\noindent}In this example we have used the F version of the \verb!\ShowCube!
command (\verb!\ShowCubeF!) which places an fbox around the image so you can see the
extent of any white space etc. This reveals that the set minipage-width ($4.5$cm) in
@@ -299,24 +316,20 @@ was generated by the following code.
%-----------------
\begin{quote}
\begin{verbatim}
-\RubikCubeSolved
+\RubikCubeSolvedWY
\RubikRotation{[sixspot],U,Dp,R,Lp,F,Bp,U,Dpppp,cat,dog}
\begin{figure}[hbt]
\centering
- \ShowCubeF{4.5cm}{0.7}{\DrawRubikCubeF}
- \ShowRubikErrors
+ \ShowCubeF{4.5cm}{0.5}{\DrawRubikCubeF}
+ \ShowErrors
\caption{....}
\end{figure}
\end{verbatim}
\end{quote}
-Even if the \verb!\ShowRubikErrors! command is not used, it is always a good idea
+Even if the \verb!\ShowErrors! command is not used, it is always a good idea
to check the file \verb!rubikstateERRORS.dat! after a \LaTeX\ run, since this
file will also reveal any errors.
-Note that the completely flat form of the cube here is generated by the
- \verb!\DrawRubikCubeF! command, where the terminal F denotes the Flat form.
-
-
\pagebreak
%----------------------
@@ -329,36 +342,35 @@ In this example we highlight the fact that Rubik commands used inside a \LaTeX\
environment remain local to that environment, and how this can sometimes be
problematic. Commands whose reach is meant to be more global need to be
executed outside such environments, where they can implement global colour
-settings, which will then be accessible to Rubik \verb!\Draw..! commands inside
-subsequent environments.
+settings, which will then be accessible to subsequent \verb!\Draw..! commands.
Since we are drawing images, this is primarily an issue
-with the the \verb!\minipage!, \verb!\figure!, and TikZ picture environments.
+with the \verb!minipage!, \verb!figure!, and TikZ picture environments.
Consequently, it is generally best when drawing a sequence of cubes to reserve
-the TikZ picture environment only for Rubik \verb!\Draw..! commands and TikZ
-commands. Importantly, this also applies to the commonly used \verb!\ShowCube!
+the TikZ picture environment only for \verb!\Draw..! commands and TikZ
+commands. Importantly, this also applies to our main display tool the \verb!\ShowCube!
command, since this is a minipage-wrapper for the TikZ picture environment
(see the \textsc{rubikcube} package documentation).
-In this example the first cube (9a) uses a \verb!\RubikCubeSolved! command
+In this example the first cube (9a) uses a \verb!\RubikCubeSolvedWY! command
\textit{inside} a \verb!\ShowCube! environment. However, if we now perform the
rotation \textRubik{R}\ (using the command \verb!\RubikRotation{R}!) this results
-in a quite unexpected effect on cube (9b) (and obviously not correct). This is because
- the effect of the initial \verb!\RubikCubeSolved! command
+in a quite unexpected effect on cube (9b) (and obviously not correct).
+This is because the action of the initial \verb!\RubikCubeSolved! command
(setting a new colour-state) is not visible outside its \verb!\ShowCube!
environment, and hence the subsequent \verb!\RubikRotation{R}! command is unaware
- of this recent attempt to update the global colour-state information.
- It turns out that this was actually last updated following the action of the \textbackslash\texttt{RubikRotation\{[sixspot],....\}} command used in
-Example~2, being the last colour-state command executed \textit{outside} an
-environment (a \texttt{figure} environment in that example). Consequently,
-the strange form of cube (9b) is not what we expected.
-
+ of this earlier attempt to update the global colour-state information.
+ It turns out that the internal colour-state was actually last updated following
+ the action of the \textbackslash\texttt{RubikRotation\{[sixspot],....\}}
+ command used in Example~2, being the last colour-state command executed
+ \textit{outside} an environment (a \texttt{figure} environment in that
+ example). Consequently, the strange cube 9b is not what we expected.
\medskip
\noindent%
\cubenumber{9a}%
\ShowCube{2cm}{0.5}{%
- \RubikCubeSolved%
+ \RubikCubeSolvedWY%
\DrawRubikCubeRU}%
\quad\Rubik{R}%
\RubikRotation{R}%
@@ -373,7 +385,7 @@ the strange form of cube (9b) is not what we expected.
...
\cubenumber{9a}%
\ShowCube{2cm}{0.5}{%
- \RubikCubeSolved%
+ \RubikCubeSolvedWY%
\DrawRubikCubeRU%
}%
\quad\Rubik{R}%
@@ -385,16 +397,17 @@ the strange form of cube (9b) is not what we expected.
\bigskip
-If we now bring the \verb!\RubikCubeSolved! command out and place it before
-the \verb!\ShowCube! command then its `state' information becomes globally
-accessible (i.e.,~colour-state gets updated), and therefore gets used by the
-\verb!\RubikRotation{R}! command, and hence cube (9d) is rendered correctly.
+If we now bring the \verb!\RubikCubeSolvedWY! command out of the \verb!\ShowCube!
+environment and place it \textit{before} the \verb!\ShowCube! command (see cubes 9c, 9d),
+then its colour `state' information becomes globally accessible (i.e.,~colour-state
+gets updated) and therefore gets used by the subsequent \verb!\RubikRotation{R}!
+command, and hence the cube (9d) is now rendered correctly.
\bigskip
\noindent%
-\RubikCubeSolved%
\cubenumber{9c}%
+\RubikCubeSolvedWY%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{R}%
\RubikRotation{R}%
@@ -404,8 +417,8 @@ accessible (i.e.,~colour-state gets updated), and therefore gets used by the
\hspace{5mm}
\begin{minipage}{0.5\textwidth}
\begin{verbatim}
-\RubikCubeSolved%
\cubenumber{9c}%
+\RubikCubeSolvedWY%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{R}%
\RubikRotation{R}%
@@ -415,6 +428,11 @@ accessible (i.e.,~colour-state gets updated), and therefore gets used by the
\end{verbatim}
\end{minipage}
+\bigskip
+
+Note that the horizontal space occupied by \texttt{9d} is almost exactly
+the same as \verb!\quad!, and so we don't need to include any additional
+space before the \verb!\cubenumber{9d}! command.
@@ -425,18 +443,18 @@ accessible (i.e.,~colour-state gets updated), and therefore gets used by the
For all cubes the origin of coordinates is defined as the bottom left corner of
-the \frontface. Consequently, it is easy to determine the coordinates of points
-and hence draw lines, circles, and place lettering or other objects using the
-standard TikZ \verb!\draw..! and \verb!\node..! commands. Note that for
-convenience point $P$ is designed to be $(-1,-1)$ on the 2D view.
-(The~following diagram is Fig~1 from the \textsc{rubikcube} package documentation).
-
+the \textsc{front} face. Consequently, it is easy to determine the coordinates
+of points and hence draw lines, circles, and place lettering or other objects
+using the standard TikZ \verb!\draw..! and \verb!\node..! commands. Note that for
+convenience point $P$ (bottom back left corner) is designed to be $(-1,-1)$
+on the 2D view. (The~following diagram is Fig~1 from the \textsc{rubikcube}
+package documentation).
\begin{figure}[hbt]
\centering
\RubikFaceFrontAll{X} % X = default = grey
\ShowCube{5.6cm}{0.7}{%
- \DrawFlatFront
+ \DrawRubikFaceFront
\draw[line join=round,line cap=round,ultra thick] (0,0) -- (0,4); % Y
\draw[line join=round,line cap=round,ultra thick] (0,0) -- (4,0); % X
@@ -445,7 +463,6 @@ convenience point $P$ is designed to be $(-1,-1)$ on the 2D view.
\node (Ylabel) at (-0.35, 3.8) {$Y$};
\node (Xlabel) at ( 3.8, -0.4) {$X$};
-
%%----------draw the Rubik faces--------
%% outline Front face
\draw[line join=round,line cap=round,ultra thick]%
@@ -471,13 +488,11 @@ convenience point $P$ is designed to be $(-1,-1)$ on the 2D view.
}
\end{figure}
-
-
{\noindent}The code for the figure is given below.
-We draw everything in the \verb!\ShowCube! environment; the \frontface\
+We draw everything in the \verb!\ShowCube! environment; the \textsc{front} face
in grey (colour code = \texttt{X}) using the Rubik command
-\verb!\DrawFlatFront{X}!, and then draw all the lines and text using standard
+\verb!\DrawRubikFlatFront!, and then draw all the lines and text using standard
TikZ commands. The correct minipage-width argument (5.6cm) for the
\verb!\ShowCube! command is determined by trial-and-error, using the `fbox'
form of the command (\verb!\ShowCubeF!), and then the `F' is removed
@@ -491,7 +506,7 @@ start with a lower-case letter (e.g.,~\verb!\draw..!).
\centering
\RubikFaceFrontAll{X}% X = default non-colour (grey)
\ShowCube{5.6cm}{0.7}{%
- \DrawFlatFront
+ \DrawRubikFaceFront
\draw[line join=round,line cap=round,ultra thick] (0,0) -- (0,4);% Yaxis
\draw[line join=round,line cap=round,ultra thick] (0,0) -- (4,0);% Xaxis
\node (Ylabel) at (-0.35, 3.8) {$Y$};
@@ -516,16 +531,12 @@ start with a lower-case letter (e.g.,~\verb!\draw..!).
\end{quote}
-
-
\pagebreak
+
%----------------------
\subsection{Face notation}
\typeout{---Example (face notation)}
-
-%% = my Fig A (rubikcube.dtx)
-
The following diagram is Fig~2 from the \textsc{rubikcube} package documentation.
\begin{figure}[htb]
@@ -569,8 +580,7 @@ The following diagram is Fig~2 from the \textsc{rubikcube} package documentatio
\end{figure}
{\noindent}The code for the figure is as follows
-(the origin $(0,0)$ is at the bottom left corner of the \frontface).
-
+(the origin $(0,0)$ is at the bottom left corner of the \textsc{front} (green) face).
\begin{quote}
\begin{verbatim}
@@ -608,31 +618,30 @@ The following diagram is Fig~2 from the \textsc{rubikcube} package documentatio
\end{quote}
-
-
-
\pagebreak
+
%----------------------
\subsection{Grey cube}
\label{sec:greycube}
\typeout{---Example (grey cube)}
-
-When explaining elementary layer~1 moves, it can be useful to use the `grey cube'
-(\verb!\RubikCubeGrey!), as this sets up only the central cubie on each face;
-we have shown the first cube in Semi-Flat (SF) mode simply to show how the grey
-cube is configured (note that an `all-grey' cube is also available:
-\verb!\RubikCubeAllGrey!). Both of these grey cube commands will also accept
+When explaining elementary layer-1 moves, it can be useful to use the `grey cube'
+(\verb!\RubikCubeGreyWY!) ---White opposite Yellow--- as this sets up only
+the central cubie on each face.
+We have shown the first cube here in Semi-Flat (SF) mode simply to show how the grey
+cube is configured (note that a WB version (\verb!\RubikCubeGreyWB!)
+and an `all-grey' version (\verb!\RubikCubeAllGrey!) are also available.
+Note that all these grey cube commands will also accept
the word `gray' (to be consistent with TikZ).
In this example, we show how to position a single `flipped' white/orange edge
cubie in the top layer.
-
\begin{figure}[hbt]
\centering%
-\RubikCubeGrey%
+\RubikCubeGreyWY%
+
\RubikFaceUp{X}{X}{X}%
{X}{W}{O}%
{X}{X}{X}%
@@ -655,7 +664,6 @@ cubie in the top layer.
\end{figure}
-
{\noindent}The code for the figure is given below.
After setting up the first cube, we then just use the \verb!\RubikRotation!
command to generate the remaining cubes.
@@ -670,7 +678,7 @@ G~(green), B~(blue), W~(white), and X~(grey).
\begin{figure}[hbt]
\centering
% set up the first cube
-\RubikCubeGrey%
+\RubikCubeGreyWY%
\RubikFaceUp{X}{X}{X}%
{X}{W}{O}%
{X}{X}{X}%
@@ -693,8 +701,6 @@ G~(green), B~(blue), W~(white), and X~(grey).
\end{quote}
-
-
\pagebreak
%-------------------------------
@@ -702,7 +708,6 @@ G~(green), B~(blue), W~(white), and X~(grey).
\label{sec:scrambleacube}
\typeout{---Example (scramble a cube)}
-
In this example we use the \verb!\RubikRotation! command to scramble a `solved'
Rubik cube via a sequence of 120 random rotations, using the following command
(the details of the process can be seen in the \texttt{.log} file):
@@ -713,20 +718,20 @@ Rubik cube via a sequence of 120 random rotations, using the following command
\end{quote}
On this occasion we draw the cube Flat (F) using the command \verb!\DrawRubikCubeF!.
In this example, we also make use of the \verb!\SaveRubikState{}! command to save
-the final configuration (state) to a file (\texttt{rubikexampfig4.tex}) using
-\verb!\SaveRubikState{rubikexampfig4.tex}!,
+the configuration (state) displayed here in Figure~3 to a file
+(\texttt{rubikexampfig3.tex}) using \verb!\SaveRubikState{rubikexampfig3.tex}!,
so we can display the same cube configuration later but in a different format
(we show it again in the following example (Example~\ref{sec:saverubikstate}).
Note that since we are using a random sequence, it follows that each
time this file is run not only will a visually different cube be generated,
-but the same state will be shown in both
+but the same state will be shown both
here and in Example~\ref{sec:saverubikstate}.
%%--------FIGURE 3 -----------
\begin{figure}[hbt]
\centering
- \RubikCubeSolved
+ \RubikCubeSolvedWY
\RubikRotation{random,120}
- \SaveRubikState{rubikexampfig4.tex}
+ \SaveRubikState{rubikexampfig3.tex}
\ShowCubeF{6cm}{0.5}{\DrawRubikCubeF}
\parbox{0.7\textwidth}{%
\caption{\label{fig:randomone}This shows a cube generated by 120 random rotations}}
@@ -737,10 +742,9 @@ here and in Example~\ref{sec:saverubikstate}.
\usepackage{tikz,rubikcube,rubikrotation}
...
\begin{figure}[hbt]
- \centering
- \RubikCubeSolved
+ \centering\RubikCubeSolvedWY
\RubikRotation{random,120}
- \SaveRubikState{rubikexampfig4.tex}
+ \SaveRubikState{rubikexampfig3.tex}
\ShowCubeF{6cm}{0.5}{\DrawRubikCubeF}
\caption{....}
\end{figure}
@@ -753,7 +757,7 @@ here and in Example~\ref{sec:saverubikstate}.
\smallskip
{\noindent}A: The object is 12~cubie squares wide. Since the TikZ scale-factor
-argument of the \verb!\ShowCube! command (cms/unit length; default = 1) in this
+argument of the \verb!\ShowCube! command (cms/unit length) in this
case is set to~$0.5$, then the true width of the image will
be $12 \times 0.5 = 6$\,cm. Note that here we have used the \verb!\ShowCubeF!
command and so we can see that this is correct. Changing the scale-factor will
@@ -771,7 +775,6 @@ may appear strange unless each image closely fits its own minipage-width etc.
It is often useful, therefore, to check the size of the fbox (using the
\verb!\ShowCubeF! command) as we have done here.
-
\pagebreak
@@ -780,22 +783,26 @@ It is often useful, therefore, to check the size of the fbox (using the
\label{sec:saverubikstate}
\typeout{---Example (SaveRubikState)}
-In this example we display a cube having the same state as that shown in
-the previous example (Example~\ref{sec:scrambleacube}). The configuration state
-was saved from Figure~\ref{fig:randomone} using the command
-\verb!\SaveRubikState{rubikexampfig4.tex}!, and then input here
-using \verb!\input{rubikexampfig4.tex}!. These commands therefore allow the
+In this example we display a cube having the same colour state as that shown in
+the previous example (Example~\ref{sec:scrambleacube}) ---see Figure~\ref{fig:randomone}.
+The cube's colour state was saved from the previous example using the command
+\verb!\SaveRubikState{rubikexampfig3.tex}!, and then input here
+using the command \verb!\input{rubikexampfig3.tex}!. These commands therefore allow the
state of a previous cube to be saved to a file, and then displayed again
later in a different format.
+
%%-----------FIGURE 4 -----------
\begin{figure}[hbt]
\centering
- \input{rubikexampfig4.tex}
+ \input{rubikexampfig3.tex}
\ShowCube{4cm}{0.8}{\DrawRubikCubeLD}
\parbox{0.7\textwidth}{%
-\caption{\label{fig:randomtwo}This shows a Rubik cube in exactly the same
-state as the one shown in Figure~\ref{fig:randomone}} }
+ \caption{\label{fig:randomtwo} This shows a Rubik cube in exactly the same
+ colour state as the one shown in Figure~\ref{fig:randomone}, but here displayed
+ as a cube seen from the LD (Left-Down) viewpoint.}%
+}%
\end{figure}
+
%%---------------------------------
\begin{quote}
\begin{verbatim}
@@ -803,35 +810,41 @@ state as the one shown in Figure~\ref{fig:randomone}} }
...
\begin{figure}[hbt]
\centering
- \input{rubikexampfig4.tex}
- \Showcube{4cm}{0.8}{\DrawRubikCubeLD}
-\caption{....}
+ \input{rubikexampfig3.tex}
+ \ShowCube{4cm}{0.8}{\DrawRubikCubeLD}
+ \parbox{0.7\textwidth}{%
+ \caption{....}%
+ }%
\end{figure}
\end{verbatim}
\end{quote}
-
+\noindent\textsc{note}: The command \verb!\SaveRubikState{}! is part of the
+\textsc{rubikrotation} package; see the documentation for further details.
\pagebreak
+
%----------------------
\subsection{Series of cubes}
\typeout{---Example (series of cubes)}
Here we show a convenient way of displaying a series of small cubes showing
-a sequence of rotations (\rr{U}, \rr{R}, \rr{F}).
-
+the action of a sequence of rotations (\rr{U}, \rr{R}, \rr{F}) on a solved cube.
\begin{figure}[hbt]
\centering
-\RubikCubeSolved
+\RubikCubeSolvedWY%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{U}\quad%
-\RubikRotation{U}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\RubikRotation{U}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{R}\quad%
-\RubikRotation{R}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\RubikRotation{R}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{F}\quad%
-\RubikRotation{F}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\RubikRotation{F}%
+\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\caption{The rotations \rr{U}, \rr{R}, \rr{F}\ on a solved cube.}
\end{figure}
@@ -842,29 +855,46 @@ a sequence of rotations (\rr{U}, \rr{R}, \rr{F}).
...
\begin{figure}[hbt]
\centering%
- \RubikCubeSolved%
+ \RubikCubeSolvedWY%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{U}\quad%
- \RubikRotation{U}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \RubikRotation{U}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{R}\quad%
- \RubikRotation{R}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \RubikRotation{R}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\quad\Rubik{F}\quad%
- \RubikRotation{F}\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \RubikRotation{F}%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\caption{The rotations \rr{U}, \rr{R}, \rr{F}\ on a solved cube.}
\end{figure}
\end{verbatim}
\end{quote}
-{\noindent}Note that we are starting with the default white-opposite-yellow (WY)
-solved cube, using the command \verb!\RubikCubeSolved!, which is functionally
-the same as the more explicit \verb!\RubikCubeSolvedWY! (if you forget the
-terminal two letters then at least you will get a `solved' cube).
-A white-opposite-blue (WB) solved cube is available as \verb!\RubikCubeSolvedWB!.
+{\noindent}\textsc{Note} 1: We start with the White-opposite-Yellow (WY)
+solved cube, using the command \verb!\RubikCubeSolvedWY!.
+A White-opposite-Blue (WB) solved cube is available as \verb!\RubikCubeSolvedWB!.
+\medskip
+{\noindent}\textsc{Note} 2: There are four different commands for typesetting
+ 3x3x3 rotation codes in various formats (a slightly different set of four
+commands are used for the equivalent 2x2x2 rotation codes).
+In~this (3x3x3) example, we have used two of them; for example:
+{\newline}\verb!\rr{U}! $\rightarrow$ \rr{U} \ (here the \verb!\rr{}! stands
+for `rubik rotation'), and also
+{\newline}\verb!\Rubik{U}! $\rightarrow$ \Rubik{U}. This command typesets
+both the hieroglyph and the rotation code vertically one above the other.
+ The other two commands are as follows:
+{\newline}\verb!\rrh{U}! $\rightarrow$ \rrh{U} \ (here the \verb!\rrh{}!
+stands for `rubik rotation hieroglyph'), and also
+{\newline}\verb!\textRubik{U}! $\rightarrow$ \textRubik{U}. This command
+typesets both the rotation code and the hieroglyph on the same line one
+after the other.
\pagebreak
+
%----------------------
\subsection{Rotation sequence}
\typeout{---Example (rotation sequence)}
@@ -879,7 +909,7 @@ and (b)~allows the easy application of software tools.
(or `moves') from some initial starting configuration (typically a `solved'
configuration). For example, FourSpot is a well known pattern which we can
generate from a solved Rubik cube using the macro \verb!\FourSpot!; it is
- defined as follows:
+ defined in the \textsc{rubikpatterns} package as follows:
\begin{quote}
\begin{verbatim}
\newcommand{\FourSpot}{[FourSpot],F2,B2,U,Dp,R2,L2,U,Dp,<(12q*, 8f*)>}
@@ -894,13 +924,15 @@ and (b)~allows the easy application of software tools.
\bigskip
\noindent%
-\RubikCubeSolvedWY
+\RubikCubeSolvedWY%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRD}
\RubikRotation{\FourSpot}
-\quad\SequenceBraceA{FourSpot}{%
+\quad%
+\SequenceBraceA{FourSpot}{%
\ShowSequence{}{\Rubik}{\SequenceLong}%
}
-\quad\ShowCube{2cm}{0.5}{\DrawRubikCubeSF}
+\quad%
+\ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
\bigskip
@@ -912,15 +944,15 @@ and (b)~allows the easy application of software tools.
\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
...
\noindent%
-\RubikCubeSolvedWY
+\RubikCubeSolvedWY%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRD}
\RubikRotation{\FourSpot}
-\quad
+\quad%
\SequenceBraceA{FourSpot}{%
\ShowSequence{}{\Rubik}{\SequenceLong}%
}
-\quad
-\ShowCube{2cm}{0.5}{\DrawRubikCubeSF}
+\quad%
+\ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
\end{verbatim}
\end{quote}
Note that we have spread the code slightly here in order to emphasise that
@@ -933,6 +965,13 @@ The first cube is drawn from the RD (Right-Down) viewpoint (\verb!\DrawRubikCub
The second cube is drawn from the SF (Semi-Flat) viewpoint (\verb!\DrawRubikCubeSF!)
so we can see all the faces.
+Note that we execute the \verb!\RubikRotation{}! command \textit{before} showing
+the sequence itself. This is because the Perl program (CALLed by
+\verb!\RubikRotation!) allocates the rotation sequence to the variable
+\verb!\SequenceLong! which we then display using the \verb!\ShowSequence! command
+(see the \textsc{rubikrotation} documentation for details).
+
+
\pagebreak
%----------------------
@@ -941,17 +980,25 @@ so we can see all the faces.
A more interesting cube pattern is the SixTs configuration (from the
\textsc{rubikpatterns} package), which we now show in a slightly
-different way (adding an extra face), as follows:
+different way (adding an extra face and also some cube sidebars), as follows:
\bigskip
\noindent\hfil%
-\RubikCubeSolvedWB%
-\ShowCube{1.6cm}{0.4}{\DrawRubikCubeRU\DrawFlatDown{0}{-3.3}}%
+\RubikCubeSolvedWB
+\ShowCube{1.6cm}{0.4}{
+ \DrawRubikCubeRU
+ \DrawRubikFlatDown{0}{-3.3}}
\RubikRotation{\sixts}
\quad\SequenceBraceA{SixTs}{\ShowSequence{,\ }{\texttt}{\SequenceLong}}
-\quad\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
-\quad\ShowCube{2cm}{0.5}{\DrawFaceFrontSide}%
+\quad\ShowCube{3cm}{0.5}{
+ \DrawRubikCubeRU
+ \DrawRubikCubeSidebarFL{RU}
+ \DrawRubikCubeSidebarFD{RU}
+ \DrawRubikCubeSidebarBR{RU}
+ \DrawRubikCubeSidebarBU{RU}
+ }
+
\hfil
\bigskip
@@ -959,36 +1006,36 @@ different way (adding an extra face), as follows:
This time we have started with a solved cube having the WB configuration
(White opposite Blue), which is generated using the command
\verb!\RubikCubeSolvedWB!
-(we have added the \downface\ (blue) below to reveal the colour of this
+(we have added the \textsc{down} face (blue) below to reveal the colour of this
face---see note below).
The rotation sequence is in `long-format' (expanded into
separate rotations), comma-separated and space, typewriter font,
using the command \verb!\ShowSequence{,\ }{\texttt}{\SequenceLong}!.
-The final image shows just the \frontface\ together with all the
-side-bars indicating the colours of the adjacent facelets,
-using the \verb!\DrawFaceFrontSide! command. The images are
-separated using \verb!\quad!.
+The final image shows the sixT cube together with the main cube sidebars
+ indicating the colours of the adjacent facelets,
+using the \verb!\DrawRubikCubeSidebarXX! commands.
The code for the above figure is as follows:
\begin{quote}
\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
-...
-\noindent\hfil
\RubikCubeSolvedWB
\ShowCube{1.6cm}{0.4}{%
- \DrawRubikCubeRU%
- \DrawFlatDown{0}{-3.3}%
- }
+ \DrawRubikCubeRU%
+ \DrawRubikFlatDown{0}{-3.3}%
+ }
\RubikRotation{\SixTs}
\quad\SequenceBraceA{SixTs}{%
- \ShowSequence{,\ }{\texttt}{\SequenceLong}%
- }
-\quad\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\quad\ShowCube{2cm}{0.5}{\DrawFaceFrontSide}
-\hfil
+ \ShowSequence{,\ }{\texttt}{\SequenceLong}%
+ }
+\quad\ShowCube{2cm}{0.5}{
+ \DrawRubikCubeRU
+ \DrawRubikCubeSidebarFL{RU}
+ \DrawRubikCubeSidebarFD{RU}
+ \DrawRubikCubeSidebarBR{RU}
+ \DrawRubikCubeSidebarBU{RU}
+ }
\end{verbatim}
\end{quote}
@@ -998,11 +1045,13 @@ The code for the above figure is as follows:
\begin{enumerate}
- \item We have drawn the \downface\ of the first cube using the command
-\verb!\DrawFlatDown{0}{-3.3}! where the two arguments are the $x$ and
-$y$ coordinates of the \textit{bottom left} corner of the \downface\ (blue).
-Note that the grid origin of all cube images coincides with the
-\textit{bottom left} corner of the \frontface\ (green in this case).
+ \item We have drawn the \textsc{down} face of the first cube using the command
+\verb!\DrawRubikFlatDown{0}{-3.3}! where the two arguments are the $x$ and
+$y$ coordinates of the \textit{bottom left} corner of the \textsc{down} face
+(blue); these $(x,y)$ arguments allow us to position the blue `flat' face in
+relation to the cube. Note that the grid origin of a cube image (on the page)
+coincides with the \textit{bottom left} corner of the \textsc{front} face
+(green in this case).
\item The first image is really just 4 units wide. This is because the 2D width
of the \textit{side} face (red) is designed to measure 1~unit wide in the
@@ -1014,38 +1063,46 @@ $4\times 0.4 = 1.6$cm., hence we have \verb!\ShowCube{1.6cm}{0.4}{...}!.
\end{enumerate}
-
\pagebreak
-%----------------------
-\subsection{Three-edge cycle}
-\typeout{---Example (three-edge cycle)}
-
-The following example shows a sequence often used in solving the final layer.
- The black (no flip) and magenta (flip) arrows indicate the \upface\
-cubie movement associated with the `three-edge cycle sequence
-\ShowSequence{,}{\rr}{F,R,U,Rp,Up,Fp}. The blue arrows indicate so-called
-collateral damage (two pairs of corner cubies swap positions) which can be fixed
-at a later stage. (This diagram is from Section~13 in the
-\textsc{rubikcube} package documentation).
+%----------------------
+\subsection[Cycle three edges]{Cycle three edges (flip two)}
+\typeout{---Example (cycle three edges (flip two))}
+
+The following example illustrates a sequence used for cycling three edges,
+which is often used in generating the `cross' formation while solving the
+final layer. However, it is a useful exercise to perform this sequence on
+a solved cube, as this reveals quite clearly its rather complex actions
+(it~also swaps two pairs of corners).
+
+ The black arrow (no flip) and magenta arrows (flip) indicate the \textsc{up}
+ face edge cubies which are cycled anti-clockwise by the sequence
+\ShowSequence{,}{\rr}{F,R,U,Rp,Up,Fp}. The blue arrows indicate the associated
+`collateral damage' actions (two pairs of corner cubies swap positions);
+depending on the circumstances, these other actions may be an acceptable
+cost since they can be fixed at a later stage. (This diagram is from
+Section~13 in the \textsc{rubikcube} package documentation).
+
+Note that we include the \textsc{up}-face sidebars to reveal the remaining
+facelet colours of the top layer (using the command \verb!\DrawRubikFaceUpSide!)
+so we can see how the sequence makes the cubies rotate and turn as they move.
\bigskip%
\noindent\hfil%
- \RubikCubeSolved%
- \ShowCube{1.6cm}{0.4}{\DrawRubikCubeRU}%
- \quad\ShowCube{1.6cm}{0.4}{%
- \DrawFlatUpSide%
+ \RubikCubeSolvedWY%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \quad\ShowCube{2.3cm}{0.5}{%
+ \DrawRubikFaceUpSide%
\draw[thick,->,color=magenta] (1.5,0.5) -- (2.4, 1.4);
\draw[thick,->] (2.5,1.5) -- (1.6, 2.4);
\draw[thick,->,color=magenta] (1.3, 2.3) -- (1.3, 0.5);
\draw[thick,<->, color=blue] (0.5,2.6) -- (2.5, 2.6);
\draw[thick,<->, color=blue] (0.5,0.3) -- (2.5, 0.3);
}%
- \RubikRotation{F,R,U,Rp,Up,Fp}%
+ \RubikRotation{\CycleThreeEdgesFlipTwo}%
\quad\ShowSequence{}{\Rubik}{\SequenceLong}\quad$\longrightarrow$\quad%
- \ShowCube{1.6cm}{0.4}{\DrawFlatUpSide}%
+ \ShowCube{2.3cm}{0.5}{\DrawRubikFaceUpSide}%
\hfil%
-
\bigskip%
@@ -1053,26 +1110,27 @@ at a later stage. (This diagram is from Section~13 in the
\begin{verbatim}
- \bigskip%
- \noindent\hfil%
+\newcommand{\CycleThreeEdgesFlipTwo}{F,R,U,Rp,Up,Fp}%
+ ...
+ ...
\RubikCubeSolved%
- \ShowCube{1.6cm}{0.4}{\DrawRubikCubeRU}%
- \quad\ShowCube{1.6cm}{0.4}{%
- \DrawFlatUpSide%
+ \ShowCube{2cm}{0.4}{\DrawRubikCubeRU}%
+ \quad\ShowCube{2.3cm}{0.4}{%
+ \DrawRubikFaceUpSide%
\draw[thick,->,color=magenta] (1.5,0.5) -- (2.4, 1.4);
\draw[thick,->] (2.5,1.5) -- (1.6, 2.4);
\draw[thick,->,color=magenta] (1.3, 2.3) -- (1.3, 0.5);
\draw[thick,<->, color=blue] (0.5,2.6) -- (2.5, 2.6);
\draw[thick,<->, color=blue] (0.5,0.3) -- (2.5, 0.3);
}%
- \RubikRotation{F,R,U,Rp,Up,Fp}%
+ \RubikRotation{\CycleThreeEdgesFlipTwo}%
\quad\ShowSequence{}{\Rubik}{\SequenceLong}\quad$\longrightarrow$\quad%
- \ShowCube{1.6cm}{0.4}{\DrawFlatUpSide}%
- \hfil%
-
- \bigskip
+ \ShowCube{2.3cm}{0.4}{\DrawRubikFaceUpSide}%
\end{verbatim}
+{\noindent}Note that the TikZ \verb!\draw! commands (for drawing the arrows
+on the cube face) start with a lower-case letter, and also require a terminal
+semicolon.
@@ -1080,7 +1138,7 @@ at a later stage. (This diagram is from Section~13 in the
\pagebreak
%----------------------
\subsection{Superflip}
-\typeout{---Example (subperflip)}
+\typeout{---Example (superflip)}
Once you can solve Rubik's cube, then an interesting exercise is to generate
@@ -1088,51 +1146,52 @@ the so-called `superflip' configuration, in which all the
corners are correctly solved, while all the edges are
flipped\,\footnote{See the `superflip' entry in \textit{Wikipedia}, and also
the Kociemba website (\url{www.kociemba.org/cube.htm}); particularly the page
-\url{http://kociemba.org/math/oh.htm}}.
+\url{http://kociemba.org/math/oh.htm}}.
%--------draw the images-------------
\begin{figure}[hbt]
\centering
- \RubikCubeSolved
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \quad$\longrightarrow$\quad%
+ \RubikCubeSolvedWY%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \qquad$\longrightarrow$\qquad%
\RubikRotation{\superflip}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeLD}
- \quad\quad%
- \ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeLD}%
+ \qquad%
+ \ShowCube{5cm}{0.5}{\DrawRubikCubeSF}%
\caption{Two representations of the superflip configuration.}
\end{figure}
%----------------------
{\noindent}A superflip sequence converts the solved cube on the left
into the form on the right, using the command \verb!\RubikRotation{\superflip}!.
-The full code for the above figure is as follows:
+The code for the above figure is shown below (the~\verb!\superflip! macro
+used here is from the \textsc{rubikpatterns} package).
\begin{verbatim}
\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
...
\begin{figure}[hbt]
\centering
- \RubikCubeSolved
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
- \quad$\longrightarrow$\quad%
+ \RubikCubeSolvedWY%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+ \qquad$\longrightarrow$\qquad%
\RubikRotation{\superflip}%
\ShowCube{2cm}{0.5}{\DrawRubikCubeLD}
- \quad\quad%
+ \qquad%
\ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
\caption{...}
\end{figure}
\end{verbatim}
-The following superflip sequence\,\footnote{This particular superflip sequence
-(in the \textsc{rubikpatterns} package) is due to Reid (1995);
-for details see the \textsc{rubikpatterns} package
-documentation, and also \url{http://kociemba.org/math/oh.htm}.
-Another 20-move superflip sequence (due to H Kociemba), is designated as K32466
- in \url{www.nickalls.org/dick/papers/tex/RUBIK20moves.zip}.}
-has just 20 HTM rotations (Half Turn Metric: counting 180~degree turns as just
-one `rotation'). Note that the \textsc{rubikpatterns} package contains this particular
-superflip sequence as the macro \verb!\superflip!
+The following superflip sequence\,\footnote{This particular superflip
+sequence (in the \textsc{rubikpatterns} package) is due to Reid (1995);
+for details see the \textsc{rubikpatterns} package documentation, and
+also \url{http://kociemba.org/math/oh.htm}.
+Another 20-move superflip sequence (due to H Kociemba), is designated
+as K32466 in \url{www.nickalls.org/dick/papers/tex/RUBIK20moves.zip}.}
+has just 20 HTM rotations (Half Turn Metric: counting 180~degree turns
+as just one `rotation'). Note that the \textsc{rubikpatterns} package
+contains this particular superflip sequence as the macro \verb!\superflip!
(see \texttt{rubikpatterns.pdf}). Consequently the code
\verb!\ShowSequence{,}{\large\texttt}{\superflip}!, will typeset the sequence
as follows:
@@ -1141,24 +1200,25 @@ as follows:
%% show the Short code
\ShowSequence{,}{\texttt}{\superflip}
\end{center}
-Note that for convenience, the \textsc{rubikpatterns} package includes the sequence
-name (in square brackets) as the first element of the associated macro.
-This is possible since the contents of a comma-separated square bracket is not
-actioned as a rotation when it appears as part of the argument of
-the \verb!\RubikRotation! command.
+Note that for convenience, the \textsc{rubikpatterns} package includes
+the sequence name (in square brackets) as the first element of the
+associated macro. This is possible since the contents of a comma-separated
+square bracket are not actioned as a rotation by the \verb!\RubikRotation!
+command.
\pagebreak
-Next we present the sequence without commas in the form of hieroglyphs using
-the \verb!\Rubik! font, for which we require the `expanded' \verb!\SequenceLong!
-form (since the `short form' includes trailing digits---see \S\,9 in
-\texttt{rubikcube.pdf}), using the code
+Next we present the same superflip sequence but without commas and in
+the form of hieroglyphs, using the \verb!\Rubik! font, for which we
+require the `expanded' \verb!\SequenceLong! form (since the `short form'
+includes trailing digits---see Section~11 in the \textsc{rubikcube}
+documentation), using the following code:
\begin{quote}
\begin{verbatim}
\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
...
-\RubikCubeSolved
+\RubikCubeSolvedWY
\RubikRotation{\superflip}
\noindent\strut\hspace{-8mm}\ShowSequence{}{\Rubik}{\SequenceLong}
\end{verbatim}
@@ -1168,7 +1228,7 @@ which gives
\bigskip
-\RubikCubeSolved
+\RubikCubeSolvedWY
\RubikRotation{\superflip}
\noindent\strut\hspace{-8mm}\ShowSequence{}{\Rubik}{\SequenceLong}
@@ -1180,16 +1240,17 @@ which gives
Interestingly, the superflip sequence is actually equivalent to
-\Rubikbrace{\Rubikbracket{\Rubik{Rmp}\Rubik{Up}}4, \Rubik{yp}, \Rubik{x}}3.
-Furthermore we can readily demonstrate this, as we can process this novel form
-of the sequence using some useful features of the \verb!\RubikRotation!
-command, as follows:
+\Rubikbrace{\Rubikbracket{\Rubik{Rm}\Rubik{U}}4, \Rubik{x},
+\Rubik{yp}}3 \ \ (Harris (2008), p151).
+Furthermore we can readily demonstrate this, as we can process
+this novel form of the sequence using some useful features of
+the \verb!\RubikRotation! command, as follows:
\begin{quote}
\begin{verbatim}
-\RubikCubeSolved%
-\RubikRotation[3]{[superflip],(Rmp,Up)4,yp,x}%
-\ShowCube{4cm}{0.4}{\DrawRubikCubeSF}%
+\RubikCubeSolvedWF
+\RubikRotation[3]{[superflip],(Rm,U)4,x,yp,<Harris (2008), p151>}
+\ShowCube{4cm}{0.4}{\DrawRubikCubeSF}
\end{verbatim}
\end{quote}
which generates the following
@@ -1197,45 +1258,46 @@ which generates the following
%-------------------
\begin{figure}[hbt]
\centering
- \RubikCubeSolved%
- \RubikRotation[3]{[shortsuper],(Rmp,Up)4,yp,x}%
+ \RubikCubeSolvedWY
+ %%% \RubikRotation[3]{[shortsuper],(Rmp,Up)4,yp,x}% ORG
+ \RubikRotation[3]{[shortsuper],(Rm,U)4,x,yp,<Harris (2008), p151>}
\ShowCube{5cm}{0.5}{\DrawRubikCubeSF}
-\end{figure}
+ \end{figure}
%----------------------
{\noindent}which is exactly the same configuration as before.
-Note that to do this we had to make use of the `repeat' option \verb![3]!
+Note that to do this we made use of the `repeat' option \verb![3]!
as well as the \verb!(Rmp,Up)4! `repeat-block' in
the argument of the \verb!\RubikRotation! command above.
-
-
\pagebreak
+
%----------------------
\subsection{Inverse sequence}
\typeout{---Example (inverse sequence)}
-Generating the inverse of a Rubik sequence involves (a)~reversing the order of
-the sequence, and (b)~inverting each rotation in the sequence
-(see Sections~5.1 and 5.11 in the \textsc{rubikrotation} package documentation).
+Generating the inverse of a Rubik sequence involves (a)~reversing the
+order of the sequence, and (b)~inverting each rotation in the sequence
+(see Sections~5.1 and 5.1.1 in the \textsc{rubikrotation} package
+documentation).
-
-From the grey-cube example~(\ref{sec:greycube}) we saw that the sixspot sequence is: \verb!U,Dp,R,Lp,F,Bp,U,Dp!;
-its inverse is therefore readily determined as \verb!D,Up,B,Fp,L,Rp,D,Up!.
-Note that this is easy to check since the sequence generated by the
-\verb!\RubikRotation! command is held by the macro \verb!\SequenceLong!.
-For~example, the output of the following commands
+From the grey-cube example~(\ref{sec:greycube}) we saw that the sixspot
+sequence is: \verb!U,Dp,R,Lp,F,Bp,U,Dp!; its inverse is therefore
+readily determined as \verb!D,Up,B,Fp,L,Rp,D,Up!. Note that this is
+easy to check since the sequence generated by the \verb!\RubikRotation!
+command is held by the macro \verb!\SequenceLong!. For~example, the
+output of the following commands
\begin{quote}
\begin{verbatim}
-\fbox{\strut\ %
-The inverse of the sixspot sequence is:
-\RubikRotation{\sixspot,<inverse>}
-\ShowSequence{,}{\texttt}{\SequenceLong}.
-}
+\fbox{\strut\rule{0pt}{10pt}%
+ The inverse of the sixspot sequence is:
+ \RubikRotation{\sixspot,<inverse>}
+ \ShowSequence{,}{\texttt}{\SequenceLong}.
+ }
\end{verbatim}
\end{quote}
-is \quad\fbox{\strut\ %
+is \quad\fbox{\strut\rule{0pt}{10pt} %
The inverse of the sixspot sequence is:
\RubikRotation{\sixspot,<inverse>}
\ShowSequence{,}{\texttt}{\SequenceLong}.
@@ -1243,56 +1305,49 @@ The inverse of the sixspot sequence is:
\bigskip
-A sequence and its inverse will annihilate each other when applied consecutively.
-For example, in the following figure we start with a solved cube and
-apply the sixspot sequence. Applying the inverse of the sixspot sequence then
-results in the solved cube configuration again.
+A sequence and its inverse will annihilate each other when applied
+consecutively. For example, in the following figure we start with
+a solved cube and apply the sixspot sequence. Applying the inverse
+of the sixspot sequence then results in the solved cube configuration
+ again.
-\newcommand{\sixspotINV}{[sixspotINV],D,Up,B,Fp,L,Rp,D,Up}
\newcommand{\sixspotarrow}{$\quad\overrightarrow{\strut\textsc{sixspot}}\quad$}
\newcommand{\sixspotINVarrow}{$\quad\overrightarrow{\strut\textsc{sixspotINV}}\quad$}
\begin{figure}[hbt]
\centering
-\RubikCubeSolved%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotarrow%
+\RubikCubeSolvedWY%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\RubikRotation{\sixspot}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotINVarrow%
-\RubikRotation{\sixspotINV}%
+ \sixspotarrow%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\RubikRotation{\sixspot,<inverse>}%
+ \sixspotINVarrow%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
\end{figure}
{\noindent}The code for the above figure is as follows:
-\begin{quote}
\begin{verbatim}
-\usepackage{tikz,rubikcube,rubikrotation,rubikpatterns}
-...
-\newcommand{\sixspotINV}{[sixspotINV],D,Up,B,Fp,L,Rp,D,Up}
\newcommand{\sixspotarrow}{$\quad\overrightarrow{\strut\textsc{sixspot}}\quad$}
\newcommand{\sixspotINVarrow}{$\quad\overrightarrow{\strut\textsc{sixspotINV}}\quad$}
-
-\begin{figure}[hbt]
-\centering
-\RubikCubeSolved%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotarrow%
+...
+\RubikCubeSolvedWY\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
\RubikRotation{\sixspot}%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}\sixspotINVarrow%
-\RubikRotation{\sixspotINV}%
+ \sixspotarrow%
+ \ShowCube{2cm}{0.5}{\DrawRubikCubeRU}%
+\RubikRotation{\sixspot,<inverse>}%
+ \sixspotINVarrow%
\ShowCube{2cm}{0.5}{\DrawRubikCubeRU}
-\end{figure}
\end{verbatim}
-\end{quote}
-\pagebreak
-A significant property of the superflip configuration is that it is its own inverse.
-Consequently we can achieve a similar result simply by applying the
+A significant property of the superflip configuration is that it is its own
+inverse. Consequently we can achieve a similar result simply by applying the
superflip sequence \textit{twice in succession}, as follows:
\newcommand{\superfliparrow}{$\quad\overrightarrow{\strut\textsc{superflip}}\quad$}
-
\begin{figure}[hbt]
\centering
\RubikCubeSolved%
@@ -1304,6 +1359,636 @@ superflip sequence \textit{twice in succession}, as follows:
\end{figure}
+\pagebreak
+
+%-------------------
+\subsection{OLL example}
+
+% ThreeCube YellowCross (from dnRUBIKsolution15)
+\newcommand{\yellowcross}{[yellowcross],F,R,U,Rp,Up,Fp}
+\newcommand{\arrow}[1]{$\overrightarrow{\strut\mbox{#1}}$}
+\newcommand{\ShowYellowFace}{\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUpSide}}
+
+Here we illustrate the use of the \verb!\NoSidebar! command (see the
+\textsc{rubikcube} package documentation) to generate nice displays
+of so-called OLL (Orientate Lower Layer) configurations, which are
+typically rendered using the yellow face.
+
+For example, the following sequence shows an efficient
+algorithm (sequence) for `solving' the OLL configuration shown
+in cube~A (listed as OLL case~33 in Harris
+(2008, page~61)\footnote{Harris D (2008). \textit{Speedsolving the cube},
+(Stirling Publishing Co, New York) {\newline}(\texttt{www.stirlingpublishing.com})
+[covers 2x2x2, 3x3x3, 4x4x4, 5x5x5 cubes].} and also on the Harris OLL webpage \url{http://www.cubestation/3x3x3/cfop/oll/ollprintablepage.php}).
+
+
+%% Dan Harris case 33 (in his 2008 book)
+\newcommand{\CaseXXXIII}{[caseHarris33],R, U, Rp, U, R, Up, Rp, Up, Rp, F, R, Fp}
+% {\DH2008thth}
+
+\bigskip
+
+%% setup OLL position DH33 (Dan Harris)
+\RubikCubeGreyAll
+\RubikFaceUp{X}{Y}{Y}
+ {Y}{Y}{X}
+ {Y}{X}{X}
+\RubikFaceBack XXY XXXXXX
+\RubikFaceLeft XXX XXXXXX
+\RubikFaceRight YYX XXXXXX
+\RubikFaceFront XYX XXXXXX
+%
+\cubenumber{A}%
+\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUpSide}%
+%
+\RubikRotation{\CaseXXXIII}%
+\quad\SequenceBraceA{OLLcase33Harris}{%
+ \ShowSequence{}{\Rubik}{\CaseXXXIII}%
+ }%
+\quad$\longrightarrow$\quad%
+\cubenumber{B}%
+\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUpSide}%
+
+\bigskip
+
+{\noindent}The code for the above figure is as follows (note that
+the \verb!\NoSidebar{X}! command is placed inside the \verb!\ShowCube!
+environment in order to limit its action).
+
+\begin{quote}
+\begin{verbatim}
+\newcommand{\cubenumber}[1]{\strut\raisebox{1cm}{#1}}
+\newcommand{\CaseXXXIII}{[caseHarris33],R,U,Rp,U,R,Up,Rp,Up,Rp,F,R,Fp}
+%
+\RubikCubeGreyAll
+\RubikFaceUp{X}{Y}{Y}
+ {Y}{Y}{X}
+ {Y}{X}{X}
+\RubikFaceBack XXY XXXXXX
+\RubikFaceLeft XXX XXXXXX
+\RubikFaceRight YYX XXXXXX
+\RubikFaceFront XYX XXXXXX
+\cubenumber{A}%
+\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUpSide}%
+\RubikRotation{\CaseXXXIII}%
+\quad\SequenceBraceA{OLLcase33Harris}{%
+ \ShowSequence{}{\Rubik}{\CaseXXXIII}%
+ }%
+\quad$\longrightarrow$\quad%
+\cubenumber{B}%
+\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUpSide}%
+\end{verbatim}
+\end{quote}
+Note that since we originally defined the OLL case~33 algorithm
+(Harris 2008) as a macro, it follows that we could instead have
+recovered the OLL~33 configuration (cube~A above) using the
+inverse algorithm, as follows:
+
+\bigskip
+
+\RubikCubeGreyAll
+\RubikFaceUpAll{Y}
+\RubikRotation{<inverse>,\CaseXXXIII}
+\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUS}%
+\hspace{1cm}
+\begin{minipage}{4cm}
+\begin{verbatim}
+\RubikCubeGreyAll
+\RubikFaceUpAll{Y}
+\RubikRotation{<inverse>,\CaseXXXIII}
+\ShowCube{2.6cm}{0.6}{\NoSidebar{X}\DrawRubikFaceUS}
+\end{verbatim}
+\end{minipage}
+
+\bigskip
+
+{\noindent}Note that in this last example we have used the more convenient
+short-hand US (UpSide) version of the \verb!\DrawRubikFaceUpSide! command,
+namely \verb!\DrawRubikFaceUS!.
+
+
+
+\pagebreak
+%----------------------
+\subsection{Cube patterns}
+\typeout{---Example (Cube patterns)}
+
+\newcommand{\CycleThreeUpEdges}{[CycleUpEdges],F2,U,Rm,Up,Up,Lm,U,Fp2}
+\newcommand{\StripesOrtho}{[StripesOrtho],Lp,Fp,Rp,L,U,D, Rp,Dp,Lp,Bp,U2,Lp,Up,R,L,Up,F2,Rp,<Harris 2008, p150>}
+
+We now look at how the \verb!\RubikRotation! command can be used to
+investigate cube patterns, which are typically shown only as a
+regular cube. For example, consider the following interesting sequence
+\linebreak\texttt{L' F' R' L U D R' D' L' B' U2 L' U' R L U' F2 R'}
+(Harris 2008, page~150), which is presented as a cube with orthogonal
+stripes (see figure~A). In order to show the pattern using the Rubik
+ bundle, it is often useful to first express the sequence as a macro.
+ In this particular case we need to adjust the Harris (2008) notation
+ slightly to make it compatible (ie, insert commas, change trailing
+ `primes' into a trailing `p'), give it a suitable name
+ (say, \verb![StripesOrtho]!), and, for completion, include the citation
+in an `infoblock' ($<$...$>$), as follows:
+
+\begin{verbatim}
+\newcommand{\StripesOrtho}{%
+ [StripesOrtho],Lp,Fp,Rp,L,U,D,Rp,Dp,Lp,Bp,U2,Lp,Up,R,L,Up,F2,Rp,<Harris 2008, p150>}
+\end{verbatim}
+We can now process it simply by using its macro-name as the argument for
+the \verb!\RubikRotation! command; for example, the following code displays
+it as figure~A.
+
+\begin{verbatim}
+\RubikCubeSolved
+\RubikRotation{\StripesOrtho}
+\ShowCube{2.6cm}{0.6}{\DrawRubikCubeRU}
+\end{verbatim}
+
+At first sight this looks like a nice example of orthogonal stripes,
+but if we look at all the faces by rendering the cube in a Semi-Flat
+(SF) view (using the command \verb!\DrawRubikCubeSF!)
+ ---see~figure~B--- this reveals that unfortunately only five faces
+actually have a center stripe.
+
+\bigskip
+
+\RubikCubeSolved
+\RubikRotation{\StripesOrtho}
+\cubenumber{A}
+\ShowCube{2.6cm}{0.6}{\DrawRubikCubeRU}
+\hspace{3cm}
+\cubenumber{B}
+\ShowCube{4cm}{0.4}{\DrawRubikCubeSF}
+
+\bigskip
+
+{\noindent}So the question is: can we improve on this and create a cube
+with a fully orthogonal pattern, by swapping the relevant red/yellow
+and blue/yellow edge cubies in the back layer? Since it is impossible
+to swap just two edge cubies within the same layer in a 3x3x3 cube
+without changing any other cubies, the answer is no. However, we are
+able to cycle cleanly three edge cubies within one face, and a single
+cycle could at least create the final stripe with only minimal collateral
+damage.
+
+For example, if we rotate the whole cube using the rotation denoted
+as \rr{Rcp} (= \verb!\rr{Rcp}!)\,\footnote{There are several equivalent
+notations for this: \rr{Rcp} $\equiv$ \rr{xp} $\equiv$ \rr{CRp};
+the c and C denote a whole cube rotation.} to bring the \textsc{back} face to
+the \textsc{up} position (as shown in figure~C), we can then cycle the three
+\textsc{up} edge cubies UL, UR, UF clockwise using the following
+`CycleThreeUpEdges' sequence:
+\begin{verbatim}
+\newcommand{\CycleThreeUpEdges}{F2,U,Rm,Up,Up,Lm,U,Fp2}
+\end{verbatim}
+We can combine these two actions using the command
+\verb!\RubikRotation{Rcp,\CycleThreeUpEdges}!, which will then align the
+three red facelets in the \textsc{up} face and form the final stripe
+(see figure~D).
+
+\RubikCubeSolved
+\RubikRotation{\StripesOrtho,Rcp}
+\cubenumber{C}
+\ShowCube{2.6cm}{0.6}\DrawRubikCubeRU
+\hspace{3cm}
+\RubikRotation{\CycleThreeUpEdges}
+\cubenumber{D}
+\ShowCube{4cm}{0.4}\DrawRubikCubeSF
+
+\medskip
+
+The downside, of course, is that a yellow and a white facelet are also
+swapped in the top layer, but at least we now have a cube with six
+mutually adjacent orthogonal central stripes\,!
+
+
+\pagebreak
+
+%%=====================TWOcube stuff======================================
+%%========================================================================
+
+\section{TwoCube examples (2x2x2)}
+
+\subsection{Commands \& notation}
+
+Regarding the 2x2x2 cube as a `TwoCube' (instead of a RubikCube) makes
+the 2x2x2 commands very intuitive (assuming you are familiar with the
+3x3x3 commands), since they are mostly obtained just by exchanging
+the word `Rubik' in 3x3x3 commands for the word `Two'. For example,
+
+\medskip
+
+\verb!3x3x3!\quad\hspace{1cm}$\rightarrow$\quad\hspace{1cm}\verb!2x2x2!
+
+\smallskip
+
+\verb!\RubikCubeSolvedWY! $\rightarrow$ \verb!\TwoCubeSolvedWY!
+
+\verb!\RubikRotation!\qquad\ $\rightarrow$ \quad\verb!\TwoRotation!
+
+\verb!\SaveRubikState!\qquad\ $\rightarrow$ \quad\verb!\SaveTwoState!
+
+\medskip
+
+Note that although the 2x2x2 cube does not have any middle slices, one can still
+ actually use the 3x3x3 commands \verb!\RubikRotation! and \verb!\SaveRubikState!
+ in the usual way (because the corner cubies are still processed in
+the usual way). However, in the interests of consistency
+both of these commands have equivalent `Two' versions: namely
+\verb!\TwoRotation! and \verb!\SaveTwoState!.
+
+Of course there are considerably fewer rotation codes and hieroglyphs
+associated with the TwoCube (since there are no middle slices), and
+their commands also mirror the 3x3x3 equivalents in the \textsc{rubikcube}
+package; i.e.,~\verb!Rubik! $\rightarrow$ \verb!Two! and
+\verb!r! $\rightarrow$ \verb!t!. Thus the changes associated with the
+four key commands can be summarised as follows :
+
+ \medskip
+
+ \verb!3x3x3! \hphantom{$\rightarrow$} \verb!2x2x2!
+
+ \smallskip
+
+ \verb!\rr{}! $\rightarrow$ \verb!\tr{}!
+
+ \verb!\rrh{}! $\rightarrow$ \verb!\trh{}!
+
+ \verb!\Rubik{}! $\rightarrow$ \verb!\Two{}!
+
+ \verb!\textRubik{}! $\rightarrow$ \verb!\textTwo{}!
+
+
+%-----------------------
+
+\bigskip
+
+%-------------------
+\subsection{Visualising white-space}
+
+This example shows how the F version of the \verb!\ShowCube{}{}{}! command can be useful for revealing excess white space.
+
+
+
+ \bigskip
+
+\TwoCubeSolvedWB%
+\ShowCubeF{3cm}{0.6}{\DrawTwoCubeRU}%
+\quad\ShowCubeF{1.7cm}{0.6}{\DrawTwoFaceUS}%
+\hspace{1cm}
+\begin{minipage}{0.3\textwidth}
+\begin{verbatim}
+\TwoCubeSolvedWB%
+\ShowCubeF{3cm}{0.6}{\DrawTwoCubeRU}%
+\quad%
+\ShowCubeF{1.7cm}{0.5}{\DrawTwoFaceUS}%
+\end{verbatim}
+\end{minipage}
+
+
+\bigskip
+
+ Both images above have an F-box drawn around them (so we can see the
+ extent of any white space) using the F version of the \verb!\ShowCube!$\{\mbox{\textit{width}}\}\{\mbox{\textit{scale-factor}}\}\{\}$ command,
+ namely \verb!\ShowCubeF{}{}{}!. Clearly the \verb!3cm! width we have
+ used for the first cube above is too much, and so in the second pair
+ of images below we have reduced this width for the first image to
+ its correct value of \verb!1.6cm!, and have removed the F from the
+ \verb!\ShowCubeF! command accordingly.
+
+\bigskip
+
+\quad%
+\TwoCubeSolvedWB%
+\ShowCube{1.6cm}{0.6}{\DrawTwoCubeRU}%
+\quad%
+\ShowCube{1.7cm}{0.6}{\DrawTwoFaceUS}%
+\hspace{1cm}
+\begin{minipage}{0.3\textwidth}
+\begin{verbatim}
+\TwoCubeSolvedWB%
+\ShowCube{1.6cm}{0.6}{\DrawTwoCubeRU}%
+\quad%
+\ShowCube{1.7cm}{0.5}{\DrawTwoFaceUS}%
+\end{verbatim}
+\end{minipage}
+
+\bigskip
+
+Thus use of the F version of the the \verb!ShowCube! command allows
+the user to easily determine---by trial \& error---the correct minipage
+width for a particular cube.
+
+
+\pagebreak
+
+%-------------------
+\subsection{Flat and semi-flat formats}
+
+We can view the hidden faces of a cube using the semi-flat (SF) and
+flat (F) versions of the \verb!\DrawTwoCube..! command as follows.
+
+In the first figure we have also used the F version of the
+\verb!\ShowCube{}{}{}! command to reveal the size of the minipage
+which contains the image. Notice that since the 2D width of the side
+face (red) is approximately 1 unit, we can estimate that the total
+width of the image will be 6 + 1 = 7 units, and hence as we have
+specified a TikZ scale factor of 0.6, then the required width of
+the minipage is approximately $4.2$ ($= 7 \times 0.6$)
+---see Section~4.1 in the \textsc{rubikcube} package documentation
+for details).
+
+\bigskip
+
+\begin{minipage}{0.3\textwidth}
+\centering
+\TwoCubeSolvedWB%
+\ShowCubeF{4.2cm}{0.6}{\DrawTwoCubeSF}%
+\end{minipage}
+ \hspace{2cm}
+\begin{minipage}{0.3\textwidth}
+\begin{verbatim}
+\TwoCubeSolvedWB%
+\ShowCubeF{4.2cm}{0.6}{\DrawTwoCubeSF}%
+\end{verbatim}
+ \end{minipage}
+
+\bigskip
+
+\begin{minipage}{0.3\textwidth}
+\centering
+\TwoCubeSolvedWB%
+\ShowCube{4.8cm}{0.6}{\DrawTwoCubeF}%
+\end{minipage}
+ \hspace{2cm}
+\begin{minipage}{0.3\textwidth}
+\begin{verbatim}
+\TwoCubeSolvedWB%
+\ShowCube{4.8cm}{0.6}{\DrawTwoCubeF}%
+\end{verbatim}
+ \end{minipage}
+
+
+
+ \pagebreak
+
+%-------------------
+\subsection{Grey cube}
+
+
+A cube with all of the facelets coloured grey (a `grey' cube) can be
+useful as a starting state for instruction. Such a cube is generated
+by the command \verb!\TwoCubeGreyAll!.
+We can then allocate colours to those facelets demonstrating
+some feature of cube manipulation.
+ Here we are showing how to rotate the GWR corner cubie in the bottom layer
+ up into its `solved' position in the top layer. We also use two cube
+ sidebars to show the colours of the hidden facelets of the corner cubie.
+
+ \bigskip
+
+
+\noindent\hfil%
+\TwoCubeGrey
+\ShowCube{2cm}{0.7}{\DrawTwoCube}%
+%
+\TwoFaceUp{X}{X}
+ {R}{W}%
+\TwoFaceFront{G}{R}
+ {W}{X}%
+\TwoFaceLeft XX
+ XG%
+\TwoFaceDown{R}{X}
+ {X}{X}%
+\quad\ShowCube{2cm}{0.7}{
+ \DrawTwoCube
+ \DrawTwoCubeSidebarFD{RU}
+ \DrawTwoCubeSidebarFL{RU}
+ }%
+\quad\Two{Lp}\quad
+\TwoRotation{Lp}
+\ShowCube{2cm}{0.7}{\DrawTwoCube}%
+\hfil%
+
+\bigskip
+
+{\noindent}The code for the above figure is as follows:
+\begin{quote}
+\begin{verbatim}
+\noindent\hfil%
+\TwoCubeGrey
+\ShowCube{2cm}{0.6}{\DrawTwoCube}%
+%
+\TwoFaceUp{X}{X}
+ {R}{W}%
+\TwoFaceFront{G}{R}
+ {W}{X}%
+\TwoFaceLeft XX
+ XG%
+\TwoFaceDown{R}{X}
+ {X}{X}%
+\ShowCube{2cm}{0.6}{
+ \DrawTwoCube
+ \DrawTwoCubeSidebarFD{RU}
+ \DrawTwoCubeSidebarFL{RU}
+ }%
+\quad\Two{Lp}\quad
+\TwoRotation{Lp}
+\ShowCube{2cm}{0.6}{\DrawTwoCube}%
+\hfil%
+\end{verbatim}
+\end{quote}
+Notice that the curly brackets associated with the \verb!\TwoFace..! commands
+can be omitted providing at least one space is left before the first colour code
+(see the \verb!\TwoFaceLeft..! command above).
+
+
+ \pagebreak
+
+%-------------------
+\subsection{Scrambled cube}
+
+In the following example we scramble the cube using 20 random rotations using
+$\langle$\texttt{random,20}$\rangle$ as the argument
+for the \verb!\TwoRotation{}! command. We have also added a set of cube sidebars
+to the second cube. The final semi-flat (SF) cube has the same colour configuration
+and shows the hidden faces, allowing you to check the colours of the sidebars.
+
+\bigskip
+
+ \noindent\hfil%
+ \TwoCubeSolvedWY%
+ \ShowCube{1.8cm}{0.7}{\DrawTwoCubeRU}%
+ \qquad$\longrightarrow$\qquad%
+ %---------------
+ \TwoRotation{random,20}
+ %----------------
+ \ShowCube{2.8cm}{0.7}{
+ \DrawTwoCubeRU
+ \DrawTwoCubeSidebarFL{RU} % Front-Left edge sidebar
+ \DrawTwoCubeSidebarFD{RU} % Front-Down edge
+ \DrawTwoCubeSidebarBR{RU} % Back-Right edge
+ \DrawTwoCubeSidebarBU{RU} % Back-Up edge
+ }%
+ \qquad\ShowCube{5cm}{0.7}{\DrawTwoCubeSF}%
+ \hfil%
+
+ \bigskip
+
+
+ \begin{quote}
+ \begin{verbatim}
+ \noindent\hfil%
+ \TwoCubeSolvedWY%
+ \ShowCube{1.8cm}{0.7}{\DrawTwoCubeRU}%
+ \qquad$\longrightarrow$\qquad%
+ %---------------
+ \TwoRotation{random,20}
+ %----------------
+ \ShowCube{2.8cm}{0.7}{
+ \DrawTwoCubeRU
+ \DrawTwoCubeSidebarFL{RU} % Front-Left edge sidebar
+ \DrawTwoCubeSidebarFD{RU} % Front-Down edge
+ \DrawTwoCubeSidebarBR{RU} % Back-Right edge
+ \DrawTwoCubeSidebarBU{RU} % Back-Up edge
+ }%
+ \qquad\ShowCube{5cm}{0.7}{\DrawTwoCubeSF}%
+ \hfil%
+ \end{verbatim}
+ \end{quote}
+
+
+
+%-------------------
+\subsubsection*{A simple scramble}
+
+A simple scramble (from a solved position) which
+makes each face have four different facelets is $\left\{\mbox{\tr{R},
+\tr{y}}\right\}$5 as follows (note that the optional \verb!\TwoRotation!
+square bracket holds the repeat number~$5$):
+
+\bigskip
+
+\begin{minipage}{0.3\textwidth}
+\centering
+\TwoCubeSolvedWB%
+\TwoRotation[5]{R,y}%
+\ShowCube{5cm}{0.6}{\DrawTwoCubeF}%
+\end{minipage}
+ \hspace{2cm}
+\begin{minipage}{0.3\textwidth}
+\begin{verbatim}
+\TwoCubeSolvedWB%
+\TwoRotation[5]{R,y}%
+\ShowCube{5cm}{0.6}{\DrawTwoCubeF}%
+\end{verbatim}
+ \end{minipage}
+
+
+\pagebreak
+
+%-------------------
+\subsection{Swap two corners}
+
+The following example is the header figure for the \textsc{rubiktwocube}
+package documentation, and shows the `SwapTwoCorners' sequence often
+necessary in the solution of a 2x2x2 cube.
+
+ \bigskip
+
+ \noindent\hfil%
+ %% set up the cube with corners swapped
+ \TwoCubeSolvedWY%
+ \TwoRotation{Rc2}% turn upside down (= Rc2) x2
+ \TwoRotation{\swaptwocorners}%
+ %%
+ % now show the cube, before and after swapping the corners again
+ \ShowCube{1.6cm}{0.6}{\DrawTwoCubeRU}%
+ \quad\ShowCube{1.7cm}{0.5}{\DrawTwoFaceUS}%
+ \TwoRotation{\swaptwocorners}%
+ \quad\SequenceBraceA{SwapTwoCorners}{\ShowSequence{}{\Two}{\SequenceLong}}%
+ \quad$\longrightarrow$%
+ \quad\ShowCube{1.7cm}{0.5}{\DrawTwoFaceUS}%
+ \hfil%
+
+ \bigskip%
+
+ {\noindent}The code for the above figure is as follows:
+ \begin{verbatim}
+ \usepackage{tikz}
+ \usepackage{rubikcube,rubikrotation,rubikpatterns,rubiktwocube}
+ ...
+ \newcommand{\SwapTwoCorners}{[swaptwocorners],Rp,F,Rp,B2,R,Fp,Rp,B2,R2,Up}
+ \newcommand{\swaptwocorners}{\SwapTwoCorners}
+ ...
+ \noindent
+ \hfil%
+ %% set up the cube with corners swapped
+ \TwoCubeSolvedWY%
+ \TwoRotation{Rc2}% turn cube upside down about the R face
+ \TwoRotation{\swaptwocorners}%
+ %% now show the cube, before and after swapping the corners
+ \ShowCube{1.6cm}{0.6}{\DrawTwoCubeRU}%
+ \quad\ShowCube{1.7cm}{0.5}{\DrawTwoFaceUS}%
+ \TwoRotation{\swaptwocorners}%
+ \quad\SequenceBraceA{SwapTwoCorners}{\ShowSequence{}{\Two}{\SequenceLong}}%
+ \quad$\longrightarrow$%
+ \quad\ShowCube{1.7cm}{0.5}{\DrawTwoFaceUS}%
+ \hfil%
+ \end{verbatim}
+
+\pagebreak
+
+%-------------------
+\subsection{OLL example}
+
+Here we illustrate an OLL algorithm which orientates the last layer
+starting from a single yellow facelet in the UFL position.
+
+\bigskip
+
+\noindent\hfil%
+\TwoCubeGreyAll%
+\TwoFaceUp{X}{X}%
+ {Y}{X}%
+\TwoFaceBack XY XX
+\TwoFaceRight XY XX%
+\TwoFaceFront XY XX%
+\ShowCube{2cm}{0.7}{\NoSidebar{X}\DrawTwoFaceUS}
+ \SaveTwoState{cubeTWO.tex} %***
+\TwoRotation{\allyellow}%
+\quad\SequenceBraceA{AllYellow}{\ShowSequence{}{\Two}{\SequenceLong}}\quad$\longrightarrow$\quad%
+\ShowCube{1.5cm}{0.7}{\NoSidebar{X}\DrawTwoFaceUS}
+\hfil%
+
+\bigskip
+
+The code is shown below. Note that we have used the \verb!\NoSidebar{X}!
+command to disable the drawing of any grey sidebars by the \verb!\DrawTwoFaceUS!
+command\footnote{Note that the \textbackslash\texttt{DrawTwoFaceUS} command is a short-hand
+equivalent to the \textbackslash\texttt{DrawTwoFaceUpSide} command.}
+ and hence only yellow sidebars are drawn. Note that we have placed the
+\verb!\NoSidebar{X}! command inside the \verb!\ShowCube! environment in order
+to limit its action locally.
+
+\begin{quote}
+\begin{verbatim}
+\noindent\hfil%
+\TwoCubeGreyAll%
+\TwoFaceUp{X}{X}%
+ {Y}{X}%
+\TwoFaceBack XY XX
+\TwoFaceRight XY XX%
+\TwoFaceFront XY XX%
+\ShowCube{2cm}{0.7}{\NoSidebar{X}\DrawTwoFaceUS}%
+\TwoRotation{\allyellow}%
+\quad\SequenceBraceA{AllYellow}{\ShowSequence{}{\Two}{\SequenceLong}}%
+\quad$\longrightarrow$\quad%
+\ShowCube{1.5cm}{0.7}{\NoSidebar{X}\DrawTwoFaceUS}%
+\hfil%
+\end{verbatim}
+\end{quote}
+
+\bigskip
\begin{center}
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf b/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf
index 053ffaa6822..ffd3a312b3b 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatterns.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf
index f80c1f7344a..aad724979b4 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh
index 8e101ad176d..4aa4a07ae4a 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.sh
@@ -1,5 +1,6 @@
## rubikpatternsLIST.sh
+## rubik bundle v5.0, 2018
## run twice to get hyperref-links correct
pdflatex --shell-escape rubikpatternsLIST.tex
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex
index fc7a677b51d..56f6663ae97 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex
+++ b/Master/texmf-dist/doc/latex/rubik/rubikpatternsLIST.tex
@@ -1,29 +1,19 @@
+%%
%% rubikpatternsLIST.tex
-%% part of the rubikpatterns package v 4.0
+%% part of the rubikpatterns package v5.0
%% authors: RWD Nickalls & A Syropoulos
-%% 03 March 2017
+%% 25 February 2018
+%% Rubik bundle v5.0
%%------------------------
-%% this file uses the rubikrotation package
+%% this file requires the rubikrotation and rubkpatterns packages
%% run this file as : $ pdflatex --shell-escape rubikpatternsLIST.tex
%%------------------------
\documentclass[a4paper]{article}
-%------LUA-----------
-\usepackage{ifluatex}
-
-\ifluatex
- \usepackage{shellesc} %% for use with LUAlatex
- \usepackage{fontspec}
-\else
-\fi
-%--------------------
-
-
\usepackage{tikz}
-\usepackage{rubikcube}
-\usepackage{rubikrotation}
-\usepackage{rubikpatterns}
+\usepackage{rubikcube,rubikrotation,rubikpatterns}
+
%--------------------------
\usepackage{url,ifpdf}
%---------------------
@@ -38,12 +28,13 @@
pdfkeywords={Rubik cube LaTeX}
}
\fi
-%%-------------------
-%-------------
+%%------------------
\pagestyle{myheadings}
-\markright{\texttt{rubikpatternsLIST.pdf} \ \
-(Rubik bundle v4.0, March 03, 2017) }
+\markright{\texttt{rubikpatternsLIST.pdf} \ (Rubik bundle v5.0) \ \texttt{www.ctan.org/pkg/rubik}}
%-------------------------------------
+%% need to use a negthinspace $\!$ before \ShowSequence
+%% to adjust for the first [ char in the cs string
+%% this makes the first line align correctly
\newcommand{\ShowPattern}[1]{%
\noindent%
\RubikCubeSolvedWB
@@ -51,13 +42,10 @@
\ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}
\hspace{0.5cm}% was 1cm
\begin{minipage}{9cm}
-\noindent\ShowSequence{,\ }{\texttt}{\SequenceShort},
+\noindent$\!$\ShowSequence{,\ }{\texttt}{\SequenceShort},
\newline\noindent\texttt{\SequenceInfo}.
\end{minipage}
}
-%-------------------------
-
-
%======================
\begin{document}
@@ -66,25 +54,23 @@
\ifpdf\pdfbookmark[1]{Title}{Title}\fi
\title{List of Rubik patterns\\%
\smallskip\normalsize\texttt{www.ctan.org/tex-archives/macros/latex/contrib/rubik/rubikpatternsLIST.pdf}%
-\footnote{This file is part of the Rubik bundle. To generate this file,
-use the following command:
+\footnote{This file is part of the Rubik bundle v5.0, 2018.
+To generate this file, use the following command:
\newline \texttt{\$ pdflatex --shell-escape rubikpatternsLIST.tex}}}
\author{RWD Nickalls\,\footnote{email: \textsf{dick@nickalls.org}}%
\ \ \& A Syropoulos\,\footnote{email: \textsf{asyropoulos@yahoo.com}}}
-\date{March 03, 2017 (v4.0)}
+\date{25 February 2018 (Rubik bundle v5.0)}
\maketitle
%==========================================
\section{Rubik patterns}
-
-
A Rubik pattern is the configuration generated by a sequence of rotations
(or `moves') from some initial starting configuration (typically a `solved'
-configuration). For example, `sixspot' is a well known pattern generated from
-a solved Rubik cube by the rotation sequence \texttt{U,Dp,R,Lp,F,Bp,U,Dp}, as follows:
-
+configuration). For example, `sixspot' is a well known pattern generated
+from a solved Rubik cube by the rotation sequence
+ \texttt{U,Dp,R,Lp,F,Bp,U,Dp}, as follows:
\bigskip
@@ -98,7 +84,6 @@ a solved Rubik cube by the rotation sequence \texttt{U,Dp,R,Lp,F,Bp,U,Dp}, as
\bigskip
-
\medskip
{\noindent}The code for this image is as follows:
@@ -120,16 +105,16 @@ a solved Rubik cube by the rotation sequence \texttt{U,Dp,R,Lp,F,Bp,U,Dp}, as
\end{quote}
-Note that the appearance of a pattern generated by a given rotation sequence is,
-of course, sensitive to (a)~the particular colour configuration of the solved
+Note that the appearance of a pattern generated by a given
+rotation sequence is, of course, sensitive to
+(a)~the particular colour configuration of the solved
cube used, and (b)~the initial orientation of the cube.
-
-The initial condition associated with all the pattern images shown in this
-document is the solved form of the `WB' colour configuration
-(White opposite Blue), since this is the solved cube colour configuration used
-by the Reid website, from which nearly all these patterns are drawn.
-
+The initial condition associated with all the pattern images
+shown in this document is the solved form of the `WB' colour
+configuration (White opposite Blue), since this is the solved
+cube colour configuration used by the Reid website, from which
+nearly all these patterns are drawn.
The following image shows the WB cube form (set up using the command
\verb!\RubikCubeSolvedWB!) displayed in a semi-flat (SF) mode
@@ -139,12 +124,9 @@ The following image shows the WB cube form (set up using the command
\bigskip
\RubikCubeSolvedWB%
- \ShowCube{2cm}{0.5}{\DrawRubikCubeSF}%
-
-\medskip
-{\noindent}The code for this image is as follows:
-
-\begin{quote}
+ \ShowCube{5cm}{0.5}{\DrawRubikCubeSF}%
+\hspace{3mm}%
+\begin{minipage}{5cm}
\begin{verbatim}
\usepackage{tikz}
\usepackage{rubikcube,rubikrotation}
@@ -152,21 +134,23 @@ The following image shows the WB cube form (set up using the command
\RubikCubeSolvedWB%
\ShowCube{2cm}{0.5}{\DrawRubikCubeSF}%
\end{verbatim}
-\end{quote}
-
-
-
-
+\end{minipage}
+%====================
\section{Typesetting}
-The remainder of this document just displays the various patterns made available
- with the \textsc{rubikpatterns} package.
-We display the patterns using the following \verb!\ShowPattern! command, which
-uses the \verb!\RubikRotation! command (from the \textsc{rubikrotation} package),
-and takes the pattern macro-name as the argument:
-This command draws the cube from the right-upper (RU) viewpoint, and shows the
-rotation sequence and metadata.
+The remainder of this document just displays the various patterns
+made available with the \textsc{rubikpatterns} package. We display
+the patterns using the following \verb!\ShowPattern! command, which
+uses the \verb!\RubikRotation! command (from the \textsc{rubikrotation}
+package), and takes the pattern macro-name as the argument:
+This command draws the cube from the right-upper (RU) viewpoint,
+and shows the rotation sequence and metadata.
+
+Note that since each sequence starts with a \verb![name],! we include
+a negative thin space (\verb[$\![) just before the \verb!\ShowSequence!
+command to adjust the position of the narrow initial \verb![! character
+ in order to align it correctly with the subsequent line.
\begin{verbatim}
%----------------------------------------
@@ -180,17 +164,16 @@ rotation sequence and metadata.
\ShowCube{2.4cm}{0.6}{\DrawRubikCubeRU}
\hspace{0.5cm}%
\begin{minipage}{9cm}
-\noindent\ShowSequence{,\ }{\texttt}{\SequenceShort},
+\noindent$\!$\ShowSequence{,\ }{\texttt}{\SequenceShort},
\newline\noindent\texttt{\SequenceInfo}.
\end{minipage}
}
%------------------------------------------
\end{verbatim}
-\pagebreak
-For example, the first pattern below (Pons Asinorum) is typeset using the following
-command:
+For example, the first pattern below (Pons Asinorum) is typeset
+using the following command:
\begin{verbatim}
\bigskip\ShowPattern{\ponsasinorum}
@@ -277,21 +260,16 @@ command:
\section{References}
\begin{itemize}
-\item Fridrich website (Fridrich J). \ \ \url{http://www.ws.binghamton.edu/fridrich/}
+\item Fridrich website (Fridrich J).
+\ \ \url{http://www.ws.binghamton.edu/fridrich/}
See the `Pretty patterns' webpage
\url{http://www.ws.binghamton.edu/fridrich/ptrns.html}
-
-
\item Kociemba website (Kociemba H). \url{http://www.kociemba.org/cube.htm}
{\newline}---for superflip see: \url{http://www.kociemba.org/math/oh.htm}
-
-
\item Randelshofer website (Randelshofer W). Pretty patterns. \url{http://www.randelshofer.ch/rubik/patterns/U080.01.html}
-
-
\item Reid patterns web page (Reid M).
\url{http://www.cflmath.com/~reid/Rubik/patterns.html}
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotation.1 b/Master/texmf-dist/doc/latex/rubik/rubikrotation.1
index c3c8c655b02..17a03ab2e01 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotation.1
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrotation.1
@@ -1,12 +1,12 @@
-.\" copyright (c) 2014--2017 A Syropoulos and RWD Nickalls
+.\" copyright (c) 2014--2018 A Syropoulos and RWD Nickalls
.\" rubikrotation.1
.\" place this file in: /usr/share/man/man1/
..
.TH rubikrotation.1
.SH NAME
-.B rubikrotation (v4.0)
+.B rubikrotation (v5.0)
.SH AUTHORS
-A. Syropoulos and R.W.D. Nickalls (3rd March 2017)
+A. Syropoulos and R.W.D. Nickalls (25 February 2018)
dick[at]<nickalls><org>
asyropoulos[at]<yahoo><com>
@@ -14,11 +14,13 @@ A. Syropoulos and R.W.D. Nickalls (3rd March 2017)
.SH DESCRIPTION
.B rubikrotation
-is a Perl script for processing Rubik cube rotations. It is part of the LaTeX rubikrotation package, and is typically CALLed by rubikrotation.sty. See the package manual for full details (type at the commandline: texdoc rubikrotation). Both the rubikrotation and rubikcube packages are part of the LaTeX Rubik `bundle'. The latest version can be downloaded from
+is a Perl script for processing Rubik cube rotations (3x3x3 and 2x2x2). It is part of the LaTeX rubikrotation package, and is typically CALLed by rubikrotation.sty, in response to the RubikRotation{} command: see the package manual (rubikrotation.pdf) for details. The rubikrotation package is part of the LaTeX Rubik `bundle'. The latest version can be downloaded from
.PP
CTAN: mirror.ctan.org/macros/latex/contrib/rubik/
.PP
-rubikrotation reads Rubik configuration data and instructions from an input file, and writes the new configuration data to an output file. The input and output filenames can be specified as command-line arguments (see: command-line use).
+rubikrotation reads Rubik state data and commands (sequence of rotations) from an input file, and writes the new state data to an output file. The input and output filenames can be specified as command-line arguments (see: command-line use).
+
+If a configuration file exists (rubikrotation.cfg) then it will be automatically be read by rubikrotation.sty.
.SH COMMAND-LINE USE
rubikrotation [-h|--help|-v|--version] [-o <outfile>] -i <infile>
@@ -26,6 +28,9 @@ rubikrotation [-h|--help|-v|--version] [-o <outfile>] -i <infile>
.B -h
displays the help info and exits.
+.B -v
+displays the version info and exits.
+
.B -i
defines the input filename.
The default input filename set by the rubikrotation package is rubikstate.dat, and this is generated by the LaTeX RubikRotation{} command (see the rubikrotation LaTeX package manual rubikrotation.pdf). Note that the rubikrotation perl script expects the input file to have a certain structure, as described in rubikrotation.pdf and rubikrotationPL.pdf).
@@ -43,6 +48,8 @@ To view rubikrotationPL.pdf, type: texdoc rubikrotationPL
To view rubikcube.pdf, type: texdoc rubikcube
+To view rubiktwocube.pdf, type: texdoc rubiktwocube
+
To view rubikexamples.pdf, type: texdoc rubikexamples
To view rubikpatterns.pdf, type: texdoc rubikpatterns
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf
index 13274cb9571..f7fbd7db061 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrotation.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf b/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf
index 0065929b066..c94465bd1a7 100644
--- a/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf
+++ b/Master/texmf-dist/doc/latex/rubik/rubikrotationPL.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubiktwo-doc-figA.pdf b/Master/texmf-dist/doc/latex/rubik/rubiktwo-doc-figA.pdf
new file mode 100644
index 00000000000..59f451f3497
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubiktwo-doc-figA.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/rubik/rubiktwocube.pdf b/Master/texmf-dist/doc/latex/rubik/rubiktwocube.pdf
new file mode 100644
index 00000000000..f00d979c2f0
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/rubik/rubiktwocube.pdf
Binary files differ