summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-03-10 22:26:40 +0000
committerKarl Berry <karl@freefriends.org>2013-03-10 22:26:40 +0000
commitdb952596f9303b8c5f81d8cabbb87220c06308cc (patch)
tree868c220f6025a022274a939da896f674b4baab57 /Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
parentce491a1586dcdd7e3389230d2c83044fcec07b4b (diff)
logicpuzzle (10mar13)
git-svn-id: svn://tug.org/texlive/trunk@29328 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty')
-rw-r--r--Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty86
1 files changed, 77 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
index 47fb93c326a..1d2fa7358fb 100644
--- a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
+++ b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
@@ -19,7 +19,7 @@
%%
%% This work consists of all files listed in manifest.txt.
%%
-\ProvidesPackage{logicpuzzle}[2013/02/28 logicpuzzle.sty v1.1 - Josef Kleber (C) 2013]%
+\ProvidesPackage{logicpuzzle}[2013/03/09 logicpuzzle.sty v1.2 - Josef Kleber (C) 2013]%
%
\RequirePackage{xkeyval}%
\RequirePackage{ifthen}%
@@ -28,6 +28,9 @@
\RequirePackage{marginnote}%
\RequirePackage{tikz}%
\usetikzlibrary{decorations.pathmorphing}%
+\pgfdeclarelayer{LPbackground}
+\pgfdeclarelayer{LPforeground}
+\pgfsetlayers{LPbackground,main,LPforeground}
%
\newcounter{LP@counti}%
\newcounter{LP@countii}%
@@ -47,6 +50,7 @@
\gdef\LP@columns{}%
\gdef\LP@scale{1}%
\gdef\LP@color{black}%
+\gdef\LP@fontsize\Large%
\gdef\LP@cvoffset{0pt}%
%
\newcommand*\LP@Pfive{.5}%
@@ -95,6 +99,18 @@
\draw[step=#5] (#1,#2) grid (\value{LP@counti},\value{LP@countii});%
}%
%
+\newcommand*\LP@drawsudokugrid%
+{%
+ \draw[ultra thick] (1,1) -- (1,10);
+ \draw[ultra thick] (4,1) -- (4,10);
+ \draw[ultra thick] (7,1) -- (7,10);
+ \draw[ultra thick] (10,1) -- (10,10);
+ \draw[ultra thick] (1,1) -- (10,1);
+ \draw[ultra thick] (1,4) -- (10,4);
+ \draw[ultra thick] (1,7) -- (10,7);
+ \draw[ultra thick] (1,10) -- (10,10);
+}%
+%
% #1 grid x min
% #2 grid y min
% #3 grid x max
@@ -142,6 +158,11 @@
\stepcounter{LP@counti}%
}%
%
+\newcommand*\setrow[2]%
+{%
+ \LP@setrowcontents{#2}{1}{#1}%
+}%
+%
% #1 csv list
% #2 column
% #3 row
@@ -163,32 +184,47 @@
\stepcounter{LP@countii}%
}%
%
-\newcommand*\valueH[1]%
+\newcommand*\setcolumn[2]%
+{%
+ \LP@setrowcontents{#2}{#1}{1}%
+}%
+%
+\newcommand*\setcell[3]%
+{%
+ \LP@set@LP@scale{\LP@env@prefix}%
+ \LP@set@LP@fontsize{\LP@env@prefix}%
+ \LP@set@LP@rows{\LP@env@prefix}%
+ \LP@set@LP@columns{\LP@env@prefix}%
+ \LP@ingrid{#1}{#2}{\LP@columns}{\LP@rows}{\LP@package}%
+ \LP@setcellcontent{#1}{#2}{\LP@fontsize#3}%
+}%
+%
+\newcommand*\LP@bottomrow[1]%
{%
\LP@setrowcontents{#1}{1}{0}%
}%
%
-\newcommand*\valueV[1]%
+\newcommand*\LP@leftcolumn[1]%
{%
\LP@setcolumncontents{#1}{0}{1}%
}%
%
-\newcommand*\sumH[1]%
+\newcommand*\LP@toprow[1]%
{%
- \sumH@i{#1}{\LP@env@prefix}%
+ \LP@toprow@i{#1}{\LP@env@prefix}%
}%
%
-\newcommand*\sumH@i[2]%
+\newcommand*\LP@toprow@i[2]%
{%
\LP@setrowcontents{#1}{1}{\csname the#2@rows\endcsname}%
}%
%
-\newcommand*\sumV[1]%
+\newcommand*\LP@rightcolumn[1]%
{%
- \sumV@i{#1}{\LP@env@prefix}%
+ \LP@rightcolumn@i{#1}{\LP@env@prefix}%
}%
%
-\newcommand*\sumV@i[2]%
+\newcommand*\LP@rightcolumn@i[2]%
{%
\LP@setcolumncontents{#1}{\csname the#2@columns\endcsname}{1}%
}%
@@ -293,6 +329,12 @@
\expandafter\xdef\expandafter\LP@cvoffset{\csname #1@cvoffset\endcsname}%
}%
%
+\newcommand*\LP@set@LP@fontsize[1]%
+{%
+ % can't expand \Large
+ \expandafter\gdef\expandafter\LP@fontsize{\csname #1@fontsize\endcsname}%
+}%
+%
\newcommand*\LP@set@env@prefix[1]%
{%
\gdef\LP@env@prefix{#1}%
@@ -303,4 +345,30 @@
\gdef\LP@package{#1}%
}%
%
+\newcommand*\framearea[2]%
+{%
+ \draw[ultra thick,color=#1] #2;
+}%
+%
+\newcommand*\fillarea[2]%
+{%
+ \draw[ultra thick,fill=#1] #2 ;
+}%
+%
+\newenvironment{puzzlebackground}%
+{%
+ \begin{pgfonlayer}{LPbackground}%
+}%
+{%
+ \end{pgfonlayer}%
+}%
+%
+\newenvironment{puzzleforeground}%
+{%
+ \begin{pgfonlayer}{LPforeground}%
+}%
+{%
+ \end{pgfonlayer}%
+}%
+%
\endinput% \ No newline at end of file