%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%
% This is file 'skeyval-view-pokayoke1.tex', version 1.3, 2013/02/22.      %
%                                                                          %
% This package and accompanying files may be distributed and/or            %
% modified under the conditions of the LaTeX Project Public License,       %
% either version 1.3 of this license or 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 LPPL maintenance status of this software is 'author-maintained'.     %
%                                                                          %
% This software is provided 'as it is', without warranty of any kind,      %
% either expressed or implied, including, but not limited to, the          %
% implied warranties of merchantability and fitness for a particular       %
% purpose.                                                                 %
%                                                                          %
% The following files constitute the skeyval bundle and must be            %
% distributed as a whole:                                                  %
%                                                                          %
%  README, skeyval.sty, skeyval-core.tex, skeyval-for.tex,                 %
%  skeyval-view.sty, skeyval-ltxpatch.sty, skeyval-ltxcmds.tex,            %
%  skeyval-pstkey.sty, skeyval-pstkey.tex, skeyval-testclass.cls,          %
%  skeyval-testpkg.sty, skeyval-pokayoke1, skeyval-pokayoke2,              %
%  skeyval-view-pokayoke1.                                                 %
%                                                                          %
% Copyright (c) 2010-2013 Ahmed Musa (amusa22@gmail.com).                  %
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%

\documentclass{skeyval-testclass}
\usepackage[tabulate,xcolor-options=dvipsnames]{skeyval-view}
\usetikzlibrary[topaths]

\makeatletter

\setupviewkeys{length of default=30}

\skvdefinekeys[KV]{fam1}[vhp@]{%
  .initialize keys after define,
  .ord/{keya,keya2}/default-a,
  .cmd/keyb,
  .zcmd/key c/\def\cmdc##1{##1}/
    \edef\y{\detokenize\expandafter{\vhp@keyc}}\def\x##1{#1*key c*##1},
  % No default for keyd:
  .choice/keyd/.na
    /{
      center.do=\def\x##1{#1*##1},
      left.do={\def\ans{#1}},
      right
    }
    /\def\z##1{#1*##1}
    /\@warning{Invalid value for keyd},
  .bool/show shadow/true,
  .zbool/show center/true/\edef\cmd{\ifvhp@showcenter Yes\else No\fi},
  .ord/keye,
  .cmd/keyf,
  .tog/keyg/true
}
\def\vald{left}
\skvaddslots[KV]{fam1}{stylekeya,stylekeyb}{keya=vala,keyb=valb}
  {key c=valc,keyd=.expanded{\vald}}[defaults-a&b]{\def\y##1{#1*##1}}

% Define some keys:
\directkeys*{
  .prefix=KV,
  .family=fam2,
  .holder prefix=hp@,
  .initialize keys after define,
  .define keys={%
    .ord/keya,
    .ord/galaxy/Messier 51a/\def\constellation{Canes Venatici},
    .choice/planet/Earth/{Earth.do=\def\x##1{#1*##1},Mars,Jupiter},
    .bool/space travel/true,
    .cmd/astronaut/Yuri Gagarin/
      \edef\x{\ifx\hp@astronaut\@empty Neil Armstrong\else\hp@astronaut\fi},
    .ord/space observatory/Hubble Space Telescope/
      \def\father{Lyman Spitzer~(1914--1997)},
  },
}

\makeatother

\begin{document}

\title{The \texttt{\textcolor{blue}{skeyval-view}} Package\\[.25ex]
  Version 1.1a\\[1ex]
  \textsf{Test document}}
\author{Ahmed Musa}
\maketitle

\skvviewkeys{%
  .show={
    family=fam1,
    color=blue
  },
  .show={
    families={fam1,fam2},
    only those with default=true,
    write to file=\jobname.skvv,
    show labels=true,
    show wlabels=true,
  },
  .show={
    family=fam1,
    only those with default=[none],
    show labels=true,
    color=cyan,
  },
  .show={
    families={fam1,fam2},
    only those without default=true,
    color=purple,
  },
  .show={
    family=fam2,
    columns={prefix,family,key type,default},
    color=teal
  },
  .show={
    only those in family=fam2,
    columns={family,type,default}
  },
  .show={
    only those in families={fam1,fam2},
    columns={prefix,family,type,default},
    color=magenta
  }
}

\newpage

\skvtestcnt0\relax
\skvrecurse
  \advance\skvtestcnt1\relax
  \vskip\baselineskip\noindent
  \textcolor{blue!\the\numexpr10*\skvtestcnt!red!%
  \the\numexpr100/\skvtestcnt}{%
    The play was a great success, but the audience was a disaster.
    \endgraf{\small Oscar Wilde, 1854--1900}
  }%
\while
  \ifnum\skvtestcnt<8\relax
\fi

% Credit: Quintin Jean-Noël
\newcount\mycount
\begin{center}
\begin{tikzpicture}[scale=.5,transform shape]
\newforeach \nr in {1,...,8}{
  \mycount=\numexpr(\nr-1)*45\relax
  \node[draw,circle,inner sep=0.25cm] (N-\nr) at (\the\mycount:5.4cm) {};
}
\newforeach \nr in {9,...,16}{
  \mycount=\numexpr(\nr-1)*45+22\relax
  \node[draw,circle,inner sep=0.25cm] (N-\nr) at (\the\mycount:5.4cm) {};
}
\newforeach \nr in {1,...,15}{
  \mycount=\numexpr\nr+1\relax
  \newforeach \nra in {\the\mycount,...,16}{
    \path (N-\nr) edge[->,bend right=3] (N-\nra) edge[<-,bend left=3]
      (N-\nra);
  }
}
\end{tikzpicture}
\end{center}


\bigskip
Find more information about the \textcolor{red}{\texttt{show shadow}} option on page~\pageref{KV/fam1/show shadow}.

\end{document}

% End of file skeyval-view-pokayoke1.tex
