From db952596f9303b8c5f81d8cabbb87220c06308cc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 10 Mar 2013 22:26:40 +0000 Subject: logicpuzzle (10mar13) git-svn-id: svn://tug.org/texlive/trunk@29328 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/logicpuzzle/bokkusu.sty | 7 +- .../tex/latex/logicpuzzle/logicpuzzle.sty | 86 ++++++- .../texmf-dist/tex/latex/logicpuzzle/skyline.sty | 262 +++++++++++++++++++++ 3 files changed, 345 insertions(+), 10 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty (limited to 'Master/texmf-dist/tex/latex/logicpuzzle') diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty b/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty index 27857baaedc..f7712888537 100644 --- a/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty +++ b/Master/texmf-dist/tex/latex/logicpuzzle/bokkusu.sty @@ -20,7 +20,7 @@ %% This work consists of all files listed in manifest.txt. %% % -\ProvidesPackage{bokkusu}[2013/02/28 bokkusu.sty v1.0 - Josef Kleber (C) 2013]% +\ProvidesPackage{bokkusu}[2013/03/09 bokkusu.sty v1.1 - Josef Kleber (C) 2013]% % \RequirePackage{logicpuzzle}% % @@ -209,6 +209,11 @@ % \ProcessOptionsX\relax% % +\let\valueH\LP@bottomrow% +\let\valueV\LP@leftcolumn% +\let\sumH\LP@toprow% +\let\sumV\LP@rightcolumn% +% \newcommand*\bokkususetup[1]% {% \setkeys{bokkusu.sty}{#1}% 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 diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty b/Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty new file mode 100644 index 00000000000..9cb2ae6bc8a --- /dev/null +++ b/Master/texmf-dist/tex/latex/logicpuzzle/skyline.sty @@ -0,0 +1,262 @@ +%% +%% Copyright (C) 2013 by: +%% Josef Kleber +%% +%% +%% 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{skyline}[2013/03/09 skyline.sty v1.0 - Josef Kleber (C) 2013]% +% +\RequirePackage{logicpuzzle}% +% +% options +\newcommand*\SL@width{6.7cm}% +\newcommand*\SL@fontsize\Large% +\newcommand*\SL@rows{5}% +\newcommand*\SL@columns{5}% +\newcommand*\SL@scale{1}% +\newcommand*\SL@bgcolor{}% +\newcommand*\SL@sudoku{false}% +\newcommand*\SL@cvoffset{-39pt}% +\newcommand*\SL@title{}% +\newcommand*\SL@titleindent{0.75cm}% +\newcommand*\SL@titlewidth{5.85cm}% +% +\newcounter{SL@rows}% +\newcounter{SL@columns}% +% +\setcounter{SL@rows}{\SL@rows}% +\setcounter{SL@columns}{\SL@columns}% +\stepcounter{SL@rows}% +\stepcounter{SL@columns}% +% +\define@key{skyline.sty}{rows}[5]% +{% + \renewcommand*\SL@rows{#1}% +}% +% +\define@key{skyline.sty}{columns}[5]% +{% + \renewcommand*\SL@columns{#1}% +}% +% +\define@choicekey*{skyline.sty}{sudoku}[\SL@sudoku\nr]{true,false}[true]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@sudoku{true}% + \renewcommand*\SL@rows{9}% + \renewcommand*\SL@columns{9}% + \or% + \renewcommand*\SL@sudoku{false}% + \fi% +}% +% +\define@key{skyline.sty}{scale}[1]% +{% + \renewcommand*\SL@scale{#1}% +}% +% +\define@key{skyline.sty}{counterstyle}[none]% +{% + \renewcommand*\LP@counterstyle{#1}% +}% +% +\define@key{skyline.sty}{bgcolor}[]% +{% + \renewcommand*\SL@bgcolor{#1}% +}% +% +\define@choicekey*{skyline.sty}{fontsize}[\SL@fontsize\nr]{tiny,scriptsize,footnotesize,small,normalsize,large,Large,LARGE,huge,Huge}[Large]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@fontsize{\tiny}% + \or% + \renewcommand*\SL@fontsize{\scriptsize}% + \or% + \renewcommand*\SL@fontsize{\footnotesize}% + \or% + \renewcommand*\SL@fontsize{\small}% + \or% + \renewcommand*\SL@fontsize{\normalsize}% + \or% + \renewcommand*\SL@fontsize{\large}% + \or% + \renewcommand*\SL@fontsize{\Large}% + \or% + \renewcommand*\SL@fontsize{\LARGE}% + \or% + \renewcommand*\SL@fontsize{\huge}% + \or% + \renewcommand*\SL@fontsize{\Huge}% + \fi% +}% +% +\define@key{skyline.sty}{width}[6.7cm]% +{% + \renewcommand*\SL@width{#1}% +}% +% +\define@key{skyline.sty}{title}[]% +{% + \renewcommand*\SL@title{#1}% +}% +% +\define@key{skyline.sty}{cvoffset}[-39pt]% +{% + \renewcommand*\SL@cvoffset{#1}% +}% +% +\define@key{skyline.sty}{titleindent}[0.75cm]% +{% + \renewcommand*\SL@titleindent{#1}% +}% +% +\define@key{skyline.sty}{titlewidth}[5.85cm]% +{% + \renewcommand*\SL@titlewidth{#1}% +}% +% +\define@key{skyline}{rows}% +{% + \renewcommand*\SL@rows{#1}% +}% +% +\define@key{skyline}{columns}% +{% + \renewcommand*\SL@columns{#1}% +}% +% +\define@choicekey*{skyline}{sudoku}[\SL@sudoku\nr]{true,false}[true]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@sudoku{true}% + \renewcommand*\SL@rows{9}% + \renewcommand*\SL@columns{9}% + \or% + \renewcommand*\SL@sudoku{false}% + \fi% +}% +% +\define@key{skyline}{scale}% +{% + \renewcommand*\SL@scale{#1}% +}% +% +\define@key{skyline}{bgcolor}% +{% + \renewcommand*\SL@bgcolor{#1}% +}% +% +\define@key{skyline}{counterstyle}% +{% + \renewcommand*\LP@counterstyle{#1}% +}% +% +\define@choicekey*{skyline}{fontsize}[\SL@fontsize\nr]{tiny,scriptsize,footnotesize,small,normalsize,large,Large,LARGE,huge,Huge}[Large]% +{% + \ifcase\nr\relax% + \renewcommand*\SL@fontsize{\tiny}% + \or% + \renewcommand*\SL@fontsize{\scriptsize}% + \or% + \renewcommand*\SL@fontsize{\footnotesize}% + \or% + \renewcommand*\SL@fontsize{\small}% + \or% + \renewcommand*\SL@fontsize{\normalsize}% + \or% + \renewcommand*\SL@fontsize{\large}% + \or% + \renewcommand*\SL@fontsize{\Large}% + \or% + \renewcommand*\SL@fontsize{\LARGE}% + \or% + \renewcommand*\SL@fontsize{\huge}% + \or% + \renewcommand*\SL@fontsize{\Huge}% + \fi% +}% +% +\define@key{skyline}{width}% +{% + \renewcommand*\SL@width{#1}% +}% +% +\define@key{skyline}{title}% +{% + \renewcommand*\SL@title{#1}% +}% +% +\define@key{skyline}{cvoffset}% +{% + \renewcommand*\SL@cvoffset{#1}% +}% +% +\define@key{skyline}{titleindent}% +{% + \renewcommand*\SL@titleindent{#1}% +}% +% +\define@key{skyline}{titlewidth}% +{% + \renewcommand*\SL@titlewidth{#1}% +}% +% +\ExecuteOptionsX{rows,columns,width,fontsize,scale,bgcolor,cvoffset,counterstyle,title,titleindent,titlewidth}% +% +\ProcessOptionsX\relax% +% +\let\skylineB\LP@bottomrow% +\let\skylineT\LP@toprow% +\let\skylineL\LP@leftcolumn% +\let\skylineR\LP@rightcolumn% +\let\skylinecell\setcell% +% +\newcommand*\skylinesetup[1]% +{% + \setkeys{skyline.sty}{#1}% +}% +% +\newenvironment{skyline}[1][]% +{% + \setkeys{skyline}{#1}% + \LP@set@package{skyline}% + \LP@set@env@prefix{SL}% + \setcounter{SL@rows}{\SL@rows}% + \setcounter{SL@columns}{\SL@columns}% + \stepcounter{SL@rows}% + \stepcounter{SL@columns}% + \begin{minipage}[t]{\SL@width}% + \ifthenelse{\equal{\SL@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\SL@titleindent}\parbox{\SL@titlewidth}{\strut\LP@titleformat\SL@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\SL@scale]% + \LP@drawbackground{1}{1}{\SL@columns}{\SL@rows}{\SL@bgcolor}% + \LP@drawgrid{1}{1}{\SL@columns}{\SL@rows}{1cm}% + \ifthenelse{\equal{\SL@sudoku}{true}}% + {\LP@drawsudokugrid}% + {}% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% +\endinput% \ No newline at end of file -- cgit v1.2.3