diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-23 22:23:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-23 22:23:48 +0000 |
commit | ae7524f53f8c6f75067ee684e1566d1cee110b6b (patch) | |
tree | cd01837fc675bc22a270b7e0d5f54613b0963603 | |
parent | f6cdffa509c8082653ba4c7946ae899e368a0333 (diff) |
logicpuzzle (21apr13)
git-svn-id: svn://tug.org/texlive/trunk@30087 c570f23f-e606-0410-a88d-b1316a301751
14 files changed, 1139 insertions, 35 deletions
diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES b/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES index 1a30dd1c245..3e9a4baae9f 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES +++ b/Master/texmf-dist/doc/latex/logicpuzzle/CHANGES @@ -1,12 +1,29 @@ +== Logicpuzzle bundel (v1.9) == + +-- slitherlink.sty (v1.0) -- + +15/04/2013 added slitherlink.sty [jk] + +-- laserbeam.sty (v1.0) -- + +17/04/2013 added laserbeam.sty + +-- logicpuzzle.sty (v1.9) -- + +17/04/2013 added \placecross, \placemirror, \placearrow [jk] + +15/04/2013 added \setbigcell, \setgridlinestyle, [jk] + \setnormallinewidth, \setthicklinewidth + == Logicpuzzle bundel (v1.8) == -- killersudoku.sty (v1.0) -- -09/04/2013 added ddsudoku.sty [jk] +09/04/2013 added killersudoku.sty [jk] -- kendoku.sty (v1.0) -- -09/04/2013 added hitori.sty +09/04/2013 added kendoku.sty -- battleship.sty (v1.4a) -- diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/README b/Master/texmf-dist/doc/latex/logicpuzzle/README index 43733748dbd..01d8e4df68a 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/README +++ b/Master/texmf-dist/doc/latex/logicpuzzle/README @@ -11,24 +11,20 @@ puzzles. At the moment the following puzzles are supported: Square Wisdom, Sukendo, Caldoku, ...) * Killer Sudoku (aka Samunapure, Sum Number Place, Sumdoku, Gebietssummen, ...) +* Laser Beam (aka Laserstrahl, ...) * Skyline (aka Skycrapers, Wolkenkratzer, Hochhäuser, ...) incl. Skyline Sudoku and Skyline Sudoku (N*N) variants +* Slitherlink (aka Fences, Number Line, Dotty Dilemma, + Sli-Lin, Takegaki, Great Wall of China, + Loop the Loop, Rundweg, Gartenzaun, ...) * Sudoku License: LPPL -Changes in v1.8: +Changes in v1.9: -- added support for Kendoku puzzle - https://bitbucket.org/kleberj/logicpuzzle/wiki/Kendoku +- added support for Laser Beam puzzle + https://bitbucket.org/kleberj/logicpuzzle/wiki/LaserBeam -- added support for Killer Sudoku puzzle - https://bitbucket.org/kleberj/logicpuzzle/wiki/KillerSudoku - -- battleship.sty - - Bugfix: renamed counter LP@whiledo -> LP@whiledo@i - -- logicpuzzle.sty - - * added \tikzpath, \setrule and \colorarea +- added support for Slitherlink puzzle + https://bitbucket.org/kleberj/logicpuzzle/wiki/Slitherlink diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam.pdf b/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam.pdf Binary files differnew file mode 100644 index 00000000000..fc07b2e5d89 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam.pdf diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam.tex b/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam.tex new file mode 100644 index 00000000000..7e0fc53bd66 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam.tex @@ -0,0 +1,321 @@ +% pdflatex --shell-escape logo.tex +% run twice: 1. download qrcode.png 2. include the pic +% or download http://i.imgur.com/KAunnuS.png and rename it to qrcode.png +% +\documentclass[a4paper]{ltxdoc}% +\usepackage[english]{babel}% +\usepackage[latin1]{inputenc}% +\usepackage[T1]{fontenc}% +\usepackage{textcomp}% +\usepackage{lmodern}% +\usepackage{bera}% +\usepackage{ccicons} +\usepackage{microtype}% +\usepackage{ltxdocext}% +\usepackage{listings} +\usepackage{marginnote}% +\usepackage[svgnames,rgb]{xcolor}% +\usepackage[automark,nouppercase]{scrpage2} +\usepackage[width=4cm,scale=0.59]{laserbeam}% +\usepackage{hyperref} +% +\setlength{\headheight}{1.1\baselineskip}% +% +\AtBeginDocument{\IfFileExists{qrcode.png}{}{\write18{wget -O qrcode.png http://i.imgur.com/KAunnuS.png}}}% +\hypersetup{colorlinks=true,urlcolor=NavyBlue,linkcolor=NavyBlue,citecolor=CornflowerBlue,naturalnames=true,hypertexnames=false}% +\lstset{language=[LaTeX]TeX,numbers=left,numberstyle=\tiny,basicstyle=\ttfamily,frame=single,backgroundcolor=\color{LightGoldenrodYellow},keywordstyle=\color{Blue},emph={puzzlebackground,puzzleforeground,center,laserbeam,left,shape,fill,inner,sep,draw,rounded,corners,thick}, emphstyle=\color{Tomato},emph={[2]Wheat,HotPink,GreenYellow,LightBlue,LightSalmon,LightYellow,green,sudoku,rows,columns,scale},emphstyle={[2]\color{OliveDrab}},morekeywords={laser,mirrorH,,mirrorV,laserH,laserV,placemirror,placearrow,placecross,framepuzzle,setbigcell,setrule,tikzpath,colorarea,framearea,fillarea,laserbeamcell,setrow,LP@cvoffset,titleformat,definecounterstyle,marginnote,tikz,node,puzzlecounter,color,[,]}} +\makeatletter +\renewcommand{\maketitle}% +{% + \thispagestyle{empty}% + \pagecolor{Ivory}% + \begin{titlepage}% + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift=-2cm] at (current page.north west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle% + (\paperwidth,2cm);% + \draw[anchor=west,yshift=-4cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\RaggedRight\Huge\sffamily\textbf{\@title}}};% + \draw[anchor=west,yshift=-6cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\huge\sffamily\textbf{\@fileversion}}};% + \draw[anchor=west,yshift=-9cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\RaggedRight\huge\sffamily\textbf{\@subtitle}}};% + \draw[anchor=west,yshift=-13cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\usebox\logo};% + \draw[anchor=west,yshift=-17cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\huge\sffamily\textbf{\@date}}};% + \draw[anchor=west,yshift=-20cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\Large\sffamily{\@authorline\\\textbf{\@author}}}};% + \end{tikzpicture}% + };% + \node[yshift=0cm] at (current page.south west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=NavyBlue,color=NavyBlue,yshift=6cm,xshift=2cm] (0,0) rectangle (0.2cm,19cm);% + \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);% + \draw[anchor=west,yshift=1cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\large\sffamily{\@refline}}};% + \end{tikzpicture}% + };% + \end{tikzpicture}% + \end{titlepage}% + \pagecolor{white}% +}% +% +\newcommand*{\@tikzhead}[1]% +{% + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift=-2cm] at (current page.north west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);% + \draw[anchor=west,yshift=1cm,xshift=1.5cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\LARGE\sffamily\textbf{\@title}}};% + \node[anchor=east,xshift=.9\paperwidth,rectangle,% + rounded corners=15pt,inner sep=11pt,fill=NavyBlue]% + {\color{white}\textsc{#1}};% + \end{tikzpicture}% + };% + \end{tikzpicture}% +}% +\clearscrheadings% +\ihead{\@tikzhead{\headmark}}% +\cfoot{\upshape\thepage}% +\pagestyle{scrheadings}% +% +%\newcommand*{\headline}[1]{\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}% +\newcommand*{\Headline}[1]{\@mkboth{#1}{#1}}% +% +\renewcommand{\headfont}{\normalfont\mdseries\scshape} +% +\gdef\@subtitle{}% +\providecommand*{\Subtitle}[1]{\gdef\@subtitle{#1}}% +\gdef\@fileversion{}% +\providecommand*{\Fileversion}[1]{\gdef\@fileversion{#1}}% +\gdef\@author{}% +\providecommand*{\Author}[1]{\gdef\@author{#1}}% +\gdef\@authorline{Package author:}% +\providecommand*{\Authorline}[1]{\gdef\@authorline{#1}}% +\gdef\@refline{}% +\providecommand*{\Refline}[1]{\gdef\@refline{#1}}% +\gdef\and{\unskip{}, }% +\newcommand\doubledash{-\kern0.5pt-} +\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1em\leavevmode\llap{\makeenmark}} +\makeatother +% +\def\filename{laserbeam.sty}% +\def\XeLaTeX{Xe\LaTeX}% +% +\newenvironment{optionlist} +{\begin{trivlist}\setlength\leftskip{2em}} +{\end{trivlist}} +\newcommand\optitem[3]{\item [\texttt{\textbf{\textcolor{DodgerBlue}{#1}} \lbrack\textcolor{Crimson}{#2}\rbrack}] #3} +% +\makeatletter% +\renewcommand\tableofcontents% +{% + %\section*{\contentsname}% + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}% + \@starttoc{toc}% +}% +% +\newcommand\styleoption{\name@idx{style option}}% +\newcommand\stylename{\name@idx{document style}}% +\def\name@idx#1#2{% + {\ttfamily#2}% + \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}% +}% +\newcommand*\margcs[1]{\marginnote{\raggedleft\scriptsize #1}}% +\newcommand*\package[1]{\texttt{#1}\index{#1=\string\ttt{#1}}}% +\newcommand*\mco[1]{\mbox{\LANGLE\itshape#1\RANGLE}\index{#1, class option value}\index{class option value>#1}}% +% +\renewcommand\@biblabel[1]{\makebox[1.5cm][l]{[#1]}} +%\renewcommand*\l@subsection{\@dottedtocline{2}{1.2em}{2.8em}} +\renewcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.7em}} +\makeatother +% +\setlength\parindent{0pt}% +\hypersetup{pdfauthor={Josef Kleber},pdftitle={A style file for typesetting Laser Beam logic puzzles},pdfsubject={Documentation for LaTeX style \filename}}% +% +\begin{document} +\title{\filename}% +\Subtitle{A style file for typesetting Laser Beam logic puzzles}% +\author{Josef Kleber} +\Fileversion{v1.0} +\Refline{\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}\\\href{https://bitbucket.org/kleberj/logicpuzzle/}{\texttt{https://bitbucket.org/kleberj/logicpuzzle/}}} +\newsavebox\logo +\savebox\logo{% + \begin{laserbeam} + \laserV{1} + \laserH{{}} + \mirrorH{{},2} + \mirrorV{{},{},{},{},{},2} + \framepuzzle[LP@c@mirror] + \placearrow{3}{1}{LeftUp} + \placearrow{6}{4}{RightUp} + \placecross{3}{3} + \end{laserbeam} + \hspace{1cm} + \begin{laserbeam} + \laserV{1} + \laserH{{}} + \mirrorH{{},2} + \mirrorV{{},{},{},{},{},2} + \framepuzzle[LP@c@mirror] + \placearrow{3}{1}{LeftUp} + \placearrow{6}{4}{RightUp} + \placecross{3}{3} + \placemirror{2}{2}{V} + \placemirror{4}{2}{H} + \placemirror{5}{5}{V} + \placemirror{3}{5}{H} + \begin{puzzlebackground} + \laser{\tikzpath{3}{1}{7,9,9,9,7,1,7,1,3,3,3,9,9}} + \end{puzzlebackground} + \end{laserbeam} +} +\maketitle +\tableofcontents +\clearpage + +\section{The puzzle} +Draw a laser beam in each grid according to the following guidelines. The beam has to enter or to leave the grid at the arrows. At each intersection, a mirror, on which the laser beam must reflect on one side, can be placed horizontally or vertically. The other side must not be touched by the beam. All locations where the laser crosses are given. The numbers to the left and above the grid indicate how many cells are traversed by the beam in the corresponding row or column. The numbers to the right and below reveal, how many mirrors are found in the intersection of the corresponding row or column. Here's a little self-explanatory example: + +\begin{center} + \usebox\logo +\end{center} + +\bigskip +\begin{lstlisting} +\begin{center} + \begin{laserbeam} + \laserV{1} + \laserH{{}} + \mirrorH{{},2} + \mirrorV{{},{},{},{},{},2} + \framepuzzle[LP@c@mirror] + \placearrow{3}{1}{LeftUp} + \placearrow{6}{4}{RightUp} + \placecross{3}{3} + \end{laserbeam} + \hspace{1cm} + \begin{laserbeam} + \laserV{1} + \laserH{{}} + \mirrorH{{},2} + \mirrorV{{},{},{},{},{},2} + \framepuzzle[LP@c@mirror] + \placearrow{3}{1}{LeftUp} + \placearrow{6}{4}{RightUp} + \placecross{3}{3} + \placemirror{2}{2}{V} + \placemirror{4}{2}{H} + \placemirror{5}{5}{V} + \placemirror{3}{5}{H} + \begin{puzzlebackground} + \laser{\tikzpath{3}{1}{7,9,9,9,7,1,7,1,3,3,3,9,9}} + \end{puzzlebackground} + \end{laserbeam} +\end{center} +\end{lstlisting} +\lstset{basicstyle=\ttfamily\normalsize} + +\section{Options} +\begin{optionlist} + \optitem{\styleoption{rows}}{5}{defines the number of rows in the grid.} + \optitem{\styleoption{columns}}{5}{specifies the number of columns in the grid} + \optitem{\styleoption{width}}{6.5cm}{sets the width of the minipage, in which the grid is typeset.} + \optitem{\styleoption{scale}}{1}{scales the size of the grid in the minipage.} + \optitem{\styleoption{fontsize}}{Large}{specifies the size of the numbers next to the grid. Here, the usual \LaTeX\ sizes are used. Possible values: \texttt{tiny}, \texttt{scriptsize}, \texttt{footnotesize}, \texttt{small}, \texttt{normalsize}, \texttt{large}, \underline{\texttt{Large}}, \texttt{LARGE}, \texttt{huge}, \texttt{Huge}} + \optitem{\styleoption{title}}{}{sets the title of a puzzle.} + \optitem{\styleoption{titleindent}}{0cm}{defines the indent of the title.} + \optitem{\styleoption{titlewidth}}{6.5cm}{specifies the width of the box the title is set in.} + \optitem{\styleoption{bgcolor}}{}{sets the background color of the grid.} + \optitem{\styleoption{counterstyle}}{none}{defines the counter style. Predefined styles: none, left, right} + \optitem{\styleoption{cvoffset}}{-38pt}{sets the vertical offset of the counters in the margin.} +\end{optionlist} + +\section{Environments} +\subsection{\texttt{laserbeam}} +The \env{laserbeam} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{laserbeam}\oarg{options}\\\dots\\\enve{laserbeam}} is the central core of the style file. With the optional argument of the environment, you can reset the options with local scope. Here, a blank grid is created. +\subsection{\texttt{puzzlebackground}} +The \env{puzzlebackground} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{puzzlebackground}\\\dots\\\enve{puzzlebackground}} allows you to place elements behind the main layer. +\subsection{\texttt{puzzleforeground}} +The \env{puzzleforeground} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{puzzleforeground}\\\dots\\\enve{puzzleforeground}} allows you to place elements in front of the main layer. +\section{Commands} +\subsection{In the grid and around} +\subsubsection{\texttt{laserH}} +The command \cs{laserH}\margcs{\cmd\laserH\{\marg{csv list}\}} typesets the numbers above the grid indicating how many cells are traversed by the laser beam. It expects a comma-separated list as an argument. +\subsubsection{\texttt{laserV}} +The command \cs{laserV}\margcs{\cmd\laserV\{\marg{csv list}\}} typesets the numbers left to the grid. +\subsubsection{\texttt{mirrorH}} +The command \cs{mirrorH}\margcs{\cmd\mirrorH\{\marg{csv list}\}} typesets the numbers below the grid indicating how many mirrors are placed in the intersections of this column. +\subsubsection{\texttt{mirrorV}} +The command \cs{mirrorV}\margcs{\cmd\mirrorV\{\marg{csv list}\}} typesets the numbers right to the grid. +\subsubsection{\texttt{placearrow}} +The command \cs{placearrow}\margcs{\cmd\placearrow\{\marg{column}\}\{\marg{row}\}\\\{\marg{direction}\}} is used for the placement of arrows at the grid frame. The reference for coordinates is the bottom left corner of the cell. In the mandatory argument \marg{direction}, you can use the following indicators: LeftUp, LeftDown, RightUp, RightDown +\subsubsection{\texttt{placecross}} +With the command \cs{placecross}\margcs{\cmd\placecross\{\marg{column}\}\{\marg{row}\}} you can place a cross in the intersections of the grid. +\subsubsection{\texttt{placemirror}} +With the command \cs{placemirror}\margcs{\cmd\placemirror\{\marg{column}\}\{\marg{row}\}\\\{\marg{direction}\}} you can place mirrors in the intersections of the grid. In the mandatory argument \marg{direction}, you can use the following indicators: H, V +\subsubsection{\texttt{laser}} +The command \cs{laser}\margcs{\cmd\laser\oarg{color}\{\marg{\cmd\tikz\ path}\}} draws the laser beam given by \marg{\cmd\tikz\ path} with color \oarg{color} (default: red). The reference for coordinates is the bottom left corner of the cell. + +\begin{lstlisting} +\laser[green]{(1,2)--(2,3)--(1,4)} +\end{lstlisting} + +You should consider using this command in the \env{puzzlebackground} environment. + +\subsubsection{\texttt{tikzpath}} +With\margcs{\cmd\tikzpath\{\marg{column}\}\{\marg{row}\}\\\{\marg{csv list}\}} the \cmd\tikzpath\ command, you can easily construct a \cmd\tikz\ path. You just need to define a starting point \marg{column}\marg{row} (bottom left corner) and a \marg{csv list} with direction indicators relative to the current position. + +\begin{center} +\begin{tabular}{rlrlrl} +7: & up left & 8: & up & 9: & up right \\ +4: & left & 5: & no change & 6: & right \\ +1: & down left & 2: & down & 3: & down right \\ +\end{tabular} +\end{center} + +\begin{lstlisting} +\framearea{green}{\tikzpath{2}{2}{8,6,2,4}} +\end{lstlisting} + +This command will frame grid cell \texttt{(2,2)} green. +\subsubsection{\texttt{framepuzzle}} +With\margcs{\cmd\framepuzzle\oarg{color}} the \cmd\framepuzzle\ command, you can frame the grid (thicker line) with the color specified with the optional argument \oarg{color} (default: black). +\subsection{Presentation} +\subsubsection{\texttt{definecounterstyle}} +The command \cs{definecounterstyle}\margcs{\cmd\definecounterstyle\{\marg{name}\}\\\{\marg{definition}\}} allows you to define your own styles. For example, the style \texttt{left} is defined as follows: + +\begin{lstlisting} +\definecounterstyle{left}{ + \begingroup\reversemarginpar\marginnote{ + \tikz\node[shape=rectangle,fill=yellow!40,inner sep=7pt, + draw,rounded corners=3pt,thick] + {\Huge\puzzlecounter};}[\LP@cvoffset]\endgroup} +} +\end{lstlisting} + +To typeset the counter into the margin we use the command \cmd\marginnote. We need to use the command \cmd\reversemarginpar\ to set the counter into the left margin. Of course, we must use this command in a group for local scope. Finally we use \cmd\puzzlecounter\ in a \cmd\tikz\ node with a vertical offset set with the option \styleoption{cvoffset}. +\subsubsection{\texttt{puzzlecounter}} +The command \cs{puzzlecounter}\margcs{\cmd\puzzlecounter} provides the counter in textual form to use it for example in \cmd\definecounterstyle. +\subsubsection{\texttt{titleformat}} +With the command \cs{titleformat}\margcs{\cmd\titleformat\{\marg{format}\}}, you can define the format of the title. By default, the definition is as follows: + +\begin{lstlisting} +\titleformat{\centering\Large\color{blue}} +\end{lstlisting} +\subsection{Miscellaneous} +\subsubsection{\texttt{laserbeamsetup}} +With the command \cs{laserbeamsetup}\margcs{\cmd\laserbeamsetup\{\marg{options}\}} you can reset the options with global scope. +\subsubsection{\texttt{setpuzzlecounter}} +With the command \cs{setpuzzlecounter}\margcs{\cmd\setpuzzlecounter\{\marg{number}\}}, you can reset the puzzle counter, for example before the solutions. + +\section{Examples \& Solutions} +You\IfFileExists{qrcode.png}{\marginnote{\href{https://bitbucket.org/kleberj/logicpuzzle/}{\includegraphics[height=2cm]{qrcode.png}}}[-31pt]}{} can download application examples and their solutions from the \href{https://bitbucket.org/kleberj/logicpuzzle/}{project page}. The puzzles are originally licensed under \href{http://creativecommons.org/licenses/by-nc-sa/3.0/}{\ccbyncsa}. +\end{document} diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam_README b/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam_README new file mode 100644 index 00000000000..f9fcb0e8b06 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/laserbeam/laserbeam_README @@ -0,0 +1,11 @@ +The package enables the user to typeset Laser Beam logic puzzles +(aka Laserstrahl, ...). +Draw a laser beam in each grid according to the following guidelines. +The beam has to enter or to leave the grid at the arrows. At each +intersection, a mirror, on which the laser beam must reflect on one +side, can be placed horizontally or vertically. The other side must +not be touched by the beam. All locations where the laser crosses +are given. The numbers to the left and above the grid indicate how +many cells are traversed by the beam in the corresponding row or +column. The numbers to the right and below reveal, how many mirrors +are found in the intersection of the corresponding row or column. diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.pdf b/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.pdf Binary files differindex ae9450d91af..bd417dded6e 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.pdf +++ b/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.pdf diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.tex b/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.tex index eee20b9e3a7..b21a1845121 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.tex +++ b/Master/texmf-dist/doc/latex/logicpuzzle/logicpuzzle/logicpuzzle.tex @@ -26,7 +26,9 @@ \usepackage[width=4.5cm,scale=0.85]{hitori} \usepackage[width=4.5cm,scale=0.89]{kendoku} \usepackage[width=4.5cm,scale=0.89]{killersudoku} +\usepackage[width=4.5cm,scale=0.67]{laserbeam} \usepackage[width=4.5cm,scale=0.66]{skyline} +\usepackage[width=4.5cm,scale=0.85]{slitherlink} \usepackage[width=4.5cm,scale=0.49]{lpsudoku} \usepackage{hyperref} % @@ -199,7 +201,7 @@ \title{\filename}% \Subtitle{A style file for typesetting logic puzzles}% \author{Josef Kleber} -\Fileversion{v1.8} +\Fileversion{v1.9} \Refline{\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}\\\href{https://bitbucket.org/kleberj/logicpuzzle/}{\texttt{https://bitbucket.org/kleberj/logicpuzzle/}}} \newsavebox\logo \savebox\logo{% @@ -499,6 +501,37 @@ \setrow{1}{1,3,2,4} \end{killersudoku} \end{center} +\subsection{Laser Beam} +\begin{center} + \begin{laserbeam} + \laserV{1} + \laserH{{}} + \mirrorH{{},2} + \mirrorV{{},{},{},{},{},2} + \framepuzzle[LP@c@mirror] + \placearrow{3}{1}{LeftUp} + \placearrow{6}{4}{RightUp} + \placecross{3}{3} + \end{laserbeam} + \hspace{1.5cm} + \begin{laserbeam} + \laserV{1} + \laserH{{}} + \mirrorH{{},2} + \mirrorV{{},{},{},{},{},2} + \framepuzzle[LP@c@mirror] + \placearrow{3}{1}{LeftUp} + \placearrow{6}{4}{RightUp} + \placecross{3}{3} + \placemirror{2}{2}{V} + \placemirror{4}{2}{H} + \placemirror{5}{5}{V} + \placemirror{3}{5}{H} + \begin{puzzlebackground} + \laser{\tikzpath{3}{1}{7,9,9,9,7,1,7,1,3,3,3,9,9}} + \end{puzzlebackground} + \end{laserbeam} +\end{center} \subsection{Skyline} \begin{center} \begin{skyline} @@ -522,6 +555,31 @@ \setrow{1}{3,1,2,5,4} \end{skyline} \end{center} +\subsection{Slitherlink} +\begin{center} + \begin{slitherlink} + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \end{slitherlink} + \hspace{1.5cm} + \begin{slitherlink} + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \framearea{black}{\tikzpath{3}{1}{8,8,4,4,8,6,6,8,6,2,6,6,2,4,2,4,2,4}} + \end{slitherlink} +\end{center} \subsection{Sudoku} \begin{center} \begin{lpsudoku} @@ -715,10 +773,18 @@ With\margcs{\cmd\LP@drawbackground\{\marg{xmin}\}\\\{\marg{ymin}\}\{\marg{xmax}\ \label{sec:setcell} With\margcs{\cmd\setcell\{\{\marg{column}\}\{\marg{row}\}\\\{\marg{element}\}} the \cmd\setcell\ command, you can set \marg{element} into cell \marg{column}\marg{row} as central node. It is aware of the current values of the surrounding environment options \styleoption{rows}, \styleoption{columns}, \styleoption{scale} and \styleoption{fontsize}. Furthermore, a check if \marg{element} is within the grid is applied. +\paragraph{\texorpdfstring{\cs{setbigcell}}{\textbackslash setbigcell}} +\label{sec:setbigcell} +With\margcs{\cmd\setbigcell[\oarg{fontsize}]\{\{\marg{column}\}\\\{\marg{row}\}\{\marg{element}\}} the \cmd\setbigcell\ command, you can set \marg{element} into a big (\texttt{$2\times2$}) cell \marg{column}\marg{row} as central node. The optional argument \oarg{fontsize} is set to 'Huge' by default. + \paragraph{\texorpdfstring{\cs{LP@setcellcontent}}{\textbackslash LP@setcellcontent}} \label{sec:LPsetcellcontent} The\margcs{\cmd\LP@LP@setcellcontent\{\marg{column}\}\\\{\marg{row}\}\{\marg{element}\}} command \cmd\LP@setcellcontent\ is the generic command to set an arbitrary \marg{element}. +\paragraph{\texorpdfstring{\cs{LP@setcellcontentC}}{\textbackslash LP@setcellcontentC}} +\label{sec:LPsetcellcontentC} +The\margcs{\cmd\LP@LP@setcellcontentC\{\marg{column}\}\\\{\marg{row}\}\{\marg{element}\}} command \cmd\LP@setcellcontentC\ is the generic command to set an arbitrary \marg{element} in a centered node in the bottom left corner. + \paragraph{\texorpdfstring{\cs{setrow}}{\textbackslash setrow}} \label{sec:setrow} With\margcs{\cmd\setrow\{\marg{row}\}\{\marg{csv list}\}} the \cmd\setrow\ command, you can set the contents of a \marg{row}. These may be numbers or letters. @@ -872,6 +938,18 @@ The command \cs{definecounterstyle}\margcs{\cmd\definecounterstyle\{\marg{name}\ To typeset the counter into the margin we use the command \cmd\marginnote. We need to use the command \cmd\reversemarginpar\ to set the counter into the left margin. Of course, we must use this command in a group for local scope. Finally we use \cmd\puzzlecounter\ in a \cmd\tikz\ node with a vertical offset set with the option \styleoption{cvoffset}. +\paragraph{\texorpdfstring{\cs{setgridlinestyle}}{\textbackslash setgridlinestyle}} +\label{sec:setgridlinestyle} +The command \cs{setgridlinestyle}\margcs{\cmd\setgridlinestyle\{\marg{style}\}} sets the style of lines used in the grid. By default, the style is set to \texttt{solid}, whereas \package{slitherlink.sty} uses \texttt{dashed}. + +\paragraph{\texorpdfstring{\cs{setnormallinewidth}}{\textbackslash setnormallinewidth}} +\label{sec:setnormallinewidth} +With the command \cs{setnormallinewidth}\margcs{\cmd\setnormallinewidth\{\marg{dimension}\}}, you can set the width of the standard lines (default: \texttt{0.5pt}) + +\paragraph{\texorpdfstring{\cs{setthicklinewidth}}{\textbackslash setthicklinewidth}} +\label{sec:setthicklinewidth} +With the command \cs{setthicklinewidth}\margcs{\cmd\setthicklinewidth\{\marg{dimension}\}}, you can set the width of the 'thicker' lines (default: \texttt{1.5pt}) + \paragraph{\texorpdfstring{\cs{LP@drawcounter}}{\textbackslash LP@drawcounter}} \label{sec:LPdrawcounter} The command \cs{LP@drawcounter}\margcs{\cmd\LP@drawcounter\{\marg{name}\}} draws the counter with counter style \marg{name}. diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt b/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt index 2da23682451..582edab458d 100644 --- a/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt +++ b/Master/texmf-dist/doc/latex/logicpuzzle/manifest.txt @@ -12,8 +12,10 @@ hakyuu.sty hitori.sty kendoku.sty killersudoku.sty +laserbeam.sty lpsudoku.sty skyline.sty +slitherlink.sty -- bash scripts -- @@ -39,10 +41,14 @@ kendoku.pdf kendoku.tex killersudoku.pdf killersudoku.tex +laserbeam.pdf +laserbeam.tex lpsudoku.pdf lpsudoku.tex skyline.pdf skyline.tex +slitherlink.pdf +slitherlink.tex -- Misc. Files -- diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink.pdf b/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink.pdf Binary files differnew file mode 100644 index 00000000000..7a53a89ef9b --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink.pdf diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink.tex b/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink.tex new file mode 100644 index 00000000000..6b05fc6a553 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink.tex @@ -0,0 +1,324 @@ +% pdflatex --shell-escape logo.tex +% run twice: 1. download qrcode.png 2. include the pic +% or download http://i.imgur.com/KAunnuS.png and rename it to qrcode.png +% +\documentclass[a4paper]{ltxdoc}% +\usepackage[english]{babel}% +\usepackage[latin1]{inputenc}% +\usepackage[T1]{fontenc}% +\usepackage{textcomp}% +\usepackage{lmodern}% +\usepackage{bera}% +\usepackage{ccicons} +\usepackage{microtype}% +\usepackage{ltxdocext}% +\usepackage{listings} +\usepackage{marginnote}% +\usepackage[svgnames,rgb]{xcolor}% +\usepackage[automark,nouppercase]{scrpage2} +\usepackage{slitherlink}% +\usepackage{hyperref} +% +\setlength{\headheight}{1.1\baselineskip}% +% +\AtBeginDocument{\IfFileExists{qrcode.png}{}{\write18{wget -O qrcode.png http://i.imgur.com/KAunnuS.png}}}% +\hypersetup{colorlinks=true,urlcolor=NavyBlue,linkcolor=NavyBlue,citecolor=CornflowerBlue,naturalnames=true,hypertexnames=false}% +\lstset{language=[LaTeX]TeX,numbers=left,numberstyle=\tiny,basicstyle=\ttfamily,frame=single,backgroundcolor=\color{LightGoldenrodYellow},keywordstyle=\color{Blue},emph={puzzlebackground,puzzleforeground,center,slitherlink,left,shape,fill,inner,sep,draw,rounded,corners,thick}, emphstyle=\color{Tomato},emph={[2]Wheat,HotPink,GreenYellow,LightBlue,LightSalmon,LightYellow,green,sudoku,rows,columns,scale},emphstyle={[2]\color{OliveDrab}},morekeywords={setbigcell,setrule,tikzpath,colorarea,framearea,fillarea,slitherlinkcell,setrow,LP@cvoffset,titleformat,definecounterstyle,marginnote,tikz,node,puzzlecounter,color,[,]}} +\makeatletter +\renewcommand{\maketitle}% +{% + \thispagestyle{empty}% + \pagecolor{Ivory}% + \begin{titlepage}% + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift=-2cm] at (current page.north west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle% + (\paperwidth,2cm);% + \draw[anchor=west,yshift=-4cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\RaggedRight\Huge\sffamily\textbf{\@title}}};% + \draw[anchor=west,yshift=-6cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\huge\sffamily\textbf{\@fileversion}}};% + \draw[anchor=west,yshift=-9cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\RaggedRight\huge\sffamily\textbf{\@subtitle}}};% + \draw[anchor=west,yshift=-13cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\usebox\logo};% + \draw[anchor=west,yshift=-17cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\huge\sffamily\textbf{\@date}}};% + \draw[anchor=west,yshift=-20cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\Large\sffamily{\@authorline\\\textbf{\@author}}}};% + \end{tikzpicture}% + };% + \node[yshift=0cm] at (current page.south west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=NavyBlue,color=NavyBlue,yshift=6cm,xshift=2cm] (0,0) rectangle (0.2cm,19cm);% + \draw[fill=CornflowerBlue,color=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);% + \draw[anchor=west,yshift=1cm,xshift=3cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\large\sffamily{\@refline}}};% + \end{tikzpicture}% + };% + \end{tikzpicture}% + \end{titlepage}% + \pagecolor{white}% +}% +% +\newcommand*{\@tikzhead}[1]% +{% + \begin{tikzpicture}[remember picture,overlay]% + \node[yshift=-2cm] at (current page.north west)% + {% + \begin{tikzpicture}[remember picture, overlay]% + \draw[fill=CornflowerBlue] (0,0) rectangle (\paperwidth,2cm);% + \draw[anchor=west,yshift=1cm,xshift=1.5cm,color=NavyBlue] (0,0) node% + {\parbox{15cm}{\LARGE\sffamily\textbf{\@title}}};% + \node[anchor=east,xshift=.9\paperwidth,rectangle,% + rounded corners=15pt,inner sep=11pt,fill=NavyBlue]% + {\color{white}\textsc{#1}};% + \end{tikzpicture}% + };% + \end{tikzpicture}% +}% +\clearscrheadings% +\ihead{\@tikzhead{\headmark}}% +\cfoot{\upshape\thepage}% +\pagestyle{scrheadings}% +% +%\newcommand*{\headline}[1]{\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}% +\newcommand*{\Headline}[1]{\@mkboth{#1}{#1}}% +% +\renewcommand{\headfont}{\normalfont\mdseries\scshape} +% +\gdef\@subtitle{}% +\providecommand*{\Subtitle}[1]{\gdef\@subtitle{#1}}% +\gdef\@fileversion{}% +\providecommand*{\Fileversion}[1]{\gdef\@fileversion{#1}}% +\gdef\@author{}% +\providecommand*{\Author}[1]{\gdef\@author{#1}}% +\gdef\@authorline{Package author:}% +\providecommand*{\Authorline}[1]{\gdef\@authorline{#1}}% +\gdef\@refline{}% +\providecommand*{\Refline}[1]{\gdef\@refline{#1}}% +\gdef\and{\unskip{}, }% +\newcommand\doubledash{-\kern0.5pt-} +\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1em\leavevmode\llap{\makeenmark}} +\makeatother +% +\def\filename{slitherlink.sty}% +\def\XeLaTeX{Xe\LaTeX}% +% +\newenvironment{optionlist} +{\begin{trivlist}\setlength\leftskip{2em}} +{\end{trivlist}} +\newcommand\optitem[3]{\item [\texttt{\textbf{\textcolor{DodgerBlue}{#1}} \lbrack\textcolor{Crimson}{#2}\rbrack}] #3} +% +\makeatletter% +\renewcommand\tableofcontents% +{% + %\section*{\contentsname}% + \@mkboth{% + \MakeUppercase\contentsname}{\MakeUppercase\contentsname}% + \@starttoc{toc}% +}% +% +\newcommand\styleoption{\name@idx{style option}}% +\newcommand\stylename{\name@idx{document style}}% +\def\name@idx#1#2{% + {\ttfamily#2}% + \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}% +}% +\newcommand*\margcs[1]{\marginnote{\raggedleft\scriptsize #1}}% +\newcommand*\package[1]{\texttt{#1}\index{#1=\string\ttt{#1}}}% +\newcommand*\mco[1]{\mbox{\LANGLE\itshape#1\RANGLE}\index{#1, class option value}\index{class option value>#1}}% +% +\renewcommand\@biblabel[1]{\makebox[1.5cm][l]{[#1]}} +%\renewcommand*\l@subsection{\@dottedtocline{2}{1.2em}{2.8em}} +%\renewcommand*\l@subsubsection{\@dottedtocline{3}{2.4em}{3.7em}} +\makeatother +% +\setlength\parindent{0pt}% +\hypersetup{pdfauthor={Josef Kleber},pdftitle={A style file for typesetting Slitherlink logic puzzles},pdfsubject={Documentation for LaTeX style \filename}}% +% +\begin{document} +\title{\filename}% +\Subtitle{A style file for typesetting Slitherlink logic puzzles}% +\author{Josef Kleber} +\Fileversion{v1.0} +\Refline{\href{mailto:josef.kleber@gmx.de}{\texttt{josef.kleber@gmx.de}}\\\href{https://bitbucket.org/kleberj/logicpuzzle/}{\texttt{https://bitbucket.org/kleberj/logicpuzzle/}}} +\newsavebox\logo +\savebox\logo{% + \begin{slitherlink}[bgcolor=Ivory] + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \end{slitherlink} + \hspace{1.5cm} + \begin{slitherlink}[bgcolor=Ivory] + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \framearea{black}{\tikzpath{3}{1}{8,8,4,4,8,6,6,8,6,2,6,6,2,4,2,4,2,4}} + \end{slitherlink} +} +\maketitle +\tableofcontents +\clearpage + +\section{The puzzle} +Draw a closed line into the grid. This line must be on the existing dashed lines, but do not have to go through all grid points. If numbers are present in the grid cells, they indicate how many sides of the cell are touched by the line. The line must not touch or cross itself. Here's a little self-explanatory example: + +\begin{center} + \begin{slitherlink} + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \end{slitherlink} + \hspace{1.5cm} + \begin{slitherlink} + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \framearea{black}{\tikzpath{3}{1}{8,8,4,4,8,6,6,8,6,2, + 6,6,2,4,2,4,2,4}} + \end{slitherlink} +\end{center} + +\bigskip +\begin{lstlisting} +\begin{center} + \begin{slitherlink} + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \end{slitherlink} + \hspace{1.5cm} + \begin{slitherlink} + \setbigcell{1}{1}{4} + \slitherlinkcell{1}{3}{3} + \slitherlinkcell{3}{1}{3} + \slitherlinkcell{3}{3}{0} + \slitherlinkcell{3}{4}{3} + \slitherlinkcell{4}{4}{2} + \slitherlinkcell{5}{1}{0} + \slitherlinkcell{5}{2}{2} + \framearea{black}{\tikzpath{3}{1}{8,8,4,4,8,6,6,8,6,2, + 6,6,2,4,2,4,2,4}} + \end{slitherlink} +\end{center} +\end{lstlisting} +\lstset{basicstyle=\ttfamily\normalsize} + +\section{Options} +\begin{optionlist} + \optitem{\styleoption{rows}}{5}{defines the number of rows in the grid.} + \optitem{\styleoption{columns}}{5}{specifies the number of columns in the grid} + \optitem{\styleoption{width}}{5.2cm}{sets the width of the minipage, in which the grid is typeset.} + \optitem{\styleoption{scale}}{1}{scales the size of the grid in the minipage.} + \optitem{\styleoption{fontsize}}{Large}{specifies the size of the numbers next to the grid. Here, the usual \LaTeX\ sizes are used. Possible values: \texttt{tiny}, \texttt{scriptsize}, \texttt{footnotesize}, \texttt{small}, \texttt{normalsize}, \texttt{large}, \underline{\texttt{Large}}, \texttt{LARGE}, \texttt{huge}, \texttt{Huge}} + \optitem{\styleoption{title}}{}{sets the title of a puzzle.} + \optitem{\styleoption{titleindent}}{0cm}{defines the indent of the title.} + \optitem{\styleoption{titlewidth}}{5.2cm}{specifies the width of the box the title is set in.} + \optitem{\styleoption{bgcolor}}{}{sets the background color of the grid.} + \optitem{\styleoption{counterstyle}}{none}{defines the counter style. Predefined styles: none, left, right} + \optitem{\styleoption{cvoffset}}{-23pt}{sets the vertical offset of the counters in the margin.} +\end{optionlist} + +\section{Environments} +\subsection{\texttt{slitherlink}} +The \env{slitherlink} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{slitherlink}\oarg{options}\\\dots\\\enve{slitherlink}} is the central core of the style file. With the optional argument of the environment, you can reset the options with local scope. Here, a blank grid is created. +\subsection{\texttt{puzzlebackground}} +The \env{puzzlebackground} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{puzzlebackground}\\\dots\\\enve{puzzlebackground}} allows you to place elements behind the main layer. This is for example usefull for the \cmd\fillarea\ command. +\subsection{\texttt{puzzleforeground}} +The \env{puzzleforeground} environment\marginnote{\hbadness=10000\RaggedLeft\scriptsize\envb{puzzleforeground}\\\dots\\\enve{puzzleforeground}} allows you to place elements in front of the main layer. This is for example usefull for the \cmd\framearea\ command. +\section{Commands} +\subsection{In the grid and around} +\subsubsection{\texttt{slitherlinkcell}} +The command \cs{slitherlinkcell}\margcs{\cmd\slitherlinkcell\\\{\marg{column}\}\{\marg{row}\}\{\marg{number}\}} sets the \marg{number} of the grid cell \marg{column} \marg{row}. +\subsubsection{\texttt{setbigcell}} +With\margcs{\cmd\setbigcell[\oarg{fontsize}]\\\{\{\marg{column}\}\{\marg{row}\}\{\marg{number}\}} the \cmd\setbigcell\ command, you can set \marg{number} into a big (\texttt{$2\times2$}) cell \marg{column}\marg{row} as central node. The optional argument \oarg{fontsize} is set to 'Huge' by default. +\subsubsection{\texttt{setrow}} +The command \cs{setrow}\margcs{\cmd\setrow\{\marg{row}\}\{\marg{csv list}\}} sets the contents of \marg{row}. It expects a comma-separated list. +\subsubsection{\texttt{setcolumn}} +The command \cs{setcolumn}\margcs{\cmd\setcolumn\{\marg{column}\}\{\marg{csv list}\}} sets the contents of \marg{column}. +\subsubsection{\texttt{framearea}} +The command \cs{framearea}\margcs{\cmd\framearea\{\marg{color}\}\{\marg{\cmd\tikz\ path}\}} frames the area given by \marg{\cmd\tikz\ path} with color \marg{color}. The reference for coordinates is the bottom left corner of the cell. + +\begin{lstlisting} +\framearea{green}{(2,2)--(2,3)--(3,3)--(3,2)--(2,2)} +\end{lstlisting} + +This command will color the frame of the grid cell \texttt{(2,2)} green. You should consider using this command in the \env{puzzleforeground} environment. + +\subsubsection{\texttt{tikzpath}} +With\margcs{\cmd\tikzpath\{\oarg{column}\}\{\oarg{row}\}\\\{\oarg{csv list}\}} the \cmd\tikzpath\ command, you can easily construct a \cmd\tikz\ path. You just need to define a starting point \marg{column}\marg{row} (bottom left corner) and a \marg{csv list} with direction indicators relative to the current position. + +\begin{center} +\begin{tabular}{rlrlrl} +7: & up left & 8: & up & 9: & up right \\ +4: & left & 5: & no change & 6: & right \\ +1: & down left & 2: & down & 3: & down right \\ +\end{tabular} +\end{center} + +\begin{lstlisting} +\framearea{green}{\tikzpath{2}{2}{8,6,2,4}} +\end{lstlisting} + +This command will frame grid cell \texttt{(2,2)} green. +\subsection{Presentation} +\subsubsection{\texttt{definecounterstyle}} +The command \cs{definecounterstyle}\margcs{\cmd\definecounterstyle\{\marg{name}\}\\\{\marg{definition}\}} allows you to define your own styles. For example, the style \texttt{left} is defined as follows: + +\begin{lstlisting} +\definecounterstyle{left}{ + \begingroup\reversemarginpar\marginnote{ + \tikz\node[shape=rectangle,fill=yellow!40,inner sep=7pt, + draw,rounded corners=3pt,thick] + {\Huge\puzzlecounter};}[\LP@cvoffset]\endgroup} +} +\end{lstlisting} + +To typeset the counter into the margin we use the command \cmd\marginnote. We need to use the command \cmd\reversemarginpar\ to set the counter into the left margin. Of course, we must use this command in a group for local scope. Finally we use \cmd\puzzlecounter\ in a \cmd\tikz\ node with a vertical offset set with the option \styleoption{cvoffset}. +\subsubsection{\texttt{puzzlecounter}} +The command \cs{puzzlecounter}\margcs{\cmd\puzzlecounter} provides the counter in textual form to use it for example in \cmd\definecounterstyle. +\subsubsection{\texttt{titleformat}} +With the command \cs{titleformat}\margcs{\cmd\titleformat\{\marg{format}\}}, you can define the format of the title. By default, the definition is as follows: + +\begin{lstlisting} +\titleformat{\centering\Large\color{blue}} +\end{lstlisting} +\subsection{Miscellaneous} +\subsubsection{\texttt{slitherlinksetup}} +With the command \cs{slitherlinksetup}\margcs{\cmd\slitherlinksetup\{\marg{options}\}} you can reset the options with global scope. +\subsubsection{\texttt{setpuzzlecounter}} +With the command \cs{setpuzzlecounter}\margcs{\cmd\setpuzzlecounter\{\marg{number}\}}, you can reset the puzzle counter, for example before the solutions. + +\section{Examples \& Solutions} +You\IfFileExists{qrcode.png}{\marginnote{\href{https://bitbucket.org/kleberj/logicpuzzle/}{\includegraphics[height=2cm]{qrcode.png}}}[-31pt]}{} can download application examples and their solutions from the \href{https://bitbucket.org/kleberj/logicpuzzle/}{project page}. The puzzles are originally licensed under \href{http://creativecommons.org/licenses/by-nc-sa/3.0/}{\ccbyncsa}. +\end{document} diff --git a/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink_README b/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink_README new file mode 100644 index 00000000000..f1f9b399091 --- /dev/null +++ b/Master/texmf-dist/doc/latex/logicpuzzle/slitherlink/slitherlink_README @@ -0,0 +1,8 @@ +The package enables the user to typeset Slitherlink logic puzzles +(aka Fences, Number Line, Dotty Dilemma, Sli-Lin, Takegaki, +Great Wall of China, Loop the Loop, Rundweg, Gartenzaun, ...) +Draw a closed line into the grid. This line must be on the existing +dashed lines, but do not have to go through all grid points. +If numbers are present in the grid cells, they indicate how many +sides of the cell are touched by the line. The line must not +touch or cross itself.
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/laserbeam.sty b/Master/texmf-dist/tex/latex/logicpuzzle/laserbeam.sty new file mode 100644 index 00000000000..9053cabca72 --- /dev/null +++ b/Master/texmf-dist/tex/latex/logicpuzzle/laserbeam.sty @@ -0,0 +1,89 @@ +%% +%% 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{laserbeam}[2013/04/20 laserbeam.sty v1.0 - Josef Kleber (C) 2013]% +% +\RequirePackage{logicpuzzle}% +% +\newcommand*\LP@LB@init@prefix{LP@LB}% +\newcommand*\LP@LB@init@package{laserbeam}% +% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{rows}{5}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{columns}{5}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{scale}{1}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{counterstyle}{none}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{bgcolor}{}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{width}{6.5cm}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{cvoffset}{-38pt}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{title}{}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{titleindent}{0cm}% +\LP@define@key{\LP@LB@init@prefix}{\LP@LB@init@package}{titlewidth}{6.5cm}% +\LP@define@choicekey@fontsize{\LP@LB@init@prefix}{\LP@LB@init@package}{Large}% +% +\ExecuteOptionsX{rows,columns,width,fontsize,scale,bgcolor,cvoffset,counterstyle,title,titleindent,titlewidth}% +% +\ProcessOptionsX\relax% +% +\LP@init@counter{\LP@LB@init@prefix}% +% +\let\laserH\LP@toprow% +\let\laserV\LP@leftcolumn% +\let\mirrorH\LP@bottomrow@edge% +\let\mirrorV\LP@rightcolumn@edge% +% +\newcommand*\laser[2][red]% +{% + % avoid little laser peaks outside grid + \clip (1,1) rectangle (\arabic{LP@LB@columns},\arabic{LP@LB@rows}); + \framearea{#1}{#2}% +}% +% +\newcommand*\laserbeamsetup[1]% +{% + \setkeys{laserbeam.sty}{#1}% +}% +% +\newenvironment{laserbeam}[1][]% +{% + \setkeys{laserbeam}{#1}% + \LP@set@package{laserbeam}% + \LP@set@env@prefix{LP@LB}% + \setcounter{LP@LB@rows}{\LP@LB@rows}% + \setcounter{LP@LB@columns}{\LP@LB@columns}% + \stepcounter{LP@LB@rows}% + \stepcounter{LP@LB@columns}% + \begin{minipage}[t]{\LP@LB@width}% + \ifthenelse{\equal{\LP@LB@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\LP@LB@titleindent}\parbox{\LP@LB@titlewidth}{\strut\LP@titleformat\LP@LB@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\LP@LB@scale]% + \LP@drawbackground{1}{1}{\LP@LB@columns}{\LP@LB@rows}{\LP@LB@bgcolor}% + \LP@drawgrid{1}{1}{\LP@LB@columns}{\LP@LB@rows}{1cm}% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@LB@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% +\endinput%
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty b/Master/texmf-dist/tex/latex/logicpuzzle/logicpuzzle.sty index 3dcb1fa9c1e..f431d57fd15 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/04/12 logicpuzzle.sty v1.8 - Josef Kleber (C) 2013]% +\ProvidesPackage{logicpuzzle}[2013/04/20 logicpuzzle.sty v1.9 - Josef Kleber (C) 2013]% % \RequirePackage{xkeyval}% \RequirePackage{ifthen}% @@ -27,7 +27,7 @@ \RequirePackage{etoolbox}% \RequirePackage{marginnote}% \RequirePackage{tikz}% -\usetikzlibrary{decorations.pathmorphing}% +\usetikzlibrary{decorations.pathmorphing,calc}% \pgfdeclarelayer{LPdump}% \pgfdeclarelayer{LPbgcolor}% \pgfdeclarelayer{LPbackgroundtwo}% @@ -60,6 +60,10 @@ \gdef\LP@fontsize\Large% \gdef\LP@cvoffset{0pt}% % +\def\LP@normallines{0.5pt}% +\def\LP@thicklines{1.5pt}% +\def\LP@grid@linestyle{}% +% \newcommand*\LP@Pfive{.5}% % % init @@ -166,6 +170,9 @@ \LP@definecolor{LP@c@vii}{.53,.808,.98}% \LP@definecolor{LP@c@viii}{.196,.804,.196}% \LP@definecolor{LP@c@ix}{1,.96,.932}% +\LP@definecolor{LP@c@griddots}{.25,.51,.33}% +\LP@definecolor{LP@c@cross}{.25,.51,.33}% +\LP@definecolor{LP@c@mirror}{.8,.8,.8}% % % drawing grids % @@ -180,19 +187,33 @@ \setcounter{LP@countii}{#4}% max row \stepcounter{LP@counti}% \stepcounter{LP@countii}% - \draw[step=#5] (#1,#2) grid (\value{LP@counti},\value{LP@countii});% + \draw[step=#5,line width=\LP@normallines,\LP@grid@linestyle] (#1,#2) grid (\value{LP@counti},\value{LP@countii});% }% % +\newcommand*\LP@drawgriddots% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \pgfmathsetmacro{\START}{1}% + % dots are drawn immediatly after the grid, + % so we can recycle LP@counti and LP@countii + \pgfmathsetmacro{\ENDC}{\arabic{LP@counti}}% + \pgfmathsetmacro{\ENDR}{\arabic{LP@countii}}% + \begin{pgfonlayer}{LPforeground}% + \foreach \i in {\START,...,\ENDC}% + \foreach \j in {\START,...,\ENDR}% + \fill[color=LP@c@griddots] (\i,\j) circle [radius=3pt];% + \end{pgfonlayer}% +}% \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);% + \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);% }% % % drawing grid background @@ -212,7 +233,7 @@ \stepcounter{LP@counti}% \stepcounter{LP@countii}% \begin{pgfonlayer}{LPbgcolor}% - \draw[fill=#5] (#1,#2) rectangle (\value{LP@counti},\value{LP@countii});% + \fill[color=#5] (#1,#2) rectangle (\value{LP@counti},\value{LP@countii});% \end{pgfonlayer}{LPbgcolor}% }% }% @@ -271,6 +292,24 @@ \node at (#1\LP@Pfive,#2\LP@Pfive){#3};% }% % +% #1 column +% #2 row +% #3 content +\newcommand*\LP@setcellcontentC[3]% +{% + \node at (#1,#2){#3};% +}% +% +\newcommand*\LP@setcellcontentVE[3]% +{% + \node at (#1,#2\LP@Pfive){#3};% +}% +% +\newcommand*\LP@setcellcontentHE[3]% +{% + \node at (#1\LP@Pfive,#2){#3};% +}% +% % #1 csv list % #2 column % #3 row @@ -292,6 +331,24 @@ \stepcounter{LP@counti}% }% % +\newcommand*\LP@setrowcontents@edge[3]% +{% + \setcounter{LP@counti}{#2}% + \setcounter{LP@countii}{#3}% + \forcsvlist\LP@setrowcontents@edge@i{#1}{\LP@env@prefix}% +}% +% +\newcommand*\LP@setrowcontents@edge@i[1]% +{% + \LP@setrowcontents@edge@ii{#1}{\LP@env@prefix}% +}% +% +\newcommand*\LP@setrowcontents@edge@ii[2]% +{% + \LP@setcellcontentVE{\arabic{LP@counti}}{\arabic{LP@countii}}{\csname #2@fontsize\endcsname#1}% + \stepcounter{LP@counti}% +}% +% \newcommand*\setrow[2]% {% \LP@setrowcontents{#2}{1}{#1}% @@ -318,6 +375,24 @@ \stepcounter{LP@countii}% }% % +\newcommand*\LP@setcolumncontents@edge[3]% +{% + \setcounter{LP@counti}{#2}% + \setcounter{LP@countii}{#3}% + \forcsvlist\LP@setcolumncontents@edge@i{#1}% +}% +% +\newcommand*\LP@setcolumncontents@edge@i[1]% +{% + \LP@setcolumncontents@edge@ii{#1}{\LP@env@prefix}% +}% +% +\newcommand*\LP@setcolumncontents@edge@ii[2]% +{% + \LP@setcellcontentHE{\arabic{LP@counti}}{\arabic{LP@countii}}{\csname #2@fontsize\endcsname#1}% + \stepcounter{LP@countii}% +}% +% \newcommand*\setcolumn[2]% {% \LP@setcolumncontents{#2}{#1}{1}% @@ -333,6 +408,24 @@ \LP@setcellcontent{#1}{#2}{\LP@fontsize#3}% }% % +\newcommand*\setbigcell[4][Huge]% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \LP@set@LP@bgcolor{\LP@env@prefix}% + \ifthenelse{\equal{\LP@bgcolor}{}}% + {\gdef\LP@sbc@bgcolor{white}}% + {\gdef\LP@sbc@bgcolor{\LP@bgcolor}}% + \setcounter{LP@counti}{#2}% + \setcounter{LP@countii}{#3}% + \stepcounter{LP@counti}% + \stepcounter{LP@countii}% + \draw[line width=\LP@normallines,fill=\LP@sbc@bgcolor,\LP@grid@linestyle] (#2,#3) rectangle ++(2,2);% + \begin{pgfonlayer}{LPforegroundtwo}% + \fill[color=\LP@sbc@bgcolor] (\arabic{LP@counti},\arabic{LP@countii}) circle [radius=3.5pt*\LP@scale];% + \node at (\arabic{LP@counti},\arabic{LP@countii}){\csname#1\endcsname#4};% + \end{pgfonlayer}% +}% +% \newcommand*\setcolorrow[2]% {% \setcounter{LP@counti}{1}% @@ -431,12 +524,12 @@ % \newcommand*\framearea[2]% {% - \draw[ultra thick,color=#1] #2;% + \draw[line width=\LP@thicklines,color=#1] #2;% }% % \newcommand*\fillarea[2]% {% - \draw[ultra thick,fill=#1] #2 ;% + \draw[line width=\LP@thicklines,fill=#1] #2 ;% }% % \newcommand*\colorarea[2]% @@ -516,12 +609,26 @@ \setcounter{LP@countii}{\LP@rows}% \stepcounter{LP@counti}% \stepcounter{LP@countii}% - \draw[ultra thick,color=#1] (1,1)--(1,\arabic{LP@countii});% - \draw[ultra thick,color=#1] (1,\arabic{LP@countii})--(\arabic{LP@countii},\arabic{LP@countii});% - \draw[ultra thick,color=#1] (\arabic{LP@countii},\arabic{LP@countii})--(\arabic{LP@countii},1);% - \draw[ultra thick,color=#1] (\arabic{LP@countii},1)--(1,1);% + \draw[line width=\LP@thicklines,color=#1] (1,1)--(1,\arabic{LP@countii});% + \draw[line width=\LP@thicklines,color=#1] (1,\arabic{LP@countii})--(\arabic{LP@countii},\arabic{LP@countii});% + \draw[line width=\LP@thicklines,color=#1] (\arabic{LP@countii},\arabic{LP@countii})--(\arabic{LP@countii},1);% + \draw[line width=\LP@thicklines,color=#1] (\arabic{LP@countii},1)--(1,1);% +}% +% +\newcommand*\placecross[2]% +{% + \LP@setcellcontentC{#1}{#2}{\LP@Cross}% }% % +\newcommand*\placemirror[3]% +{% + \LP@setcellcontentC{#1}{#2}{\LP@Mirror{#3}}% +}% +% +\newcommand*\placearrow[3]% +{% + \LP@setcellcontentC{#1}{#2}{\LP@Arrow{#3}}% +}% \newenvironment{puzzlebackground}% {% \begin{pgfonlayer}{LPbackground}% @@ -545,6 +652,11 @@ \LP@setrowcontents{#1}{1}{0}% }% % +\newcommand*\LP@bottomrow@edge[1]% +{% + \LP@setrowcontents@edge{#1}{1}{0}% +}% +% \newcommand*\LP@leftcolumn[1]% {% \LP@setcolumncontents{#1}{0}{1}% @@ -570,6 +682,16 @@ \LP@setcolumncontents{#1}{\csname the#2@columns\endcsname}{1}% }% % +\newcommand*\LP@rightcolumn@edge[1]% +{% + \LP@rightcolumn@edge@i{#1}{\LP@env@prefix}% +}% +% +\newcommand*\LP@rightcolumn@edge@i[2]% +{% + \LP@setcolumncontents@edge{#1}{\csname the#2@columns\endcsname}{1}% +}% +% % Presentation % \newcommand*\titleformat[1]% @@ -601,7 +723,42 @@ \definecounterstyle{left}{\begingroup\reversemarginpar\marginnote{\tikz\node[shape=rectangle,fill=yellow!40,inner sep=7pt,draw,rounded corners=3pt,thick]{\Huge\puzzlecounter};}[\LP@cvoffset]\endgroup}% \definecounterstyle{right}{\marginnote{\tikz\node[shape=rectangle,fill=yellow!40,inner sep=7pt,draw,rounded corners=3pt,thick]{\Huge\puzzlecounter};}[\LP@cvoffset]}% % -\newcommand*\LP@Block{\tikz[scale=\LP@scale]\draw[fill=\LP@color] (0,0) rectangle (1,1);}% +\newcommand*\LP@Block{\tikz[scale=\LP@scale]\draw[line width=\LP@normallines,fill=\LP@color] (0,0) rectangle (1,1);}% +% +\newcommand*\LP@Arrow[1]% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \def\LP@rotate{45}% + \ifthenelse{\equal{#1}{LeftUp}}{\def\LP@rotate{135}}{}% + \ifthenelse{\equal{#1}{LeftDown}}{\def\LP@rotate{225}}{}% + \ifthenelse{\equal{#1}{RightDown}}{\def\LP@rotate{315}}{}% + \pgfmathsetmacro{\LPlinewidth}{3pt*\LP@scale}% + \tikz\draw[->,line width=\LPlinewidth,rotate=\LP@rotate,scale=\LP@scale] (0.1,.5) -- (0.9,.5);% +}% +% +\newcommand*\LP@Cross% +{% + \LP@set@LP@scale{\LP@env@prefix}% + \begin{tikzpicture} + \begin{pgfonlayer}{LPforeground} + \pgfmathsetmacro{\LPlinewidth}{3pt*\LP@scale}% + \draw[line width=\LPlinewidth,scale=\LP@scale,color=LP@c@cross] (.35,.35) -- (0.65,.65) -- (.5,.5) -- (.65,.35)-- (.35,.65);% + \end{pgfonlayer} + \end{tikzpicture} +}% +% +\newcommand*\LP@Mirror[1]% +{% + \def\LP@rotate{0}% + \ifthenelse{\equal{#1}{V}}{\def\LP@rotate{90}}{}% + \LP@set@LP@scale{\LP@env@prefix}% + \begin{tikzpicture}% + \begin{pgfonlayer}{LPforegroundtwo}% + \pgfmathsetmacro{\LPlinewidth}{3pt*\LP@scale}% + \draw[line width=\LPlinewidth,scale=\LP@scale,color=LP@c@mirror,rotate=\LP@rotate] (.35,.5) -- (0.65,.5);% + \end{pgfonlayer}% + \end{tikzpicture}% +}% % % get package options with prefix % @@ -651,6 +808,21 @@ \gdef\LP@package{#1}% }% % +\newcommand*\setgridlinestyle[1]% +{% + \def\LP@grid@linestyle{#1}% +}% +% +\newcommand*\setnormallinewidth[1]% +{% + \def\LP@normallines{#1}% +}% +% +\newcommand*\setthicklinewidth[1]% +{% + \def\LP@thicklines{#1}% +}% +% % generic logicpuzzle environment and options % \newcommand*\LP@LP@init@prefix{LP@LP}% diff --git a/Master/texmf-dist/tex/latex/logicpuzzle/slitherlink.sty b/Master/texmf-dist/tex/latex/logicpuzzle/slitherlink.sty new file mode 100644 index 00000000000..bceeb2c85af --- /dev/null +++ b/Master/texmf-dist/tex/latex/logicpuzzle/slitherlink.sty @@ -0,0 +1,82 @@ +%% +%% 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{slitherlink}[2013/04/20 slitherlink.sty v1.0 - Josef Kleber (C) 2013]% +% +\RequirePackage{logicpuzzle}% +% +\newcommand*\LP@SK@init@prefix{LP@SK}% +\newcommand*\LP@SK@init@package{slitherlink}% +% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{rows}{5}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{columns}{5}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{scale}{1}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{counterstyle}{none}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{bgcolor}{}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{width}{5.2cm}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{cvoffset}{-23pt}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{title}{}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{titleindent}{0cm}% +\LP@define@key{\LP@SK@init@prefix}{\LP@SK@init@package}{titlewidth}{5.2cm}% +\LP@define@choicekey@fontsize{\LP@SK@init@prefix}{\LP@SK@init@package}{Large}% +% +\ExecuteOptionsX{rows,columns,width,fontsize,scale,bgcolor,cvoffset,counterstyle,title,titleindent,titlewidth}% +% +\ProcessOptionsX\relax% +% +\LP@init@counter{\LP@SK@init@prefix}% +% +\let\slitherlinkcell\setcell% +% +\newcommand*\slitherlinksetup[1]% +{% + \setkeys{slitherlink.sty}{#1}% +}% +% +\newenvironment{slitherlink}[1][]% +{% + \setkeys{slitherlink}{#1}% + \LP@set@package{slitherlink}% + \LP@set@env@prefix{LP@SK}% + \ifthenelse{\equal{\LP@grid@linestyle}{}}% + {\setgridlinestyle{dashed}}{}% + \setcounter{LP@SK@rows}{\LP@SK@rows}% + \setcounter{LP@SK@columns}{\LP@SK@columns}% + \stepcounter{LP@SK@rows}% + \stepcounter{LP@SK@columns}% + \begin{minipage}[t]{\LP@SK@width}% + \ifthenelse{\equal{\LP@SK@title}{}}% + {\par\enspace\par}% empty + {\enspace\par\noindent\hspace{\LP@SK@titleindent}\parbox{\LP@SK@titlewidth}{\strut\LP@titleformat\LP@SK@title}\vspace{3mm}\par}% + \begin{tikzpicture}[scale=\LP@SK@scale]% + \LP@drawbackground{1}{1}{\LP@SK@columns}{\LP@SK@rows}{\LP@SK@bgcolor}% + \LP@drawgrid{1}{1}{\LP@SK@columns}{\LP@SK@rows}{1cm}% + \LP@drawgriddots% +}% +{% + \end{tikzpicture}% + \LP@drawcounter{\LP@SK@counterstyle}% + \stepcounter{LP@puzzlecounter}% + \end{minipage}% +}% +% +\endinput%
\ No newline at end of file |