diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/crossword/cwpuzzle.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/crossword/cwpuzzle.dtx | 78 |
1 files changed, 69 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/crossword/cwpuzzle.dtx b/Master/texmf-dist/source/latex/crossword/cwpuzzle.dtx index efd2c7d27ac..3442440ea4f 100644 --- a/Master/texmf-dist/source/latex/crossword/cwpuzzle.dtx +++ b/Master/texmf-dist/source/latex/crossword/cwpuzzle.dtx @@ -1,10 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% $Id: cwpuzzle.dtx,v 1.8 2009/09/13 08:32:34 gene Exp gene $ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\CWP@RCS$#1: #2 #3${#2} \def\filename{cwpuzzle.dtx} -\xdef\fileversion{\CWP@RCS$Revision: 1.8 $} -\xdef\filedate{\CWP@RCS$Date: 2009/09/13 08:32:34 $} +\def\fileversion{1.9} +\def\filedate{2014/01/12} \let\docversion=\fileversion \let\docdate=\filedate %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -26,7 +23,7 @@ %% 64521 Groß-Gerau %% Mail: gene@gerd-neugebauer.de %% -%% Copyright (C) 1995-2009 Gerd Neugebauer +%% Copyright (c) 1995-2014 Gerd Neugebauer %% %% cwpuzzle.dtx is distributed in the hope that it will be useful, %% but WITHOUT ANY WARRANTY. No author or distributor accepts @@ -44,7 +41,7 @@ %% %<*driver> \documentclass{ltxdoc} -\usepackage{color} +\usepackage{xcolor} \usepackage{cwpuzzle} \EnableCrossrefs \CodelineIndex @@ -89,7 +86,7 @@ % \changes{1.3}{1996/10/28}{First public release.} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \CheckSum{637} +% \CheckSum{640} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -785,6 +782,52 @@ % | 1|*5| 7| 3| 6| 2| 4|*8| 9|. % \end{Sudoku}} % +% Since the characters in the solution are numbers only we can use +% the following definition to colorize the cells in the solution. +% +% \begin{verbatim} +% \def\PuzzleSolutionContent#1{\fboxsep=0pt +% \def\myColor{}% +% \ifcase#1 +% \def\myColor{white}%0 +% \or\def\myColor{red}%1 +% \or\def\myColor{green}%2 +% \or\def\myColor{yellow}%3 +% \or\def\myColor{orange}%4 +% \or\def\myColor{lime}%5 +% \or\def\myColor{purple}%6 +% \or\def\myColor{violet}%7 +% \or\def\myColor{teal}%8 +% \or\def\myColor{brown}%9 +% \else\def\myColor{white}%* +% \fi +% \colorbox{\myColor}{\makebox(1,1){#1}}} +% \end{verbatim} +% +% With the help of the package \textsf{xcolor} for the predefined +% colors we get the following output: \medskip +% +% {\def\PuzzleSolutionContent#1{\fboxsep=0pt +% \def\myColor{}\ifcase#1 +% \def\myColor{white}\or\def\myColor{red}\or\def\myColor{green}\or\def\myColor{yellow}\or\def\myColor{orange}\or\def\myColor{lime}\or\def\myColor{purple}\or\def\myColor{violet}\or\def\myColor{teal}\or\def\myColor{brown}\else\def\myColor{white}\fi +% \colorbox{\myColor}{\makebox(1,1){#1}}} +% \PuzzleSolution\PuzzleUnitlength=14pt\footnotesize\sf +% \begin{Sudoku} +% | 7|*2| 4| 1| 3| 5| 6|*9| 8|. +% |*3| 8|*1|*9| 7|*6|*5| 4|*2|. +% | 9| 6| 5|*8| 2|*4| 1| 3| 7|. +% | 2|*9| 6| 7| 1| 8| 3|*5| 4|. +% |*5| 1| 8|*2| 4|*3| 9| 7|*6|. +% | 4|*7| 3| 6| 5| 9| 8|*2| 1|. +% | 6| 3| 9|*4| 8|*7| 2| 1| 5|. +% |*8| 4|*2|*5| 9|*1|*7| 6|*3|. +% | 1|*5| 7| 3| 6| 2| 4|*8| 9|. +% \end{Sudoku}} +% +% Note that this definition has to be restricted to a local block +% if you have solutions for other puzzle types in the same +% document. +% % % \subsection{Kakuro} % @@ -1053,6 +1096,11 @@ % This macro contains the content of a cell during formatting this % cell. This enables the cell formating macro to access it. % +% \DescribeMacro{\PuzzleSolutionContent} +% This macro processes the letter in solution mode. It takes one +% argument, the letter. This macro can be redefinied to achieve +% special effects for the solution. +% % \DescribeMacro{\SudokuLinethickness} % This macro contains the thickness of the thick lines in a sudoku. % @@ -1065,6 +1113,7 @@ % hint. It can be used to redefine the appearance. % % +% % \section{Further Plans} % % \subsection{General} @@ -1406,6 +1455,7 @@ % should be typeset in ``solution'' mode. The arguments are evaluated % and the appropriate type of box typeset or other actions performed. % \changes{1.5}{2006/08/10}{Reimplemented to cope with two optional arguments.} +% \changes{1.9}{2014/01/12}{Macro PuzzleSolutionContent introduced as extension point} % \begin{macrocode} \newcommand\Puzzle@Box@@solution@[2][f]{% \def\Puzzle@tmp{#2}% @@ -1419,7 +1469,7 @@ \Puzzle@Cell@Loop *#1{}% \else \Puzzle@Cell@Loop #1{}% - \put(\Puzzle@X,\Puzzle@Y){\makebox(1,1){\uppercase{#2}}}% + \put(\Puzzle@X,\Puzzle@Y){\PuzzleSolutionContent{#2}}% \fi \fi \def\Puzzle@tmp{#1}% @@ -1434,6 +1484,16 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\PuzzleSolutionContent} +% The macro |\PuzzleSolutionContent| procees the character in +% solution mode. Per default it converts the argument to upper +% caseand sets it in a box of size $1\times1$. +% \changes{1.9}{2014/01/12}{Macro PuzzleSolutionContent introduced as extension point} +% \begin{macrocode} +\def\PuzzleSolutionContent#1{\makebox(1,1){\uppercase{#1}}} +% \end{macrocode} +% \end{macro} +% % \subsection{Predefined Cell Types} % In this section a series of frame types are defined. % |