summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/logicpuzzle/killersudoku.sty
blob: 5283184faa4bac28b56874aab44efbef01c717ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
%%
%% Copyright (C) 2013 by:
%% Josef Kleber
%% <josef.kleber@gmx.de>
%%
%% This file 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
%% 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "author-maintained".
%%
%% The Current Maintainer of this work is Josef Kleber.
%%
%% This work consists of all files listed in manifest.txt.
%%
%
\ProvidesPackage{killersudoku}[2013/04/12 killersudoku.sty v1.0 - Josef Kleber (C) 2013]%
%
\RequirePackage{logicpuzzle}%
%
\newcommand*\LP@KSDK@init@prefix{LP@KSDK}%
\newcommand*\LP@KSDK@init@package{killersudoku}%
%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{rows}{5}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{columns}{5}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{scale}{1}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{counterstyle}{none}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{bgcolor}{}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{width}{5.1cm}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{cvoffset}{-23pt}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{title}{}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{titleindent}{0cm}%
\LP@define@key{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{titlewidth}{5.1cm}%
\LP@define@choicekey@fontsize{\LP@KSDK@init@prefix}{\LP@KSDK@init@package}{Large}%
%
\ExecuteOptionsX{rows,columns,width,fontsize,scale,bgcolor,cvoffset,counterstyle,title,titleindent,titlewidth}%
%
\ProcessOptionsX\relax%
%
\LP@init@counter{\LP@KSDK@init@prefix}%
%
\let\killersudokucell\setcell%
%
\newcommand*\killersudokusetup[1]%
{%
  \setkeys{killersudoku.sty}{#1}%
}%
%
\newenvironment{killersudoku}[1][]%
{%
  \setkeys{killersudoku}{#1}%
  \LP@set@package{killersudoku}%
  \LP@set@env@prefix{LP@KSDK}%
  \setcounter{LP@KSDK@rows}{\LP@KSDK@rows}%
  \setcounter{LP@KSDK@columns}{\LP@KSDK@columns}%
  \stepcounter{LP@KSDK@rows}%
  \stepcounter{LP@KSDK@columns}%
  \begin{minipage}[t]{\LP@KSDK@width}%
    \ifthenelse{\equal{\LP@KSDK@title}{}}%
    {\par\enspace\par}% empty
    {\enspace\par\noindent\hspace{\LP@KSDK@titleindent}\parbox{\LP@KSDK@titlewidth}{\strut\LP@titleformat\LP@KSDK@title}\vspace{3mm}\par}%
    \begin{tikzpicture}[scale=\LP@KSDK@scale]%
      \LP@drawbackground{1}{1}{\LP@KSDK@columns}{\LP@KSDK@rows}{\LP@KSDK@bgcolor}%
      \LP@drawgrid{1}{1}{\LP@KSDK@columns}{\LP@KSDK@rows}{1cm}%
}%
{%
    \end{tikzpicture}%
    \LP@drawcounter{\LP@KSDK@counterstyle}%
    \stepcounter{LP@puzzlecounter}%
  \end{minipage}%
}%
%
\endinput%