diff options
author | Karl Berry <karl@freefriends.org> | 2022-08-09 20:01:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-08-09 20:01:04 +0000 |
commit | 4e8c785c29a3d68045a3187b9e63158a778725ed (patch) | |
tree | 89eb2e1f2f2c017adcca7dc2618b034b7cafd3f7 /Master | |
parent | 12e605cadfeb785841dfc3bfc7bb10d279ad55d2 (diff) |
nimsticks (9aug22)
git-svn-id: svn://tug.org/texlive/trunk@64084 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/nimsticks/README.md | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/nimsticks/nimsticks.pdf | bin | 78122 -> 107309 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/nimsticks/nimsticks.dtx | 31 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/nimsticks/nimsticks.sty | 10 |
4 files changed, 31 insertions, 16 deletions
diff --git a/Master/texmf-dist/doc/latex/nimsticks/README.md b/Master/texmf-dist/doc/latex/nimsticks/README.md index bc1d5a50f50..38b98216639 100644 --- a/Master/texmf-dist/doc/latex/nimsticks/README.md +++ b/Master/texmf-dist/doc/latex/nimsticks/README.md @@ -20,6 +20,12 @@ This work may be distributed and/or modified under the conditions of the [MIT li ## Changes +### [1.2] - 2022-08-09 + +- Switched `ifthen` to `etoolbox`; +- Switched `\begin{center}` to `\centering` (because the former doesn't work in `standalone` documents and the latter doesn't add vertical space); +- Removed some whitespace that appeared to the right of the last heap. + ### [1.1] - 2020-07-19 - Added option to create inline Nim game using `\nimgame[inline]{}`. diff --git a/Master/texmf-dist/doc/latex/nimsticks/nimsticks.pdf b/Master/texmf-dist/doc/latex/nimsticks/nimsticks.pdf Binary files differindex b2ee41b24de..bd85422db48 100644 --- a/Master/texmf-dist/doc/latex/nimsticks/nimsticks.pdf +++ b/Master/texmf-dist/doc/latex/nimsticks/nimsticks.pdf diff --git a/Master/texmf-dist/source/latex/nimsticks/nimsticks.dtx b/Master/texmf-dist/source/latex/nimsticks/nimsticks.dtx index 16e814d026a..6b81e198c41 100644 --- a/Master/texmf-dist/source/latex/nimsticks/nimsticks.dtx +++ b/Master/texmf-dist/source/latex/nimsticks/nimsticks.dtx @@ -1,5 +1,5 @@ %\iffalse meta-comment -%Copyright (c) 2020 Peter Rowlett +%Copyright (c) 2022 Peter Rowlett % %Permission is hereby granted, free of charge, to any person obtaining a copy %of this software and associated documentation files (the "Software"), to deal @@ -47,13 +47,11 @@ % %\nimgame{7} % -%The command \lstinline{\nimgame} presents the Nim game within \lstinline!\begin{center}...\end{center}!. An optional flag \lstinline{inline} can be used to produce the Nim game without the \lstinline{center} environment. For example, the command \lstinline!\nimgame[inline]{5,3,4}! will produce outline like this: \nimgame[inline]{5,3,4} -% -%One reason for this is that \lstinline{\nimgame} will not work in a \lstinline{standalone} document with the \lstinline{crop} option unless the \lstinline{inline} option is used. +%The command \lstinline{\nimgame} presents the Nim game within \lstinline!\centering!. An optional flag \lstinline{inline} can be used to produce the Nim game without the \lstinline{\centering}. For example, the command \lstinline!\nimgame[inline]{5,3,4}! will produce outline like this: \nimgame[inline]{5,3,4} % %It is likely the user will want to use \lstinline{\nimgame} and not \lstinline{\drawnimstick} directly, but the input \lstinline{\drawnimstick} will produce output like this: \drawnimstick % -%\section{Issues} +%\section{Warnings} % %There is no limit in the code to the number of piles or the number in a pile, but this code doesn't do anything to cope when line breaks start happening, and presumably there is a computational limit. % @@ -63,6 +61,17 @@ %\nimgame{1,2,3,4,5,6,7,8,9,10,9,8,7,6,5,4,3,2,1} %Similarly, if you have a lot of sticks in the same heap, it will wrap and look confusing, for example the input \lstinline!\nimgame{128}! will produce the output: %\nimgame{256} +%\section{Changes to usage or output} +% +% (for full change log, see GitHub \verb|README.md|) +% +% \begin{itemize} +% \item v1.1: added option to make inline Nim game. +% \item v1.2: \begin{itemize} +% \item switched \verb|\begin{center}| to \verb|\centering| (because the former doesn't work in \verb|standalone| documents and the latter doesn't add vertical space); +% \item removed some whitespace that appeared to the right of the last heap. +% \end{itemize} +%\end{itemize} %\iffalse %<*documentation> \documentclass{article} @@ -70,7 +79,7 @@ \usepackage{doc} \usepackage{listings} \lstset{basicstyle=\ttfamily\footnotesize,commentstyle=\color{white},language=TeX} -\title{nimsticks v1.1} +\title{nimsticks v1.2} \author{Peter Rowlett} \begin{document} \maketitle @@ -81,10 +90,10 @@ %\iffalse %<*nimsticks> -\ProvidesPackage{nimsticks}[2020/07/19 nimsticks 1.1] +\ProvidesPackage{nimsticks}[2022/08/09 nimsticks 1.2] \RequirePackage[first=-100,last=100,seed=0]{lcg} \RequirePackage{tikz} -\RequirePackage{ifthen} +\RequirePackage{etoolbox} \@ifundefined{drawnimstick}{} {\PackageWarning{nimsticks}{Command `drawnimstick' already defined}} \@ifundefined{nimgame}{} @@ -115,15 +124,15 @@ \end{tikzpicture}% } \newcommand{\nimgame}[2][block]{% - \ifthenelse{\equal{#1}{inline}}{}{\begin{center}}% + \ifstrequal{#1}{inline}{}{\bgroup\centering}% \def\listofgames{#2}% \foreach \heap in \listofgames {% \foreach \heapindex in {1, ..., \heap} {% \drawnimstick\hspace{0.5mm}% }% \hspace{10mm}% - }% - \ifthenelse{\equal{#1}{inline}}{}{\end{center}}% + }\hspace{-10mm}% + \ifstrequal{#1}{inline}{}{\par\egroup}% } %</nimsticks> %\fi diff --git a/Master/texmf-dist/tex/latex/nimsticks/nimsticks.sty b/Master/texmf-dist/tex/latex/nimsticks/nimsticks.sty index c00c10004ae..c21b2758462 100644 --- a/Master/texmf-dist/tex/latex/nimsticks/nimsticks.sty +++ b/Master/texmf-dist/tex/latex/nimsticks/nimsticks.sty @@ -26,10 +26,10 @@ %% SOFTWARE. %% -\ProvidesPackage{nimsticks}[2020/07/19 nimsticks 1.1] +\ProvidesPackage{nimsticks}[2022/08/09 nimsticks 1.2] \RequirePackage[first=-100,last=100,seed=0]{lcg} \RequirePackage{tikz} -\RequirePackage{ifthen} +\RequirePackage{etoolbox} \@ifundefined{drawnimstick}{} {\PackageWarning{nimsticks}{Command `drawnimstick' already defined}} \@ifundefined{nimgame}{} @@ -60,15 +60,15 @@ \end{tikzpicture}% } \newcommand{\nimgame}[2][block]{% - \ifthenelse{\equal{#1}{inline}}{}{\begin{center}}% + \ifstrequal{#1}{inline}{}{\bgroup\centering}% \def\listofgames{#2}% \foreach \heap in \listofgames {% \foreach \heapindex in {1, ..., \heap} {% \drawnimstick\hspace{0.5mm}% }% \hspace{10mm}% - }% - \ifthenelse{\equal{#1}{inline}}{}{\end{center}}% + }\hspace{-10mm}% + \ifstrequal{#1}{inline}{}{\par\egroup}% } \endinput %% |