summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-18 22:14:40 +0000
committerKarl Berry <karl@freefriends.org>2013-05-18 22:14:40 +0000
commit6461e1333300fc749eb8fdd85714f3649021b413 (patch)
treee13b806b100d9a07e03f7c15fb5fce205eb8c3f6 /Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
parent68fd46249f6c3eff8a7cb4fee28daf640265585b (diff)
logicpuzzle (18may13)
git-svn-id: svn://tug.org/texlive/trunk@30558 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.sty191
1 files changed, 180 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty
index d16df95b6c8..e2800f154dd 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/05/10 logicpuzzle.sty v2.1 - Josef Kleber (C) 2013]%
+\ProvidesPackage{logicpuzzle}[2013/05/17 logicpuzzle.sty v2.2 - Josef Kleber (C) 2013]%
%
\RequirePackage{xkeyval}%
\RequirePackage{ifthen}%
@@ -27,7 +27,7 @@
\RequirePackage{etoolbox}%
\RequirePackage{marginnote}%
\RequirePackage{tikz}%
-\usetikzlibrary{decorations.pathmorphing,calc}%
+\usetikzlibrary{decorations.pathmorphing,calc,shapes.geometric}%
\pgfdeclarelayer{LPdump}%
\pgfdeclarelayer{LPbgcolor}%
\pgfdeclarelayer{LPbackgroundtwo}%
@@ -65,6 +65,7 @@
\def\LP@normallines{0.5pt}%
\def\LP@thicklines{1.5pt}%
\def\LP@grid@linestyle{}%
+\def\LP@draw@opacity{1}%
\def\LP@rel@tikzpath{}%
%
\newcommand*\LP@Pfive{.5}%
@@ -168,6 +169,7 @@
\definecolor{LP@c@tunnel}{rgb}{.7,.7,.7}%
\definecolor{LP@c@tunnel@i}{rgb}{.8,.8,.8}%
\definecolor{LP@c@tunnel@ii}{rgb}{.5,.5,.5}%
+\LP@definecolor{LP@c@bridge}{1,0,0}%
%
% drawing grids
%
@@ -182,7 +184,7 @@
\setcounter{LP@countii}{#4}% max row
\stepcounter{LP@counti}%
\stepcounter{LP@countii}%
- \draw[step=#5,line width=\LP@normallines,\LP@grid@linestyle] (#1,#2) grid (\value{LP@counti},\value{LP@countii});%
+ \draw[step=#5,line width=\LP@normallines,\LP@grid@linestyle,draw opacity=\LP@draw@opacity] (#1,#2) grid (\value{LP@counti},\value{LP@countii});%
}%
%
\newcommand*\LP@drawgriddots%
@@ -201,14 +203,14 @@
}%
\newcommand*\LP@drawsudokugrid%
{%
- \draw[line width=\LP@thicklines] (1,1) -- (1,10);%
- \draw[line width=\LP@thicklines] (4,1) -- (4,10);%
- \draw[line width=\LP@thicklines] (7,1) -- (7,10);%
- \draw[line width=\LP@thicklines] (10,1) -- (10,10);%
- \draw[line width=\LP@thicklines] (1,1) -- (10,1);%
- \draw[line width=\LP@thicklines] (1,4) -- (10,4);%
- \draw[line width=\LP@thicklines] (1,7) -- (10,7);%
- \draw[line width=\LP@thicklines] (1,10) -- (10,10);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (1,1) -- (1,10);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (4,1) -- (4,10);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (7,1) -- (7,10);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (10,1) -- (10,10);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (1,1) -- (10,1);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (1,4) -- (10,4);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (1,7) -- (10,7);%
+ \draw[line width=\LP@thicklines,draw opacity=\LP@draw@opacity] (1,10) -- (10,10);%
}%
%
% drawing grid background
@@ -509,6 +511,42 @@
};%
}%
%
+\newcommand*\bridgesrow[2]%
+{%
+ \setcounter{LP@counti}{1}%
+ \setcounter{LP@countii}{#1}%
+ \LP@set@LP@fontsize{\LP@env@prefix}%
+ \LP@set@LP@color{\LP@env@prefix}%
+ \foreach \LP@element in {#2}%
+ {%
+ \ifthenelse{\equal{\LP@element}{}}%
+ {}%
+ {%
+ \draw[fill=\LP@color] (\arabic{LP@counti},\arabic{LP@countii}) circle (0.5cm);%
+ \node[scale=\LP@scale,font=\LP@fontsize] at (\arabic{LP@counti},\arabic{LP@countii}){\LP@element};%
+ }%
+ \stepcounter{LP@counti}%
+ };%
+}%
+%
+\newcommand*\bridgescolumn[2]%
+{%
+ \setcounter{LP@counti}{#1}%
+ \setcounter{LP@countii}{1}%
+ \LP@set@LP@fontsize{\LP@env@prefix}%
+ \LP@set@LP@color{\LP@env@prefix}%
+ \foreach \LP@element in {#2}%
+ {%
+ \ifthenelse{\equal{\LP@element}{}}%
+ {}%
+ {%
+ \draw[fill=\LP@color] (\arabic{LP@counti},\arabic{LP@countii}) circle (0.5cm);%
+ \node[scale=\LP@scale,font=\LP@fontsize] at (\arabic{LP@counti},\arabic{LP@countii}){\LP@element};%
+ }%
+ \stepcounter{LP@countii}%
+ };%
+}%
+%
\newcommand*\fillcell[2]%
{%
\LP@set@LP@scale{\LP@env@prefix}%
@@ -914,6 +952,137 @@
%
\let\Diamond\LP@Diamond%
%
+\newcommand*\LP@Star%
+{%
+ \tikz\node[shape=star,fill=yellow,draw,scale=.8*\LP@scale,star point height=.25cm] {};%
+}%
+%
+\let\Star\LP@Star%
+%
+\newcommand*\LP@ArrowA[2][red]%
+{%
+ \LP@set@LP@scale{\LP@env@prefix}%
+ \pgfmathsetmacro{\LPlinewidth}{3pt*\LP@scale}%
+ \tikz\draw[->,line width=\LPlinewidth,rotate=#2,scale=\LP@scale,color=#1] (0.1,.5) -- (0.9,.5);%
+}%
+%
+\newcommand*\LP@c@stararrow{red}%
+\newcommand*\Right{\LP@ArrowA[\LP@c@stararrow]{0}}%
+\newcommand*\RightUp{\LP@ArrowA[\LP@c@stararrow]{45}}%
+\newcommand*\Up{\LP@ArrowA[\LP@c@stararrow]{90}}%
+\newcommand*\LeftUp{\LP@ArrowA[\LP@c@stararrow]{135}}%
+\newcommand*\Left{\LP@ArrowA[\LP@c@stararrow]{180}}%
+\newcommand*\LeftDown{\LP@ArrowA[\LP@c@stararrow]{225}}%
+\newcommand*\Down{\LP@ArrowA[\LP@c@stararrow]{270}}%
+\newcommand*\RightDown{\LP@ArrowA[\LP@c@stararrow]{315}}%
+%
+\newcommand*\LP@DarkCloud{\tikz[scale=0.7*\LP@scale]\fill[color=black!60] (0,0) rectangle (1,1);}%
+%
+\newcommand*\LP@Moon{\tikz[scale=0.7*\LP@scale]\fill[color=black!60] (0,0) circle (0.5cm);}%
+%
+\newcommand*\LP@MoonR%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=black!60] (0.5,0.5) circle (0.5cm);%
+ \fill[color=yellow] (.5,0) arc (270:450:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonL%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=black!60] (0.5,0.5) circle (0.5cm);%
+ \fill[color=yellow] (.5,0) arc (270:90:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonT%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=black!60] (0.5,0.5) circle (0.5cm);%
+ \fill[color=yellow] (0,0.5) arc (180:0:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonB%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=black!60] (0.5,0.5) circle (0.5cm);%
+ \fill[color=yellow] (0,0.5) arc (180:360:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonTL%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=yellow] (0.5,0.5) circle (0.5cm);%
+ \fill[color=black!60] (1,.5) -- (.5,.5) -- (.5,0) arc (270:360:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonBL%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=yellow] (0.5,0.5) circle (0.5cm);%
+ \fill[color=black!60] (1,.5) -- (.5,.5) -- (.5,1) arc (90:0:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonBR%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=yellow] (0.5,0.5) circle (0.5cm);%
+ \fill[color=black!60] (0,.5) -- (.5,.5) -- (.5,1) arc (90:180:.5);%
+ \end{tikzpicture}%
+}%
+%
+\newcommand*\LP@MoonTR%
+{%
+ \begin{tikzpicture}[scale=0.7*\LP@scale]%
+ \fill[color=yellow] (0.5,0.5) circle (0.5cm);%
+ \fill[color=black!60] (0,.5) -- (.5,.5) -- (.5,0) arc (270:180:.5);%
+ \end{tikzpicture}%
+}%
+%
+\let\Cloud\LP@DarkCloud%
+\let\Moon\LP@Moon%
+\let\MoonR\LP@MoonR%
+\let\MoonL\LP@MoonL%
+\let\MoonT\LP@MoonT%
+\let\MoonB\LP@MoonB%
+\let\MoonTL\LP@MoonTL%
+\let\MoonBL\LP@MoonBL%
+\let\MoonBR\LP@MoonBR%
+\let\MoonTR\LP@MoonTR%
+%
+\define@key{LP@Line}{double}[double]%
+{%
+ \def\LP@Line@double{double}%
+}%
+%
+\define@key{LP@Line}{color}[LP@c@bridge]%
+{%
+ \def\LP@Line@linecolor{#1}%
+}%
+%
+\newcommand*\LP@Line[2][]%
+{%
+ \def\LP@Line@double{}%
+ \def\LP@Line@linecolor{LP@c@bridge}%
+ \setkeys{LP@Line}{#1}%
+ \LP@set@LP@scale{\LP@env@prefix}%
+ \begin{pgfonlayer}{LPbackgroundtwo}%
+ \ifthenelse{\equal{\LP@Line@double}{double}}%
+ {\draw[double,double distance=.1cm*\LP@scale,color=\LP@Line@linecolor, line width=.1cm*\LP@scale] #2;}%
+ {\draw[color=\LP@Line@linecolor, line width=.1cm*\LP@scale] #2;}%
+ \end{pgfonlayer}%
+}%
+%
+\newcommand*\bridge[2][]%
+{%
+ \LP@Line[#1]{#2}%
+}%
+%
% get package options with prefix
%
\newcommand*\LP@set@LP@scale[1]%