From 007f67a693e4d031fd3d792df8e4d5f43e2cb2e7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 9 Jan 2006 00:49:07 +0000 Subject: doc/latex git-svn-id: svn://tug.org/texlive/trunk@84 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/skak/WC-2004-S-00007.tex | 98 ++ .../texmf-dist/doc/latex/skak/andreas_wilm_1.tex | 28 + Master/texmf-dist/doc/latex/skak/angletst.tex | 52 + Master/texmf-dist/doc/latex/skak/demo-symbols.tex | 43 + Master/texmf-dist/doc/latex/skak/font.tex | 32 + Master/texmf-dist/doc/latex/skak/games.tex | 72 ++ Master/texmf-dist/doc/latex/skak/hightest.tex | 309 ++++++ Master/texmf-dist/doc/latex/skak/informator.tex | 83 ++ Master/texmf-dist/doc/latex/skak/ingo-bug1.tex | 21 + Master/texmf-dist/doc/latex/skak/lambda.tex | 1146 ++++++++++++++++++++ Master/texmf-dist/doc/latex/skak/refman.tex | 309 ++++++ Master/texmf-dist/doc/latex/skak/skakdoc.tex | 417 +++++++ Master/texmf-dist/doc/latex/skak/syntax.tex | 321 ++++++ Master/texmf-dist/doc/latex/skak/test1.tex | 43 + Master/texmf-dist/doc/latex/skak/test2.tex | 41 + Master/texmf-dist/doc/latex/skak/tuggame.tex | 164 +++ 16 files changed, 3179 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/skak/WC-2004-S-00007.tex create mode 100644 Master/texmf-dist/doc/latex/skak/andreas_wilm_1.tex create mode 100644 Master/texmf-dist/doc/latex/skak/angletst.tex create mode 100644 Master/texmf-dist/doc/latex/skak/demo-symbols.tex create mode 100644 Master/texmf-dist/doc/latex/skak/font.tex create mode 100644 Master/texmf-dist/doc/latex/skak/games.tex create mode 100644 Master/texmf-dist/doc/latex/skak/hightest.tex create mode 100644 Master/texmf-dist/doc/latex/skak/informator.tex create mode 100644 Master/texmf-dist/doc/latex/skak/ingo-bug1.tex create mode 100644 Master/texmf-dist/doc/latex/skak/lambda.tex create mode 100644 Master/texmf-dist/doc/latex/skak/refman.tex create mode 100644 Master/texmf-dist/doc/latex/skak/skakdoc.tex create mode 100644 Master/texmf-dist/doc/latex/skak/syntax.tex create mode 100644 Master/texmf-dist/doc/latex/skak/test1.tex create mode 100644 Master/texmf-dist/doc/latex/skak/test2.tex create mode 100644 Master/texmf-dist/doc/latex/skak/tuggame.tex (limited to 'Master/texmf-dist/doc/latex/skak') diff --git a/Master/texmf-dist/doc/latex/skak/WC-2004-S-00007.tex b/Master/texmf-dist/doc/latex/skak/WC-2004-S-00007.tex new file mode 100644 index 00000000000..dc1fdf597e8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/WC-2004-S-00007.tex @@ -0,0 +1,98 @@ +\documentclass[german,twocolumn,a4paper,twoside,10pt]{article} + +\usepackage{skak} +\usepackage{babel} +\newcommand{\chessgame}[4]{ + \begin{center} + \large{\textbf{#1} -- \textbf{#2}} + + \textsf{#3} + + \small{\textsc{#4}} + \end{center} +} + +\title{Semifinal IECG WC2004} +\author{Ingo Sander} +\begin{document} + +\maketitle + +\chessgame{Anatoly Sidenko}{Ingo Sander}{IECG:WC-2004-Semifinal, 2002}{} +\styleB +\newgame +\mainline{1. d4 d5 2. Nf3 Nf6 3.Bf4 c5 4.e3 Nc6 5.c3} +\[\showboard\] + +\chessgame{Ingo Sander}{Davor Matic}{IECG:WC-2004-Semifinal, 2002}{K\"{o}nigsindisch} +\styleB +\newgame +\mainline{1. Nf3 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. d4 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. b4 a5 10. Ba3 Nd7} +%11. bxa5 Rxa5 12. Bb4 Ra8 13. a4 Bh6 14. a5 f5 15. Nd2 Nf6 16.c5 Bxd2 17.Qxd2 fxe4} +\[\showboard\] + +\chessgame{Ingo Sander}{Davor Matic}{IECG:WC-2004-Semifinal, 2002}{K\"{o}nigsindisch} +\styleB +\newgame +\mainline{1. Nf3 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. d4 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. b4 a5 10. Ba3 Nd7 11. bxa5 Rxa5 12. Bb4 Ra8 13. a4 Bh6 14. a5 f5 15. Nd2 Nf6 16.c5 Bxd2 17.Qxd2 fxe4} +\[\showboard\] + + +\chessgame{James Miller}{Ingo Sander}{IECG:WC-2004-Semifinal, 2002}{Caro-Kann} +\styleB +\newgame +\mainline{1.e4 c6 2.d4 d5 3.Nc3 dxe4 4.Nxe4 Nd7 5.Ng5 Ngf6 6.Bd3 e6 7.N1f3 Bd6 8.Qe2 h6 9.Ne4} +\[\showboard\] + +\chessgame{Ingo Sander}{Juan A. Fabiani}{IECG:WC-2004-Semifinal, 2002}{} +\styleB +\newgame +\mainline{1.Nf3 Nf6 2.c4 e6 3.Nc3 d5 4.d4 c6 5.e3 Nbd7} +\[\showboard\] + +\chessgame{Harold Edighoffer}{Ingo Sander}{IECG:WC-2004-Semifinal, 2002}{} +\styleB +\newgame +\mainline{1.e4 c6 2.d4 d5 3.e5 Bf5 4.Bd3 Bxd3} +\[\showboard\] + +\chessgame{Ingo Sander}{Alain Lacoste}{IECG:WC-2004-Semifinal, 2002}{Englisch 1. $\dots$ c5} +\styleB +\newgame +\mainline{1.Nf3 c5 2.c4 Nf6 3.Nc3 Nc6 4.g3 d5 5.d4 cxd4 6.Nxd4 dxc4 7.Nxc6 Qxd1+ 8.Nxd1 bxc6 9.Bg2 Nd5 10.Ne3 e6 11.Nxc4 Ba6 12.Na5 Bb4+ 13.Bd2 Bxa5 14.Bxa5 Rb8 +15.b3 Ke7} +\[\showboard\] + +\chessgame{Holger Kiefhaber}{Ingo Sander}{IECG:WC-2004-Semifinal, 2002}{Caro-Kann} +\styleB +\newgame +\mainline{1.e4 c6 2.d4 d5 3.exd5 cxd5 4.c4 Nf6 5.Nc3 e6 6.Nf3 Bb4 7.cxd5 Nxd5 8.Bd2 Nc6 9.Bd3 O-O 10.O-O Be7} +\[\showboard\] + +\chessgame{Ingo Sander}{Manfred Fritz}{IECG:WC-2004-Semifinal, 2002}{} +\styleB +\newgame +\mainline{1.Nf3 Nf6 2.c4 b6 3.g3 c5 4.Bg2 Bb7 5.O-O} +\[\showboard\] + +\begin{table*}[htbp] + \centering + \begin{tabular}{|llr|ccccccccc|c|c|} +\hline +Sidenko, Anatoly & RUS & 2293 & - & & & & & & & & & 0,0 & 1 \\ +Matic, Davor & CRO & 2310 & & - & & & & & & & & 0,0 & 1 \\ +Miller, James & ENG & 2109 & & & - & & & & & & & 0,0 & 1 \\ +Fabiani, Juan A. & ESP & 2382 & & & & - & & & & & & 0,0 & 1 \\ +Edighoffer, Harold & USA & 2433 & & & & & - & & & & & 0,0 & 1 \\ +Sander, Ingo & GER & 2197 & & & & & & - & & & & 0,0 & 1 \\ +Lacoste, Alain & FRA & 2009 & & & & & & & - & & & 0,0 & 1 \\ +Kiefhaber, Holger & GER & 2250 & & & & & & & & - & & 0,0 & 1 \\ +Fritz, Manfred & GER & 2348 & & & & & & & & & - & 0,0 & 1 \\ +\hline + \end{tabular} + \caption{Semifinale IECG WC 2004 (Gruppe 7)} + \label{tab:ResultatWC2004} +\end{table*} + +\end{document} + diff --git a/Master/texmf-dist/doc/latex/skak/andreas_wilm_1.tex b/Master/texmf-dist/doc/latex/skak/andreas_wilm_1.tex new file mode 100644 index 00000000000..ccc49ffc866 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/andreas_wilm_1.tex @@ -0,0 +1,28 @@ +\documentclass[twocolumn]{article} + +\usepackage{skak} + + +\begin{document} + +\styleC +\newgame + +\fenboard{r4q2/1b2nBrk/pp3p1p/4p3/4p3/2N1R2Q/PPP2PPP/R5K1 w - - 0 26} + +\[\showboard\] + +\mainline{26. Qxh6 Kxh6 27. Rh3+ Kg5} + + + +\[\showboard\] + + + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Master/texmf-dist/doc/latex/skak/angletst.tex b/Master/texmf-dist/doc/latex/skak/angletst.tex new file mode 100644 index 00000000000..7198260c861 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/angletst.tex @@ -0,0 +1,52 @@ +%% Name: angletst.tex +%% Author: Dirk Baechle +%% Date: 2003-01-23 + +\documentclass[12pt]{article} + +\usepackage[ps]{skak} + +\def\testfileangle#1#2#3{% + \texttt{#1 -> #2} + \printfileangle{#1}{#2} + should be: #3\newline} + +\def\testrankangle#1#2#3{% + \texttt{#1 -> #2} + \printrankangle{#1}{#2} + should be: #3\newline} + +\begin{document} + +\section{Test of the ``\texttt{fileangle}s''} + +\testfileangle{a}{b}{0} +\testfileangle{a}{c}{0} +\testfileangle{b}{a}{0}\testfileangle{b}{c}{0}\testfileangle{b}{d}{0} +\testfileangle{c}{a}{180}\testfileangle{c}{b}{0} +\testfileangle{c}{d}{0}\testfileangle{c}{e}{0} +\testfileangle{d}{b}{180}\testfileangle{d}{c}{0} +\testfileangle{d}{e}{0}\testfileangle{d}{f}{0} +\testfileangle{e}{c}{180}\testfileangle{e}{d}{0} +\testfileangle{e}{f}{0}\testfileangle{e}{g}{0} +\testfileangle{f}{d}{180}\testfileangle{f}{e}{0} +\testfileangle{f}{g}{0}\testfileangle{f}{h}{0} +\testfileangle{g}{e}{180}\testfileangle{g}{f}{0}\testfileangle{g}{h}{0} +\testfileangle{h}{f}{180}\testfileangle{h}{g}{0} + +\section{Test of the ``\texttt{rankangle}s''} + +\testrankangle{1}{2}{0}\testrankangle{1}{3}{90} +\testrankangle{2}{1}{0}\testrankangle{2}{3}{0}\testrankangle{2}{4}{90} +\testrankangle{3}{1}{270}\testrankangle{3}{2}{0} +\testrankangle{3}{4}{0}\testrankangle{3}{5}{90} +\testrankangle{4}{2}{270}\testrankangle{4}{3}{0} +\testrankangle{4}{5}{0}\testrankangle{4}{6}{90} +\testrankangle{5}{3}{270}\testrankangle{5}{4}{0} +\testrankangle{5}{6}{0}\testrankangle{5}{7}{90} +\testrankangle{6}{4}{270}\testrankangle{6}{5}{0} +\testrankangle{6}{7}{0}\testrankangle{6}{8}{90} +\testrankangle{7}{5}{270}\testrankangle{7}{6}{0}\testrankangle{7}{8}{0} +\testrankangle{8}{6}{270}\testrankangle{8}{7}{0} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/skak/demo-symbols.tex b/Master/texmf-dist/doc/latex/skak/demo-symbols.tex new file mode 100644 index 00000000000..17dd65f6572 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/demo-symbols.tex @@ -0,0 +1,43 @@ +\documentclass{article} +\usepackage{chess-workshop-symbols} +\begin{document} +\begin{tabular}{ll} +\verb|\wbetter| & \wbetter \\ +\verb|\bbetter| & \bbetter \\ +\verb|\wupperhand| & \wupperhand \\ +\verb|\bupperhand| & \bupperhand \\ +\verb|\wdecisive| & \wdecisive \\ +\verb|\bdecisive| & \bdecisive \\ +\verb|\equal| & \equal \\ +\verb|\unclear| & \unclear \\ +\verb|\compensation| & \compensation \\ +\verb|\withattack| & \withattack \\ +\verb|\withinit| & \withinit \\ +\verb|\counterplay| & \counterplay \\ +\verb|\zugzwang| & \zugzwang \\ +\verb|\mate| & \mate \\ +\verb|\withidea| & \withidea \\ +\verb|\onlymove| & \onlymove \\ +\verb|\betteris| & \betteris \\ +\verb|\file| & \file \\ +\verb|\diagonal| & \diagonal \\ +\verb|\kside| & \kside \\ +\verb|\qside| & \qside \\ +\verb|\weakpt| & \weakpt \\ +\verb|\bishoppair| & \bishoppair \\ +\verb|\opposbishops| & \opposbishops \\ +\verb|\samebishops| & \samebishops \\ +\verb|\unitedpawns| & \unitedpawns \\ +\verb|\seppawns| & \seppawns \\ +\verb|\doublepawns| & \doublepawns \\ +\verb|\morepawns| & \morepawns \\ +\verb|\timelimit| & \timelimit \\ +\verb|\novelty| & \novelty \\ +\verb|\comment| & \comment \\ +\verb|\various| & \various \\ +\verb|\without| & \without \\ +\verb|\with| & \with \\ +\verb|\etc| & \etc \\ +\verb|\see| & \see \\ +\end{tabular} +\end{document} diff --git a/Master/texmf-dist/doc/latex/skak/font.tex b/Master/texmf-dist/doc/latex/skak/font.tex new file mode 100644 index 00000000000..d126b999e06 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/font.tex @@ -0,0 +1,32 @@ + + +\documentclass[11pt,twocolumn]{article} + +\usepackage[ps,mover]{skak} + +\title{font\\Verifying that the fonts behave properly} +\author{Torben Hoffmann } + +\begin{document} + +\parindent=0pt + +\maketitle + + +\section{In a section command: \wmove{Nf6}\counterplay} + +\textbf{In bold font:\wmove{Nf6}\counterplay} (\wmove{Nf}\counterplay +in normal thickness.) + +{\Huge In a Huge font: \wmove{Nf6}\counterplay} + + + +\end{document} + + + + + + diff --git a/Master/texmf-dist/doc/latex/skak/games.tex b/Master/texmf-dist/doc/latex/skak/games.tex new file mode 100644 index 00000000000..67dcb264cc5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/games.tex @@ -0,0 +1,72 @@ +\documentclass[german, twocolumn,a4paper,twoside,10pt]{article} + +\usepackage{skak} +\usepackage{babel} +\newcommand{\chessgame}[4]{ + \begin{center} + \large{\textbf{#1} -- \textbf{#2}} + + \textsf{#3} + + \small{\textsc{#4}} + \end{center} +} + +\title{Tournament} +\author{Franz Meier} +\begin{document} + +\maketitle + +\chessgame{Hans Schulze}{Franz Meier}{Tournament, 2002}{} +\styleB +\newgame +\mainline{1. d4 d5 2. Nf3 Nf6 3.Bf4 c5 4.e3 Nc6 5.c3} +\[\showboard\] + +\chessgame{Franz Meier}{Gustav Frank}{Tournament, 2002}{K\"{o}nigsindisch} +\styleB +\newgame +\mainline{1. Nf3 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5. d4 O-O 6. Be2 e5 7. O-O Nc6 8. d5 Ne7 9. b4 a5 10. Ba3 Nd7 11. bxa5 Rxa5 12. Bb4 Ra8 13. a4 Bh6 14. a5 f5 15. Nd2 Nf6 16.c5 Bxd2 17.Qxd2 fxe4} +\[\showboard\] + + +\chessgame{John Bauer}{Franz Meier}{Tournament, 2002}{Caro-Kann} +\styleB +\newgame +\mainline{1.e4 c6 2.d4 d5 3.Nc3 dxe4 4.Nxe4 Nd7 5.Ng5 Ngf6 6.Bd3 e6 7.N1f3 Bd6 8.Qe2 h6 9.Ne4} +\[\showboard\] + +\chessgame{Franz Meier}{Karl Adams}{Tournament, 2002}{} +\styleB +\newgame +\mainline{1.Nf3 Nf6 2.c4 e6 3.Nc3 d5 4.d4 c6 5.e3 Nbd7} +\[\showboard\] + +\chessgame{Christian Klaus}{Franz Meier}{Tournament, 2002}{} +\styleB +\newgame +\mainline{1.e4 c6 2.d4 d5 3.e5 Bf5 4.Bd3 Bxd3} +\[\showboard\] + +\chessgame{Franz Meier}{Norbert Ludwig}{Tournament, 2002}{Englisch 1. $\dots$ c5} +\styleB +\newgame +\mainline{1.Nf3 c5 2.c4 Nf6 3.Nc3 Nc6 4.g3 d5 5.d4 cxd4 6.Nxd4 dxc4 7.Nxc6 Qxd1+ 8.Nxd1 bxc6 9.Bg2 Nd5 10.Ne3 e6 11.Nxc4 Ba6 12.Na5 Bb4+ 13.Bd2 Bxa5 14.Bxa5 Rb8 +15.b3 Ke7} +\[\showboard\] + +\chessgame{Dieter Klose}{Franz Meier}{Tournament, 2002}{Caro-Kann} +\styleB +\newgame +\mainline{1.e4 c6 2.d4 d5 3.exd5 cxd5 4.c4 Nf6 5.Nc3 e6 6.Nf3 Bb4 7.cxd5 Nxd5 8.Bd2 Nc6 9.Bd3 O-O 10.O-O Be7} +\[\showboard\] + +\chessgame{Franz Meier}{Karl Eich}{Tournament, 2002}{} +\styleB +\newgame +\mainline{1.Nf3 Nf6 2.c4 b6 3.g3 c5 4.Bg2 Bb7 5.O-O} +\[\showboard\] + +\end{document} + diff --git a/Master/texmf-dist/doc/latex/skak/hightest.tex b/Master/texmf-dist/doc/latex/skak/hightest.tex new file mode 100644 index 00000000000..24a4e553cf7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/hightest.tex @@ -0,0 +1,309 @@ +%% Name: hightest.tex +%% Author: Dirk Baechle +%% Date: 2003-01-22 + +\documentclass[a4paper, twocolumn]{article} +\usepackage[ps]{skak} +\tinyboard + +\setlength{\parindent}{0pt} + +\def\square#1{\texttt{#1}} +\def\testarrow#1#2{% + \printarrow{#1}{#2} + \mbox{\texttt{(#1 -> #2)}}} + +\def\testknightmove#1#2{% + \printknightmove{#1}{#2} + \mbox{\texttt{(#1 -> #2)}}} + +\pagestyle{empty} + +\begin{document} + +\section{Test of the ``\texttt{highlight}'' command} + +In all following boards there should appear + +\begin{itemize} +\item frames on \square{g1}, \square{f2} and \square{e3} +\item a small cross on \square{a1}, +\item a large cross on \square{a8}, +\item a small circle on \square{h1} and +\item a large circle on \square{h8}. +\end{itemize} + +\subsection{White to move} +\subsubsection{With notation} + +\fenboard{2rr3k/pp3pp1/1nnqbN1p/3pN3/2pP4/2P3Q1/PPB4P/R4RK1 w KQkq - 0 1} +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\subsubsection{Without notation} +\notationOff + +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\subsubsection{With mover} +\showmoverOn +\notationOn + +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\notationOff +\medskip +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\subsection{Black to move} +\subsubsection{With notation} +\notationOn +\showmoverOff +\fenboard{2rr3k/pp3pp1/1nnqbN1p/3pN3/2pP4/2P3Q1/PPB4P/R4RK1 b KQkq - 0 1} +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\subsubsection{Without notation} +\notationOff + +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\subsubsection{With mover} +\showmoverOn +\notationOn + +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\notationOff +\medskip +\centerline{\showboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\medskip +\centerline{\showinverseboard} +\highlight{g1,f2,e3} +\highlight[x]{a1} +\highlight[X]{a8} +\highlight[o]{h1} +\highlight[O]{h8} + +\section{Test of the ``\texttt{printarrow}'' command} + +%% Init board +\notationOn +\showmoverOff +\fenboard{2rr3k/pp3pp1/1nnqbN1p/3pN3/2pP4/2P3Q1/PPB4P/R4RK1 w KQkq - 0 1} + +\subsection{From lower to upper half} + +\centerline{\showboard} +\testarrow{a1}{a8} +\testarrow{f3}{e6} +\testarrow{g4}{h7} + +\newpage +\centerline{\showinverseboard} +\testarrow{a1}{a8} +\testarrow{f3}{e6} +\testarrow{g4}{h7} + +\subsection{From upper to lower half} +\centerline{\showboard} +\testarrow{h8}{h1} +\testarrow{f7}{c2} +\testarrow{b6}{g3} + +\medskip +\centerline{\showinverseboard} +\testarrow{h8}{h1} +\testarrow{f7}{c2} +\testarrow{b6}{g3} + +\subsection{From left to right half} +\centerline{\showboard} +\testarrow{a1}{h1} +\testarrow{b2}{h8} +\testarrow{c7}{g3} + +\medskip +\centerline{\showinverseboard} +\testarrow{a1}{h1} +\testarrow{b2}{h8} +\testarrow{c7}{g3} + +\subsection{From right to left half} +\centerline{\showboard} +\testarrow{h8}{a8} +\testarrow{g6}{a4} +\testarrow{f3}{c5} + +\medskip +\centerline{\showinverseboard} +\testarrow{h8}{a8} +\testarrow{g6}{a4} +\testarrow{f3}{c5} + +\section{Test of the ``\texttt{printknightmove}'' command} + +\subsection{Upwards} +\centerline{\showboard} +\testknightmove{d4}{b5} +\testknightmove{d4}{c6} +\testknightmove{d4}{e6} +\testknightmove{d4}{f5} + +\medskip +\centerline{\showinverseboard} +\testknightmove{d4}{b5} +\testknightmove{d4}{c6} +\testknightmove{d4}{e6} +\testknightmove{d4}{f5} + +\subsection{Downwards} +\centerline{\showboard} +\testknightmove{e6}{c5} +\testknightmove{e6}{d4} +\testknightmove{e6}{f4} +\testknightmove{e6}{g5} + +\medskip +\centerline{\showinverseboard} +\testknightmove{e6}{c5} +\testknightmove{e6}{d4} +\testknightmove{e6}{f4} +\testknightmove{e6}{g5} + +\subsection{To the right} +\centerline{\showboard} +\testknightmove{b4}{c6} +\testknightmove{b4}{d5} +\testknightmove{b4}{d3} +\testknightmove{b4}{c2} + +\medskip +\centerline{\showinverseboard} +\testknightmove{b4}{c6} +\testknightmove{b4}{d5} +\testknightmove{b4}{d3} +\testknightmove{b4}{c2} + +\subsection{To the left} +\centerline{\showboard} +\testknightmove{f5}{e7} +\testknightmove{f5}{d6} +\testknightmove{f5}{d4} +\testknightmove{f5}{e3} + +\medskip +\centerline{\showinverseboard} +\testknightmove{f5}{e7} +\testknightmove{f5}{d6} +\testknightmove{f5}{d4} +\testknightmove{f5}{e3} + +\subsection{From the corners} +\centerline{\showboard} +\testknightmove{a1}{b3} +\testknightmove{a1}{c2} +\testknightmove{a8}{c7} +\testknightmove{a8}{b6} +\testknightmove{h8}{g6} +\testknightmove{h8}{f7} +\testknightmove{h1}{g3} +\testknightmove{h1}{f2} + +\end{document} + diff --git a/Master/texmf-dist/doc/latex/skak/informator.tex b/Master/texmf-dist/doc/latex/skak/informator.tex new file mode 100644 index 00000000000..737e7529fa5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/informator.tex @@ -0,0 +1,83 @@ +\documentclass[a4paper,twocolumn]{article} + +\usepackage{booktabs} +\pagestyle{empty} + + +\usepackage[ps]{skak} +\newcommand{\Cmd}[1]{\textsf{\textbf{\textbackslash#1}}} + +\title{Informator Symbols Available in the \texttt{skak} Package} +\author{Torben Hoffmann} +\begin{document} + +\maketitle + +Dirk B\"achle has been so kind as to create a number of the symbols +used in the Informator. They are now a part of the skak font. + +\begin{tabular}{lc} +\toprule +Command & \multicolumn{1}{l}{Output}\\ \midrule +\Cmd{wbetter} & \wbetter \\ +\Cmd{bbetter} & \bbetter \\ +\Cmd{wupperhand} & \wupperhand \\ +\Cmd{bupperhand} & \bupperhand \\ +\Cmd{wdecisive} & \wdecisive \\ +\Cmd{bdecisive} & \bdecisive \\ +\Cmd{equal} & \equal \\ +\Cmd{unclear} & \unclear \\ +\Cmd{compensation} & \compensation \\ +\Cmd{devadvantage} & \devadvantage \\ +\Cmd{moreroom} & \moreroom \\ +\Cmd{withattack} & \withattack \\ +\Cmd{withinit} & \withinit \\ +\Cmd{counterplay} & \counterplay \\ +\Cmd{zugzwang} & \zugzwang \\ +\Cmd{mate} & \mate \\ +\Cmd{withidea} & \withidea \\ +\Cmd{onlymove} & \onlymove \\ +\Cmd{betteris} & \betteris \\ +\Cmd{file} & \file \\ +\Cmd{diagonal} & \diagonal \\ +\Cmd{centre} & \centre \\ +\Cmd{kside} & \kside \\ +\Cmd{qside} & \qside \\ +\bottomrule +\end{tabular} + + +\begin{tabular}{lc} +\toprule +Command & \multicolumn{1}{l}{Output}\\ \midrule + +\Cmd{weakpt} & \weakpt \\ +\Cmd{ending} & \ending \\ + + +\Cmd{bishoppair} & \bishoppair \\ +\Cmd{opposbishops} & \opposbishops \\ +\Cmd{samebishops} & \samebishops \\ + +\Cmd{unitedpawns} & \unitedpawns \\ +\Cmd{seppawns} & \seppawns \\ +\Cmd{doublepawns} & \doublepawns \\ +\Cmd{passedpawn} & \passedpawn \\ +\Cmd{morepawns} & \morepawns \\ +\Cmd{timelimit} & \timelimit \\ +\Cmd{novelty} & \novelty \\ +\Cmd{comment} & \comment \\ +\Cmd{various} & \various \\ +\Cmd{without} & \without \\ +\Cmd{with} & \with \\ +\Cmd{etc} & \etc \\ +\Cmd{see} & \see \\ + +\Cmd{markera} & \markera \\ +\Cmd{markerb} & \markerb \\ +\bottomrule +\end{tabular} + + + +\end{document} diff --git a/Master/texmf-dist/doc/latex/skak/ingo-bug1.tex b/Master/texmf-dist/doc/latex/skak/ingo-bug1.tex new file mode 100644 index 00000000000..bc0ef9508a4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/ingo-bug1.tex @@ -0,0 +1,21 @@ +\documentclass[german,twocolumn]{article} + +\usepackage{skak} +\usepackage[german]{babel} + + +\begin{document} + +\styleC +\newgame + +\mainline{1. Nf3 Nf6 2. c4 g6 3. Nc3 Bg7 4. e4 d6 5.d4 O-O 6. Be2 e5 + 7. O-O Nc6 8. d5 Ne7 9. b4 a5 10. Ba3 Nd7 11. bxa5 Rxa5 12. Bb4 Ra8 + 13. a4 Bh6 14. a5 f5 15. Nd2 Nf6 16.c5 Bxd2 17.Qxd2 fxe4} + + +\[\showboard\] + + + +\end{document} diff --git a/Master/texmf-dist/doc/latex/skak/lambda.tex b/Master/texmf-dist/doc/latex/skak/lambda.tex new file mode 100644 index 00000000000..5285e9a5104 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/lambda.tex @@ -0,0 +1,1146 @@ +% Filename: Lambda.tex +% Author: Alan Jeffrey +% Last modified: 11 May 1990 +% +% Copyright (c) 1990 Alan Jeffrey. Permission is granted to Tugboat +% to publish any or all of this. +% +% A keyboard check: +% +% @ # $ % ^ & * ~ at hash dollar percent caret ampersand asterisk tilde +% : ; , . colon semicolon comma period +% ? ! question-mark exclamation-mark +% " ' ` double-quote apostrophe back-quote +% ( ) { } [ ] parentheses braces square-brackets +% - + = / \ minus plus equals forward-slash backslash +% _ | < > underscore vertical-bar less-than greater-than +% + +\documentstyle[ltugboat,Lambda]{article} + +% This document defines a whole load of extra commands, some of which +% over-ride how LaTeX normally lays things out. For example, ~ is +% redefined to give a hairspace in math mode. This whole document +% should probably be put in a group to stop it getting in the way +% of other articles' macros. + +\title{Lists in \TeX's Mouth} + +\author{Alan Jeffrey} + +\address{Programming Research Group\\ + Oxford University\\ + 11 Keble Road\\ + Oxford OX1 3QD} + +\netaddress{Alan.Jeffrey@uk.ac.oxford.prg} + +\makeatletter + +% The mathcodes for the letters A, ..., Z, a, ..., z are changed to +% generate text italic rather than math italic by default. This makes +% multi-letter names look neater. The mathcode for character 'c' +% is set to "7000 (variable family) + "400 (text italic) + c. +% +% This neat bit of code is due to Mike Spivey. + +\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3 + \loop \global\mathcode\count0=\count1 \ifnum \count0<#2 + \advance\count0 by1 \advance\count1 by1 \repeat}} + +\@setmcodes{`A}{`Z}{"7441} +\@setmcodes{`a}{`z}{"7461} + +\def\Number#1{\csname Number-#1\endcsname} +\def\Label#1{\csname Label-#1\endcsname} + +\newcount\Lastnum + +\def\Forward#1% + {\global\advance\Lastnum by 1 + \csnameafter\xdef{Number-#1}% + {\the\Lastnum}% + \csnameafter\xdef{Label-\the\Lastnum}% + {\@currentlabel}} + +\def\csnameafter#1#2% + {\expandafter#1\csname#2\endcsname} + +\def\Bylist#1% + {\Map\Label + {\Insertsort\Lessthan + {\Map\Number{#1}}}} + +\def\By{\Show\Bylist} + +\let\bindspace=~ +\def~{\ifmmode \, \else \bindspace \fi} + +\def\start#1{\lefteqn{#1}\quad\\} + +\def\nil{[\,\,]} + +\newtheorem{fact}{Fact} +\def\thefact{\@roman\c@fact} + +\def\cstok#1{\leavevmode\thinspace\hbox{\vrule\vtop{\vbox{\hrule\kern1pt + \hbox{\vphantom{\tt/}\thinspace{\tt#1}\thinspace}}% + \kern1pt\hrule}\vrule}\thinspace} + +\begingroup \catcode `|=0 \catcode `[= 1 +\catcode`]=2 \catcode `\{=12 \catcode `\}=12 +\catcode`\\=12 |gdef|@xTeXcode#1\end{TeXcode}[#1|end[TeXcode]] +|endgroup + +\def\TeXcode + {\@verbatim \smallskip\hrule\medskip \frenchspacing\@vobeyspaces \@xTeXcode} +\def\endTeXcode + {\medskip\hrule\smallskip\endtrivlist} + +\makeatother + +\begin{document} + +\maketitle + +\section{Why lists?} + +Originally, I wanted lists in \TeX\ for +a paper I was writing which contained a lot of facts. +\begin{fact} +\Forward{Fac-cows} + Cows have four legs. +\end{fact} +\begin{fact} +\Forward{Fac-people} + People have two legs. +\end{fact} +\begin{fact} +\Forward{Fac-yawn} + Lots of facts in a row can be dull. +\end{fact} +These are generated with commands like +\begin{verbatim} +\begin{fact} +\Forward{Fac-yawn} + Lots of facts in a row can be dull. +\end{fact} +\end{verbatim} +I can then refer to these facts by saying +\begin{verbatim} +\By[Fac-yawn,Fac-cows,Fac-people] +\end{verbatim} +to get +\By[Fac-yawn,Fac-cows,Fac-people]. +And as if by magic, the facts come out sorted, rather than in +the jumbled order I typed them. This is very useful, as I can +reorganize my document to my heart's content, and not have to worry +about getting my facts straight. + +Originally I tried programming this sorting routine in \TeX's +list macros, from Appendix~D of \TB, but I soon ran into trouble. +The problem is that all the Appendix~D macros work by assigning +values to macros. For example: +\begin{verbatim} +\concatenate\foo=\bar\baz +\end{verbatim} +expands out to +\begin{verbatim} +\ta=\expandafter{\bar} +\tb=\expandafter{\baz} +\edef\foo{\the\ta\the\tb} +\end{verbatim} +which assigns the macro \verb|\foo| the contents of \verb|\bar| +followed by the contents of \verb|\baz|. Programming sorting routines +(which are usually recursive) in terms of these lists became rather +painful, as I was constantly having to watch out for local variables, +worrying about what happened if a local variable had the same name +as a global one, and generally having a hard time. + +Then I had one of those ``flash of light'' experiences --- +``You can do lambda-calculus in \TeX,'' I thought, +and since you can do lists directly in lambda calculus, +you should be able to do lists straightforwardly in \TeX. And so you +can. Well, fairly straightforwardly anyway. + +So I went and did a bit of mathematics, and derived the \TeX\ macros +you see here. They were formally verified, and worked first time +(modulo typing errors, of which there were two). + +\section{\TeX's mouth and \TeX's stomach} + +\TeX's programming facilities come in two forms --- there are \TeX's +{\em macros\/} which are expanded in its mouth, and some additional +{\em assignment\/} operations like \verb|\def| which take place in the +stomach. \TeX\ can often spring surprises on you as exactly what +gets evaluated where. +For example, in \LaTeX\ I can put down a +label by saying \verb|\label{Here}|. +\label{Here} +Then I can refer back to that label by saying +\verb|Section~\ref{Here}|, which +produces Section~\ref{Here}. Unfortunately, \verb|\ref{Here}| does +{\em not\/} expand out to {\tt\ref{Here}}! Instead, it expands out to: +\begin{verbatim} +\edef\@tempa{\@nameuse{r@Here}} +\expandafter\@car\@tempa\@nil\null +\end{verbatim} +This means that I can't say +\begin{verbatim} +\ifnum\ref{Here}<4 Hello\fi +\end{verbatim} +and hope that this will expand out to Hello. Instead I +get an error message. Which is rather a pity, as \TeX's mouth is +quite a powerful programming language (as powerful as a Turing Machine in +fact). + +\section{Functions} + +A {\em function\/} is a mathematical object that takes in an argument +(which could well be another function) and returns some other mathematical +object. For example the function $Not$ takes in a boolean and returns +its complement. I'll write function application without brackets, +so $Not~b$ is the boolean complement of $b$. + +Function application +binds to the left, so $f~a~b$ is $(f~a)~b$ rather than $f~(a~b)$. +For example, $Or~a~b$ is the boolean or of $a$ and $b$, and +$Or~True$ is a perfectly good function that takes in a boolean +and returns $True$. + +The obvious equivalents of functions in \TeX\ are macros --- +if I define a function $Foo$ to be: +\begin{eqnarray*} + Foo~x & = & True +\end{eqnarray*} +then it can be translated into \TeX\ as: +\begin{verbatim} +\def\Foo#1{\True} +\end{verbatim} +So where $Foo$ is a function that takes in one argument, \verb|\Foo| +is a macro that takes in one parameter. Nothing has changed except +the jargon and the font. \TeX\ macros can even be partially applied, +for example if we defined: +\begin{eqnarray*} + Baz & = & Or~True +\end{eqnarray*} +then the \TeX\ equivalent would be +\begin{verbatim} +\def\Baz{\Or\True} +\end{verbatim} +Once \verb|\Baz| is expanded, it will expect to be given a parameter, +but when we are defining things, we can go around partially applying +them all we like. + +Here, I'm using $=$ without formally defining it, which is rather +naughty. If I say $x = y$, this means +``given enough parameters, $x$ and $y$ will eventually +expand out to the same thing.'' For example $Foo = Baz$, because +for any $x$, +\begin{eqnarray*} + \start{Foo~x} + & = & True \\ + & = & Or~True~x \\ + & = & Baz~x +\end{eqnarray*} +Normally, functions have to {respect equality\/} which means that: +\begin{itemize} +\item if $x = y$ then $f~x = f~y$, and +\item if $x$ respects equality, then $f~x$ respects equality. +\end{itemize} +However, some \TeX\ control sequences don't obey this. For example, +\verb|\string\Foo| and \verb|\string\Baz| are different, even though +$Foo = Baz$. Hence $string$ doesn't respect equality. +Unless otherwise stated, we won't assume functions respect equality, +although all the functions defined here do. + +All of our functions have capital letters, so that their \TeX\ equivalents +(\verb|\Not|, \verb|\Or| and so on) don't clash with standard \TeX\ or +\LaTeX\ macros. + +\subsection{Identity} + +The simplest function is the {\em identity\/} function, called +$Identity$ funnily enough, which is defined: +\begin{eqnarray*} + Identity~x & = & \Identity{x} +\end{eqnarray*} +This, it must be admitted, is a pretty dull function, but +it's a useful basic combinator. It can be implemented +in \TeX\ quite simply. +\begin{TeXcode} +\def\Identity#1{#1} +\end{TeXcode} +The rules around this definition mean that it is actually part of +\verb|Lambda.sty| and not just another example. + +\subsection{Error} + +Whereas $Identity$ does nothing in a fairly pleasant sort of way, +$Error$ does nothing in a particularly brutal and harsh fashion. +Mathematically, $Error$ is the function that destroys everything +else in front of it. It is often written as $\perp$. +\begin{eqnarray*} + Error~x & = & Error +\end{eqnarray*} +In practice, destroying the entire document when we hit one error +is a bit much, so we'll just print out an error message. +The user can carry on past an error at their own risk, as the code +will no longer be formally verified. +\begin{TeXcode} +\def\Error + {\errmessage{Abandon verification all + ye who enter here}} +\end{TeXcode} +Maybe this function ought to return a more useful error message \ldots + +\subsection{First and Second} + +Two other basic functions are $First$ and $Second$, both of which +take in two arguments, and do the obvious thing. They are defined: +\begin{eqnarray*} + First~x~y & = & x \\ + Second~x~y & = & y +\end{eqnarray*} +We could, in +fact, define $Second$ in terms of $Identity$ and $First$. +For any $x$ and $y$, +\begin{eqnarray*} + \start{First~Identity~x~y} + & = & Identity~y \\ + & = & y \\ + & = & Second~x~y +\end{eqnarray*} +So $First~Identity = Second$. This means that anywhere in our \TeX\ code +we have \verb|\First\Identity| we could replace it by \verb|\Second|. +This is perhaps not the most astonishing \TeX\ fact known to humanity, +but this sort of proof did enable more complex bits of \TeX\ to be +verified before they were run. + +The \TeX\ definitions of \verb|\First| and \verb|\Second| are pretty +obvious. +\begin{TeXcode} +\def\First#1#2{#1} +\def\Second#1#2{#2} +\end{TeXcode} +Note that in \TeX\, \verb|\First\foo\bar| expands out to +\verb|\foo| {\em without\/} expanding out \verb|\bar|. +This is very useful, as we can write macros that would take +forever and a day to run if they expanded all their arguments, +but which actually terminate quite quickly. This is called +{\em lazy evaluation\/} by the functional programming community. + +\subsection{Compose} + +Given two functions $f$ and $g$ we would like to be able to {\em compose\/} +them to produce a function that first applies $g$ then applies $f$. +Normally, this is written as $f \circ g$, but unfortunately \TeX\ doesn't +have infix functions, so we'll have to write it $Compose~f~g$. +\begin{eqnarray*} + Compose~f~g~x & = & f~(g~x) +\end{eqnarray*} +>From this definition, we can deduce that $Compose$ is associative: +\begin{eqnarray*} + \start{Compose~(Compose~f~g)~h} + & = & Compose~f~(Compose~g~h) +\end{eqnarray*} +and $Identity$ is the left unit of $Compose$: +\begin{eqnarray*} + Compose~Identity~f & = & f +\end{eqnarray*} +The reader may wonder why $Identity$ is called a {\em left\/} unit +even though it occurs on the right of the $Compose$ --- this is a side-effect +of using prefix notations where infix is more normal. The infix version +of this equation is: +\begin{eqnarray*} + Identity \circ f & = & f +\end{eqnarray*} +so $Identity$ is indeed on the left of the composition. + +$Compose$ can be implemented in \TeX\ as +\begin{TeXcode} +\def\Compose#1#2#3{#1{#2{#3}}} +\end{TeXcode} + +\subsection{Twiddle} + +Yet another useful little function is $Twiddle$, which takes in +a function and reverses the order that function takes its (first two) +arguments. +\begin{eqnarray*} + Twiddle~f~x~y & = & f~y~x +\end{eqnarray*} +Again, there aren't many immediate uses for such a function, but it'll +come in handy later on. It satisfies the properties +\begin{eqnarray*} + Twiddle~First & = & Second \\ + Twiddle~Second & = & First \\ + Compose~Twiddle~Twiddle & = & Identity +\end{eqnarray*} +Its \TeX\ equivalent is +\begin{TeXcode} +\def\Twiddle#1#2#3{#1{#3}{#2}} +\end{TeXcode} +This function is called ``twiddle'' because it is sometimes written +$\widetilde f$ (and $\sim$ is pronounced ``twiddle''). +It also twiddles its arguments around, +which is quite nice if your sense of humour runs to appalling puns. + +\section{Booleans} + +As we're trying to program a sorting routine, it would be nice to +be able to define orderings on things, and to do this we need some +representation of boolean variables. Unfortunately \TeX\ doesn't have a type +for booleans, so we'll have to invent our own. We'll +implement a boolean as a function $b$ of the form +\begin{eqnarray*} + b~x~y & + = & + \left\{ + \begin{array}{ll} + x & \mbox{if $b$ is true} \\ + y & \mbox{otherwise} + \end{array} + \right. +\end{eqnarray*} +More formally, a +boolean $b$ is a function which respects equality, +such that for all $f$, $g$ and $z$: +\begin{eqnarray*} + b~f~g~z & = & b~(f~z)~(g~z) +\end{eqnarray*} +and for all $f$ and $g$ which respect equality, +\begin{eqnarray*} + b~(f~b)~(g~b) & = & b~(f~First)~(g~Second) +\end{eqnarray*} +All the functions in this section satisfy these properties. Surprisingly +enough, so does $Error$, which is quite useful, as it allows us to +reason about booleans which ``go wrong''. + +\subsection{True, False and Not} + +Since we are implementing booleans as functions, we already have the +definitions of $True$, $False$ and $Not$. +\begin{eqnarray*} + True & = & First \\ + False & = & Second \\ + Not & = & Twiddle +\end{eqnarray*} +So for free we get the following results: +\begin{eqnarray*} + Not~True & = & False \\ + Not~False & = & True \\ + Compose~Not~Not & = & Identity +\end{eqnarray*} +The \TeX\ implementation is not exactly difficult: +\begin{TeXcode} +\let\True=\First +\let\False=\Second +\let\Not=\Twiddle +\end{TeXcode} + +\subsection{And and Or} + +The definitions of $And$ and $Or$ are: +\begin{eqnarray*} + And~a~b & + = & + \left\{ + \begin{array}{ll} + b & \mbox{if $a$ is true} \\ + False & \mbox{otherwise} + \end{array} + \right. + \\ + Or~a~b & + = & + \left\{ + \begin{array}{ll} + True & \mbox{if $a$ is true} \\ + b & \mbox{otherwise} + \end{array} + \right. +\end{eqnarray*} +With our definition of what a boolean is, this is just the same as +\begin{eqnarray*} + And~a~b & = & a~b~False \\ + Or~a~b & = & a~True~b +\end{eqnarray*} +>From these conditions, we can show that $And$ is associative, and +has left unit $True$ and left zeros $False$ and $Error$: +\begin{eqnarray*} + And~(And~a~b)~c & = & And~a~(And~b~c) \\ + And~True~b & = & b \\ + And~False~b & = & False \\ + And~Error~b & = & Error +\end{eqnarray*} +$Or$ is associative, has left unit $False$ and left zeros $True$ and $Error$: +\begin{eqnarray*} + Or~(Or~a~b)~c & = & Or~a~(Or~b~c) \\ + Or~False~b & = & b \\ + Or~True~b & = & True \\ + Or~Error~b & = & Error +\end{eqnarray*} +De~Morgan's laws hold: +\begin{eqnarray*} + Not~(And~a~b) & = & Or~(Not~a)~(Not~b) \\ + Not~(Or~a~b) & = & And~(Not~a)~(Not~b) +\end{eqnarray*} +and $And$ and $Or$ left-distribute through one another: +\begin{eqnarray*} + Or~a~(And~b~c) & = & And~(Or~a~b)~(Or~a~c) \\ + And~a~(Or~b~c) & = & Or~(And~a~b)~(And~a~c) +\end{eqnarray*} +$And$ and $Or$ are {\em not\/} commutative, though. For example, +\begin{eqnarray*} + \start{Or~True~Error} + & = & True~True~Error \\ + & = & True +\end{eqnarray*} +but +\begin{eqnarray*} + \start{Or~Error~True} + & = & Error~True~True \\ + & = & Error +\end{eqnarray*} +This is actually quite useful since there are some booleans that +need to return an error occasionally. If $a$ is $True$ when $b$ +is safe (i.e.\ doesn't become $Error$) and is $False$ otherwise, we can +say $Or~a~b$ and know we're not going to get an error. This is handy +for things like checking for division by zero, or trying to get the +first element of an empty list. + +Similarly, because of the possibility of $Error$, +$And$ and $Or$ don't right-distribute through each other, +as +\begin{eqnarray*} + \start{Or~(And~False~Error)~True} + & \ne & And~(Or~False~True)~(Or~Error~True) +\end{eqnarray*} +As errors shouldn't crop up, this needn't worry us too much. +\begin{TeXcode} +\def\And#1#2{#1{#2}\False} +\def\Or#1#2{#1\True{#2}} +\end{TeXcode} + +\subsection{Lift} + +Quite a lot of the time we won't be dealing with booleans, but with +{\em predicates}, which are just functions that return a boolean. +For example, the predicate $Lessthan$ is defined below so that +$Lessthan~i~j$ is true whenever $i\bnfor{} \bnf{MT} +\end{tabbing} +\end{minipage} +\end{center} + +using BNF (Backus-Naur Form) notation with `\bnfterm{space}' as the +terminal symbol for the character '\ ' (ASCII code +32\base{10}). + +\section*{Stage 2: Splitting off move numbers} + +Each \abbrev{MT} may be either a chess move (\abbrev{CM}), a move number (\abbrev{MN}) +or a token like ``\texttt{2.Kg1}'' that combines both: + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MT} \bnfprod\={} \bnf{MN} \bnf{CM}\\ + \>\bnfor{} \bnf{CM}\\ + \>\bnfor{} \bnf{MN} +\end{tabbing} +\end{minipage} +\end{center} + +The only task of this stage is to separate ``combined tokens'' (first rule in the +production above) and, therefore, supply the next stage 3 with a steady stream +of single move tokens (\abbrev{M}). + +\begin{quote} +Remark: This ``separation'' probably has to be done by inspecting the whole +token character for character. Thus, it appears to be efficient to already +collect information about the move number \abbrev{MN} (White/Black to move, +getting the number itself, suppressing leading zeros) in this early stage\ldots +\end{quote} + +No semantic checking is done here, i.e.~this stage doesn't +detect errors like \mbox{``\texttt{2.~Kg1 3.~Bf4}''}. + +\section*{Stage 3: Parsing single move tokens} + +At this point, we can be sure to get either a chess move \abbrev{CM} +or a move number \abbrev{MN}: + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{M} \bnfprod\={} \bnf{CM}\\ + \>\bnfor{} \bnf{MN} +\end{tabbing} +\end{minipage} +\end{center} + +Both can be distinguished well by inspecting the first character of the token, since +only move numbers \abbrev{MN} may start with a digit (\abbrev{D}). + +This stage would be the right place to check for the correct order +of chess moves and move numbers, i.e.~if a \abbrev{MN} is encountered +the right side (White or Black) should be to move. + +\section*{Parsing move numbers} + +Move numbers \abbrev{MN} consist of an integer value (\abbrev{N}), immediately +followed by one or three dots as terminal symbols, signalling whether it's +Whites or Blacks move. + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MN} \bnfprod\={} \bnf{N} \bnfterm{...}\\ + \>\bnfor{} \bnf{N} \bnfterm{.} +\end{tabbing} +\end{minipage} +\end{center} + +An integer value \abbrev{N} is a nonempty list of single digits +(\abbrev{D})\ldots + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{N} \bnfprod\={} \bnf{D} \bnf{N}\\ + \>\bnfor{} \bnf{D} +\end{tabbing} +\end{minipage} +\end{center} + +\ldots where each digit \abbrev{D} should be contained in the set of terminal +symbols 0--9. + +\begin{center} +\begin{minipage}{5cm} +\begin{tabbing} +\bnf{D} \bnfprod\={} \bnfterm{0}\bnfor\bnfterm{1}\bnfor\bnfterm{2}% +\bnfor\bnfterm{3}\bnfor\bnfterm{4}\bnfor\bnfterm{5}\bnfor\bnfterm{6}% +\bnfor\bnfterm{7}\bnfor\bnfterm{8}\bnfor\bnfterm{9} +\end{tabbing} +\end{minipage} +\end{center} + +Here, the move number can be checked against the internal move counter +if necessary. + +\section*{Parsing chess moves} + +A chess move \abbrev{CM} starts with the ``move specification'' (\abbrev{MS}), +giving information about the piece that is to move and the source and +destination squares. Additionally, an arbitrary number of character tokens may follow +as a move comment (\abbrev{MC}). So, after enough ``hints'' for executing the move +are collected, i.e.~\abbrev{MS} was ``matched'', the rest of the token is regarded +as comment \abbrev{MC} and is output unchanged. + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{CM} \bnfprod\={} \bnf{MS} \bnf{MC}\\ + \>\bnfor{} \bnf{MS} +\end{tabbing} +\end{minipage} +\end{center} + +Before defining the move specification \abbrev{MS} itself a few helping nonterminal +symbols are introduced. Please, remember that bold characters within +the ``rules'' denote terminal symbols\ldots + +\begin{enumerate} +\item A ``piece'' character (\abbrev{P}) + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{P} \bnfprod\={} \bnfterm{K}\bnfor\bnfterm{Q}\bnfor\bnfterm{B}% +\bnfor\bnfterm{N}\bnfor\bnfterm{R} +\end{tabbing} +\end{minipage} +\end{center} + +Remark: This definition uses the english letters for the single pieces. The +real implementation should be independent of the used language. + +\item A ``file'' character (\abbrev{f}) + +\begin{center} +\begin{minipage}{5cm} +\begin{tabbing} +\bnf{f} \bnfprod\={} \bnfterm{a}\bnfor\bnfterm{b}\bnfor\bnfterm{c}% +\bnfor\bnfterm{d}\bnfor\bnfterm{e}\bnfor\bnfterm{f}\bnfor\bnfterm{g}% +\bnfor\bnfterm{h} +\end{tabbing} +\end{minipage} +\end{center} + +\item A ``rank'' character (\abbrev{r}) + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{r} \bnfprod\={} \bnfterm{1}\bnfor\bnfterm{2}\bnfor\bnfterm{3}% +\bnfor\bnfterm{4}\bnfor\bnfterm{5}\bnfor\bnfterm{6}\bnfor\bnfterm{7}% +\bnfor\bnfterm{8} +\end{tabbing} +\end{minipage} +\end{center} + +\item A ``capture'' character (\bnfjoin) + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnfjoin{} \bnfprod\={} \bnfterm{-}\\ + \>\bnfor{} \bnfterm{x}\\ + \>\bnfor{} \bnfempty +\end{tabbing} +\end{minipage} +\end{center} + +where '\bnfempty' denotes the ``empty symbol''. + +\end{enumerate} + + +Move specifications (\abbrev{MS}) can be subdivided into the following groups: + +\begin{itemize} +\item Starting with a ``piece'' character + +\begin{itemize} +\item With source square +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MS} \bnfprod\={} \bnf{P} \bnf{f} \bnf{r} \bnfjoin{} \bnf{f} \bnf{r}\\ + \>\bnfor{} \bnf{P} \bnf{f} \bnfjoin{} \bnf{f} \bnf{r}\\ + \>\bnfor{} \bnf{P} \bnf{r} \bnfjoin{} \bnf{f} \bnf{r} +\end{tabbing} +\end{minipage} +\end{center} + +Examples: ``\texttt{Qf3-f4}'', ``\texttt{Ree6}'', ``\texttt{N1xc3}'' +\item Only a destination square present + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MS} \bnfprod\={} \bnf{P} \bnfjoin{} \bnf{f} \bnf{r} +\end{tabbing} +\end{minipage} +\end{center} + +Example: ``\texttt{Nxc4}'' +\end{itemize} + +\item Without leading ``piece'' character + +\begin{itemize} +\item With source square + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MS} \bnfprod\={} \bnf{f} \bnf{r} \bnfjoin{} \bnf{f} \bnf{r} \bnf{P}\\ + \>\bnfor{} \bnf{f} \bnfjoin{} \bnf{f} \bnf{r} \bnf{P}\\ + \>\bnfor{} \bnf{f} \bnf{r} \bnfjoin{} \bnf{f} \bnf{r}\\ + \>\bnfor{} \bnf{f} \bnfjoin{} \bnf{f} \bnf{r} +\end{tabbing} +\end{minipage} +\end{center} + +Examples: ``\texttt{f7-f8R}'', ``\texttt{dxe8B}'', ``\texttt{g2-g4}'', +``\texttt{fxe6}'' +\item Only a destination square present + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MS} \bnfprod\={} \bnf{f} \bnf{r} \bnf{P}\\ + \>\bnfor{} \bnf{f} \bnf{r} +\end{tabbing} +\end{minipage} +\end{center} + +Examples: ``\texttt{e8R}'', ``\texttt{a6}'' +\end{itemize} + + +\item Castlings + +\begin{center} +\begin{minipage}{3cm} +\begin{tabbing} +\bnf{MS} \bnfprod\={} \bnfterm{O-O-O}\\ + \>\bnfor{} \bnfterm{O-O} +\end{tabbing} +\end{minipage} +\end{center} + +Both of these terminals use the letter 'O' (ASCII code +79\base{10}) and not the digit '0' +(ASCII code 48\base{10})! +\end{itemize} + +\section*{Final remark} + +This text tries to provide only the syntax for the frontend of the new ``move +machine''. All the things that happen after the input was ``matched'' and +information was drawn out of the given ``chess moves'' to the largest extent, +i.e.~the semantic actions, are beyond the scope of this document. + +So, at the moment it is perfectly legal and syntactically correct to say +``\texttt{4. gxf8K}''\ldots + +\end{document} + diff --git a/Master/texmf-dist/doc/latex/skak/test1.tex b/Master/texmf-dist/doc/latex/skak/test1.tex new file mode 100644 index 00000000000..06749874f93 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/test1.tex @@ -0,0 +1,43 @@ + + +\documentclass[11pt,twocolumn]{article} + +\usepackage[ps,mover]{skak} + +\title{test1\\Ensuring that no Unwanted Spaces are Created} +\author{Torben Hoffmann } + +\begin{document} + +\parindent=0pt + +\maketitle + +Ulrike Fischer had a problem with unwanted spaces which should be +solved in version 1.1. + + +\newgame +\mainline{1. d4 d5} \mainline{2. Nc3 Nc6 3. Bg5 Bd7} + +\newgame +\tracingmacros=1 +\mainline{1.d4 d5} \mainline{2. Nc3 Nc6 3. e4 e5} + + +\newgame +\mainline{1.d4 d5} \mainline{2. e3 e6 3. c4 c5} + +\newgame +\mainline{1.d4 d5} \mainline{2. e3 e6 3. c4 c5} + +\showboard + + +\end{document} + + + + + + diff --git a/Master/texmf-dist/doc/latex/skak/test2.tex b/Master/texmf-dist/doc/latex/skak/test2.tex new file mode 100644 index 00000000000..2abf45fc979 --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/test2.tex @@ -0,0 +1,41 @@ + + +\documentclass[11pt,twocolumn]{article} + +\usepackage[ps,mover]{skak} + +\title{test2\\Proper Handling of Opening Spaces in the SAN Input} +\author{Torben Hoffmann } + +\begin{document} + +\parindent=0pt + +\maketitle + +Ulrike Fischer had a problem with opening spaces in the SAN input +which should be solved in version 1.1. + + +\newgame +\mainline{1.e4 e5} + +\[\showboard\] + +\newgame +\mainline{1. e4 e5} + +\[\showboard\] + +\newgame +\mainline{ 1. e4 e5} + +\[\showboard\] + +\end{document} + + + + + + diff --git a/Master/texmf-dist/doc/latex/skak/tuggame.tex b/Master/texmf-dist/doc/latex/skak/tuggame.tex new file mode 100644 index 00000000000..cbc201726be --- /dev/null +++ b/Master/texmf-dist/doc/latex/skak/tuggame.tex @@ -0,0 +1,164 @@ +% This is a skak version of the tugame.ltx which Piet Tutelaers made +% to show how the original chess package could be used. +% I have changed it to use the skak package commands as a +% demonstration of how to use the skak package. +% Author: Torben Hoffmann +% +% Change history +% -------------- +% Version Comments +% 1.0 Initial version adapted to the skak package. + +% The original comments follows below +%=================================================================== +% +% TUGgame.ltx +% ----------- +% LaTeX source of example in TUGboat article (part of the game Fisher +% lost against Tal), input'ted by TUGboat.ltx. +% Author : Piet Tutelaers (internet: rcpt@urc.tue.nl) +% Version: 1.2 ( 8 Jun 1991) +% Reflects changes in chess.sty version 1.2 +% Version: 1.1 (30 Nov 1990) +% Improvements over version 1.0: +% - two typos corrected, thanks Hugo +%=================================================================== + + +\documentclass[11pt,twocolumn]{article} + +\usepackage[ps,mover,styleC]{skak} + +\title{Example of the LaTeX-input and output of an annotated +chess game using \texttt{skak.sty}} +\author{Torben Hoffmann} + +\begin{document} + +\parindent=0pt + +\maketitle + +\section{The Input} + +\begin{verbatim} +\fenboard{1q3kr1/3rb2p/p3Q3/8/% +1p6/8/PPP3PP/4R2K w - - 0 26} + +\begin{figure}[htbp] + \begin{center} + $$\showboard$$ + \caption{Fischer--Tal after + \protect\variation{25... Kf8!}} + \label{fig:after-25...Kf8} + \end{center} +\end{figure} + + +(See figure~\ref{fig:after-25...Kf8}.) + +\mainline{26. Qxd7} + +Not \variation{26. Rf1+ Kg7 27. Rf7+ +Kh8} +and if \variation{28. Qxd7 Rd8 29. Qg4 +Qe5} +wins. + + +\mainline{26...Qd6 27. Qb7 Rg6} +Within a handful of moves the game +has changed its complexion. Now it +is White who must fight for a draw! + +\mainline{28. c3} +Black's extra piece means less with +each pawn that's exchanged. + +\mainline{28...a5} +On \variation{28...bxc3 29. Qc8+ Bd8 +30. Qxc3}=. + + +\mainline{29. Qc8+} +On the wrong track. Right is +\variation{29. cxb4 Qxb4} (if +\variation{29... axb4 30. a3! bxa3 +31. bxa3 Qxa3} draws) +\variation{30. Qf3+ Kg7 31. Qe2} draws, +since Black can't possibly build up a +winning K-side attack and his own +king is to exposed. + +\mainline{29...Kg7 30. Qc4 Bd8 +31. cxb4 axb4} +On \variation{31... Qxb4 32. Qe2} +White should draw with best play. +$$\showboard$$ +\end{verbatim} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{The Output} + +\fenboard{1q3kr1/3rb2p/p3Q3/8/% +1p6/8/PPP3PP/4R2K w - - 0 26} + +\begin{figure}[htbp] + \begin{center} + $$\showboard$$ + \caption{Fischer--Tal after + \protect\variation{25... Kf8!}} + \label{fig:after-25...Kf8} + \end{center} +\end{figure} + + +(See figure~\ref{fig:after-25...Kf8}.) + +\mainline{26. Qxd7} + +Not \variation{26. Rf1+ Kg7 27. Rf7+ +Kh8} +and if \variation{28. Qxd7 Rd8 29. Qg4 +Qe5} +wins. + + +\mainline{26...Qd6 27. Qb7 Rg6} +Within a handful of moves the game +has changed its complexion. Now it +is White who must fight for a draw! + +\mainline{28. c3} +Black's extra piece means less with +each pawn that's exchanged. + +\mainline{28...a5} +On \variation{28...bxc3 29. Qc8+ Bd8 +30. Qxc3}=. + + +\mainline{29. Qc8+} +On the wrong track. Right is +\variation{29. cxb4 Qxb4} (if +\variation{29... axb4 30. a3! bxa3 +31. bxa3 Qxa3} draws) +\variation{30. Qf3+ Kg7 31. Qe2} draws, +since Black can't possibly build up a +winning K-side attack and his own +king is to exposed. + +\mainline{29...Kg7 30. Qc4 Bd8 +31. cxb4 axb4} +On \variation{31... Qxb4 32. Qe2} +White should draw with best play. +$$\showboard$$ + + +\end{document} + + + + + + -- cgit v1.2.3