summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/gene/crossword/cwpuzzle.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/gene/crossword/cwpuzzle.dtx')
-rw-r--r--macros/latex/contrib/gene/crossword/cwpuzzle.dtx63
1 files changed, 35 insertions, 28 deletions
diff --git a/macros/latex/contrib/gene/crossword/cwpuzzle.dtx b/macros/latex/contrib/gene/crossword/cwpuzzle.dtx
index 3442440ea4..c7c64db2ea 100644
--- a/macros/latex/contrib/gene/crossword/cwpuzzle.dtx
+++ b/macros/latex/contrib/gene/crossword/cwpuzzle.dtx
@@ -1,7 +1,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\filename{cwpuzzle.dtx}
-\def\fileversion{1.9}
-\def\filedate{2014/01/12}
+\def\fileversion{1.10}
+\def\filedate{2020/05/23}
\let\docversion=\fileversion
\let\docdate=\filedate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -19,11 +19,11 @@
%%
%%
%% Author: Gerd Neugebauer
-%% Im Lerchelsöhl 5
-%% 64521 Groß-Gerau
+%% Im Lerchels\"ohl 5
+%% 64521 Gro\ss-Gerau
%% Mail: gene@gerd-neugebauer.de
%%
-%% Copyright (c) 1995-2014 Gerd Neugebauer
+%% Copyright (c) 1995-2020 Gerd Neugebauer
%%
%% cwpuzzle.dtx is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY. No author or distributor accepts
@@ -35,10 +35,6 @@
%% cwpuzzle.dtx, provided this copyright notice is preserved and
%% any modifications are indicated.
%%
-%%
-%% This style is still under development and may be replaced with a
-%% new version which provides an enhanced functionality.
-%%
%<*driver>
\documentclass{ltxdoc}
\usepackage{xcolor}
@@ -77,8 +73,8 @@
% \DoNotIndex{\hfill,\if,\ifx,\large,\let,\makebox,\mbox,\newcommand}
% \DoNotIndex{\newcount,\newdimen,\newenvironment,\newif,\noindent}
% \DoNotIndex{\normalsize,\null,\par,\put,\raggedright,\raggedleft}
-% \DoNotIndex{\relax,\renewcommand,\RequirePackage,\rm,\rule}
-% \DoNotIndex{\scriptsize,\sf,\small,\textsf,\textwidth}
+% \DoNotIndex{\relax,\renewcommand,\RequirePackage,\rm,\rmfamily,\rule}
+% \DoNotIndex{\scriptsize,\sf,\sffamily,\small,\textsf,\textwidth}
% \DoNotIndex{\the,\tiny,\unitlength,\uppercase,\xdef,\ProvidesPackage}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -568,7 +564,7 @@
% \begin{minipage}{.65\textwidth}\small
% \begin{verbatim}
% \definecolor{gray}{gray}{.9}
-% \PuzzleDefineColorCell{g}{gray}
+% \PuzzleDefineColorCell{c}{gray}
% \begin{Puzzle}{2}{2}
% |{} |[1][cf]X |.
% |[2][c]X |{} |.
@@ -577,7 +573,7 @@
% \end{minipage}\hfill
% \begin{minipage}{.30\textwidth}
% \definecolor{gray}{gray}{.9}
-% \PuzzleDefineColorCell{g}{gray}
+% \PuzzleDefineColorCell{c}{gray}
% \begin{Puzzle}{2}{2}
% |{} |[1][cf]X |.
% |[2][c]X |{} |.
@@ -598,9 +594,10 @@
% default it is typeset in a mini-page of the appropriate width
% centered horizontally and vertically.
%
+% \changes{1.10}{2020/05/23}{Font changing macros modernized}
% \begin{verbatim}
% \begin{Puzzle}{8}{6}
-% \Frame{2}{2}{4}{2}{\sf Crossword\\Puzzle}
+% \Frame{2}{2}{4}{2}{\sffamily Crossword\\Puzzle}
% |[1]E|* |[2]N |U |L |[3]L |* |[4]V|.
% |[5]T|[6]R|I |A |N |G |[7]L|E |.
% |A |U |{} |{} |{} |{} |[8]C|C |.
@@ -613,7 +610,7 @@
% \PuzzleUnsolved\noindent
% \begin{minipage}{.5\textwidth}\PuzzleUnitlength=18pt
% \begin{Puzzle}{8}{6}%
-% \Frame{2}{2}{4}{2}{\sf Crossword\\Puzzle}%
+% \Frame{2}{2}{4}{2}{\sffamily Crossword\\Puzzle}%
% |[1]E|* |[2]N|U|L|[3]L|* |[4]V|.
% |[5]T|[6]R|I|A|N|G|[7]L|E|.
% |A|U|{}|{}|{}|{}|[8]C|C|.
@@ -769,7 +766,7 @@
% to switch to solution mode. Then all numbers are shown. The
% parameters to modify the appearance of a puzzle work here as well. \medskip
%
-% {\PuzzleSolution\PuzzleUnitlength=14pt\footnotesize\sf
+% {\PuzzleSolution\PuzzleUnitlength=14pt\sffamily\footnotesize
% \begin{Sudoku}
% | 7|*2| 4| 1| 3| 5| 6|*9| 8|.
% |*3| 8|*1|*9| 7|*6|*5| 4|*2|.
@@ -811,7 +808,7 @@
% \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
+% \PuzzleSolution\PuzzleUnitlength=14pt\sffamily\footnotesize
% \begin{Sudoku}
% | 7|*2| 4| 1| 3| 5| 6|*9| 8|.
% |*3| 8|*1|*9| 7|*6|*5| 4|*2|.
@@ -882,7 +879,7 @@
% \begin{minipage}{.25\textwidth}
% {\PuzzleSolution
% \PuzzleUnitlength=14pt
-% \footnotesize\sf
+% \sffamily\footnotesize
% \begin{Kakuro}{6}{9}
% | - |<:13> |<:37> | - |<:41> |<:7> | - |.
% |<4:> |* 3 | 1 |<14:> | 8 | 6 | - |.
@@ -899,7 +896,7 @@
% \begin{verbatim}
% \PuzzleSolution
% \PuzzleUnitlength=14pt
-% \footnotesize\sf
+% \sffamily\footnotesize
% \begin{Kakuro}{6}{9}
% | - |<:13> |<:37>| - |<:41>|<:7> | - |.
% |<4:> |* 3 | 1 |<14:> | 8 | 6 | - |.
@@ -1191,16 +1188,18 @@
%
% The macro |\PuzzleFont| contains font changing
% commands issued before the puzzle is typeset.
+% \changes{1.10}{2020/05/23}{Font changing macros modernized}
% \begin{macrocode}
-\newcommand\PuzzleFont{\rm\normalsize}
+\newcommand\PuzzleFont{\rmfamily\normalsize}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PuzzleNumberFont}
% The macro |\PuzzleNumberFont| contains font changing
% commands issued before the numbers in a puzzle are typeset.
+% \changes{1.10}{2020/05/23}{Font changing macros modernized}
% \begin{macrocode}
-\newcommand\PuzzleNumberFont{\sf\scriptsize}
+\newcommand\PuzzleNumberFont{\sffamily\scriptsize}
% \end{macrocode}
% \end{macro}
%
@@ -1970,7 +1969,8 @@
\gdef\Sudoku{\begin{Puzzle}{9}{9}%
\let\Puzzle@pipe=|%
\def\PPa{\Puzzle@pipe[][fS]}%
- \def|##1{\ifx##1*\let\next\PPa\else\Puzzle@pipe{##1}\let\next\relax\fi\next}
+ \def|##1{\ifx##1*\let\next\PPa\else
+ \Puzzle@pipe{##1}\let\next\relax\fi\next}
}
\endgroup
% \end{macrocode}
@@ -2014,8 +2014,9 @@
% The macro |\KakuroNumberFont| is used to typeset the hints, i.e.
% the horizontal and vertical sums.
% \changes{1.8}{2009/09/13}{New}
+% \changes{1.10}{2020/05/23}{Font changing macros modernized}
% \begin{macrocode}
-\newcommand\KakuroNumberFont{\sf\tiny}
+\newcommand\KakuroNumberFont{\sffamily\tiny}
% \end{macrocode}
% \end{macro}
%
@@ -2023,6 +2024,7 @@
% The macro |\Kakuro@cell| is used to typeset the cells. It
% analyzes the argument and acts accordingly.
% \changes{1.8}{2009/09/13}{New}
+% \changes{1.10}{2020/05/23}{Font changing macros modernized}
% \begin{macrocode}
\def\Kakuro@cell#1{%
\ifx#1. \def\next{\Puzzle@pipe.}%
@@ -2059,12 +2061,16 @@
\def\Kakuro@hint#1:#2>{%
\def\x{#2}%
\ifx\x\empty\else
- \put(\Puzzle@X,\Puzzle@Y){\makebox(1,.8)[r]{\parbox{.95\unitlength}{\raggedright\KakuroNumberFont
+ \put(\Puzzle@X,\Puzzle@Y){%
+ \makebox(1,.8)[r]{\parbox{.95\unitlength}{%
+ \raggedright\KakuroNumberFont
$\blacktriangledown$\\#2}}}
\fi
\def\x{#1}%
\ifx\x\empty\else
- \put(\Puzzle@X,\Puzzle@Y){\makebox(1,1.2){\parbox{.95\unitlength}{\raggedleft\KakuroNumberFont
+ \put(\Puzzle@X,\Puzzle@Y){%
+ \makebox(1,1.2){\parbox{.95\unitlength}{%
+ \raggedleft\KakuroNumberFont
#1 $\blacktriangleright$\\\mbox{}}}}
\fi
\Puzzle@pipe[][\KakuroHintType]{ }}%
@@ -2138,6 +2144,7 @@
% Now, that everything is in place we can arrange some package
% options.
% \changes{1.6}{2006/08/12}{Several style options defined}
+% \changes{1.10}{2020/05/23}{Font changing macros modernized}
% \begin{macrocode}
\DeclareOption{numbered}{\Puzzle@SolutionNumberedtrue}
\DeclareOption{nocenter}{\let\PuzzlePre=\relax
@@ -2145,11 +2152,11 @@
\DeclareOption{unboxed}{\let\PuzzleCluePre=\relax
\let\PuzzleCluePost=\relax}
\DeclareOption{normalsize}{\PuzzleUnitlength=20pt
- \def\PuzzleFont{\rm\normalsize}}
+ \def\PuzzleFont{\rmfamily\normalsize}}
\DeclareOption{small}{\PuzzleUnitlength=16pt
- \def\PuzzleFont{\rm\small}}
+ \def\PuzzleFont{\rmfamily\small}}
\DeclareOption{large}{\PuzzleUnitlength=24pt
- \def\PuzzleFont{\rm\large}}
+ \def\PuzzleFont{\rmfamily\large}}
\DeclareOption{german}{%
\renewcommand\PuzzleWordsText[1]{Worte der L\"ange #1: }%
\renewcommand\PuzzleLettersText{Benutzte Buchstaben: }%