diff options
author | Karl Berry <karl@freefriends.org> | 2006-07-14 22:41:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-07-14 22:41:47 +0000 |
commit | 8e31fe3c99d1f1b6a0eda074f89b206fd70aa9e5 (patch) | |
tree | efbc3f506952613e17f980d9f1334255d63be10e /Master/texmf-dist/source/latex/sudoku/sudoku.dtx | |
parent | bb8fed912dec0ce6c7a7c8171411cd77ee7b1929 (diff) |
sudoku update
git-svn-id: svn://tug.org/texlive/trunk@1841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/sudoku/sudoku.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/sudoku/sudoku.dtx | 62 |
1 files changed, 52 insertions, 10 deletions
diff --git a/Master/texmf-dist/source/latex/sudoku/sudoku.dtx b/Master/texmf-dist/source/latex/sudoku/sudoku.dtx index b6e6129c9a3..c74c72afa92 100644 --- a/Master/texmf-dist/source/latex/sudoku/sudoku.dtx +++ b/Master/texmf-dist/source/latex/sudoku/sudoku.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % % sudoku.dtx -% Copyright 2005 Paul Abraham <paul.abraham@hotpop.com> +% Copyright 2005,2006 Paul Abraham <paul.abraham@linuxdirect.org> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -24,7 +24,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{sudoku} -%<package> [2005/06/29 v1.0 Sudoku grid] +%<package> [2006/03/25 v1.0.1 Sudoku grid] % %<*driver> \documentclass{ltxdoc} @@ -40,7 +40,7 @@ %</driver> % \fi % -% \CheckSum{84} +% \CheckSum{104} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -59,6 +59,7 @@ % Right brace \} Tilde \~} % % \changes{v1.0}{2005/06/29}{Initial version} +% \changes{v1.0.1}{2006/03/25}{Added ability to specify line thickness} % % \GetFileInfo{sudoku.sty} % @@ -68,7 +69,7 @@ % % \title{The \textsf{sudoku} package\thanks{This document % corresponds to \textsf{sudoku}~\fileversion, dated \filedate.}} -% \author{Paul Abraham \\ \texttt{paul.abraham@hotpop.com}} +% \author{Paul Abraham \\ \texttt{paul.abraham@linuxdirect.org}} % % \maketitle % @@ -113,13 +114,23 @@ % This length contains the size of the grid, defaulting to \verb|10cm|. % It can be changed with \verb|\setlength\sudokusize{|\meta{size}|}|. % +% \DescribeMacro{\sudokuthickline} +% This length determines the thickness of the thick lines and defaults +% to \verb|2pt|. It can be changed with +% \verb|\setlength\sudokuthickline{|\meta{size}|}|. +% +% \DescribeMacro{\sudokuthinline} +% This length determines the thickness of the thin lines and defaults +% to \verb|0.4pt|. It can be changed with +% It can be changed with \verb|\setlength\sudokuthinline{|\meta{size}|}|. +% % \DescribeEnv{sudoku-block} % This environment draws the sudoku grid. The contents of each cell % in the grid are delimited by the vertical bar (\verb+|+) character. % % \DescribeEnv{sudoku} -% This environment starts a |center| environment, then uses the -% |sudoku-block| environment to draw the grid. +% This environment starts a \verb|center| environment, then uses the +% \verb|sudoku-block| environment to draw the grid. % % \section{Examples} % @@ -212,6 +223,7 @@ % %\iffalse % 2005/06/29 v1.0 Initial version +% 2006/03/25 v1.0.1 Added ability to specify line thickness %\fi % % \section{Implementation} @@ -247,16 +259,38 @@ % \end{macrocode} % % Now we can draw the grid. Each 3$\times$3 box has thicker borders -% than the rest of the grid. +% than the rest of the grid. From version 1.0.1, the line thickness +% can be determined by changing \verb|\sudokuthinline| and +% \verb|\sudokuthickline|. % % \begin{macrocode} -\newcommand*\@sudoku@grid{% - \thinlines +\newcommand*\@sudoku@grid{ +% \end{macrocode} +% +% First draw the thin lines. +% +% \begin{macrocode} + \linethickness{\sudokuthinline}% \multiput(0,0)(1,0){10}{\line(0,1){9}}% \multiput(0,0)(0,1){10}{\line(1,0){9}} - \thicklines +% \end{macrocode} +% +% Now draw the thick lines. +% +% \begin{macrocode} + \linethickness{\sudokuthickline}% \multiput(0,0)(3,0){4}{\line(0,1){9}}% \multiput(0,0)(0,3){4}{\line(1,0){9}} +% \end{macrocode} +% +% Finally try and fill in the four corners of the grid. +% +% \begin{macrocode} + \linethickness{0.5\sudokuthickline}% + \put(0,0){\framebox(0,0){}}% + \put(9,0){\framebox(0,0){}}% + \put(0,9){\framebox(0,0){}}% + \put(9,9){\framebox(0,0){}} } % \end{macrocode} % @@ -271,6 +305,14 @@ \setlength\sudokusize{10cm} % \end{macrocode} % +% Set line thicknesses to 0.4pt and 2pt for thin and thick lines. +% \begin{macrocode} +\newdimen\sudokuthinline +\setlength\sudokuthinline{0.4pt} +\newdimen\sudokuthickline +\setlength\sudokuthickline{2pt} +% \end{macrocode} +% % Make the size of each square $1/9$ of the size of sudoku grid. % \begin{macrocode} \newenvironment{sudoku-block}{% |