diff options
author | Karl Berry <karl@freefriends.org> | 2014-04-20 22:04:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-04-20 22:04:40 +0000 |
commit | d5e93667cefc1e7a311d7352143d095120b492dc (patch) | |
tree | 0102610e09534c7aec2b7e32fd74b382cc31a495 /Master/texmf-dist/source/latex/xskak | |
parent | 33a4d5f43d0935e7074701ce4937755e9badac4b (diff) |
xskak (20apr14)
git-svn-id: svn://tug.org/texlive/trunk@33559 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xskak')
-rw-r--r-- | Master/texmf-dist/source/latex/xskak/xskak-src.dtx | 81 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/xskak/xskak.ins | 14 |
2 files changed, 62 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/xskak/xskak-src.dtx b/Master/texmf-dist/source/latex/xskak/xskak-src.dtx index ae850cf988a..9d358d70bf4 100644 --- a/Master/texmf-dist/source/latex/xskak/xskak-src.dtx +++ b/Master/texmf-dist/source/latex/xskak/xskak-src.dtx @@ -1,8 +1,7 @@ %<*xskak> \NeedsTeXFormat{LaTeX2e} -\def\@rcs@ $#1Date: #2-#3-#4 #5$$#6Version: #7$ { - \ProvidesPackage{xskak}[#2/#3/#4 version #7 extended Chess typesetting and parsing]} -\@rcs@ $Date: 2008-10-20 19:58 +0200 $$Version: v1.2 $ +\ProvidesPackage{xskak}[2014/04/19 version v1.3 extended chess typesetting and parsing] +%%$Date: 2014/04/19 13:39:37 $$Version: 7992681de4b7 $ \newif\ifxskakpdfmatch @@ -65,7 +64,9 @@ nextmovenr,% nextmoveid,% diagramlist,% - gameid} + gameid,% + parentid%NEW records game id of parent if the game is a variation, the last move of the parent=initmoveid + } \newcommand\xskak@list@movetypes{% movenr,% @@ -99,7 +100,9 @@ nag,% san,% lan,% - opennr%% + opennr,% + vars,% NEW, records game id of child variations + varnum% NEW, records number of child variations } %% setting pgn infos @@ -148,6 +151,7 @@ \newboolean{xskakboolpromotion} \newboolean{xskakboolcomment} \newboolean{xskakboolnag} +\newboolean{xskakboolvar} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% @@ -253,7 +257,11 @@ \expandafter\xdef \csname Xskak\xskak@val@gameid nextmovenr\endcsname{\the\c@move}% \expandafter\xdef - \csname Xskak\xskak@val@gameid nextmoveid\endcsname{\the\c@move\WhiteToMove{w}{b}}} + \csname Xskak\xskak@val@gameid nextmoveid\endcsname{\the\c@move\WhiteToMove{w}{b}}% + \expandafter\xdef\csname %new 1.6. Initialization of nag + Xskak.\xskak@val@gameid.% + \csname Xskak\xskak@val@gameid lastmovenr\endcsname.% + \csname Xskak\xskak@val@gameid lastplayer\endcsname.nag\endcsname{}} %% continuing a game \newcommand\resumechessgame[1][]{% @@ -511,6 +519,9 @@ %%% move related informations %%%% <type> <value> +%%%% vars list of game id of variations. Is set to empty by \xskak@do@dothemove. Can be +%%%% change by variation games to notify the "parent" about its "child" +%%%% varnum record the number of variations of the move. Set to 0 by \xskak@do@dothemove. %%%% pgnpiece K,Q,R,B or N (independent from language). Is empty for Pawn and Castling moves %%%% piece K,Q,R,B,N or P or k,q,r,b,n or p (for black). Is empty for Castling %%%% piecechar K,Q,R,B,N or p. Is empty for Castling @@ -546,7 +557,7 @@ %%%% \castlingchar\castlinghyphen\castlingchar %%%% lan long algebraic notation of the move. %%%% opennr The number representation for an open move e.g. 2... -%%% Game related informations. Don't use @ or "." to simply use by the user +%%% Game related informations. Don't use @ or "." to simplify use by the user %%%% gameid stores the gameid (for easier retrieving) %%%% initfen The fen before the first move. Set by \newchessgame %%%% initplayer w or b, The color of the next (first) player. @@ -577,6 +588,14 @@ \setkeys[UFCB]{locfill}{setfen=\temp@board}% %\expandafter\show\csname board@val@f4r4@piecechar\endcsname %===========% + %% vars + varnum + \expandafter\xdef + \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.vars\endcsname{}% + %\expandafter\show\csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.vars\endcsname + \expandafter\xdef + \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.varnum\endcsname{0}% + %\expandafter\show\csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.varnum\endcsname + %===========% %% pgnpiece \expandafter\xdef \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.pgnpiece\endcsname{% @@ -749,7 +768,10 @@ %% new naming, changed to boolean \begingroup \WhiteToMove% - {\ifthenelse%white enpassant + {\ifthenelse% + {\equal{\csname Xskak.\xskak@val@gameid.\the\c@move.w.piecechar\endcsname}{p}} + {% pawn move: + \ifthenelse%white enpassant {\equal {\csname Xskak.\xskak@val@gameid.\the\c@move.w.moveto\endcsname}% {\csname Xskak.\xskak@val@gameid.\the\numexpr\the\c@move-1\relax.b.enpassantsquare\endcsname}}% @@ -761,7 +783,14 @@ {\expandafter\xdef \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.enpassant\endcsname {\noexpand\setboolean{xskakboolenpassant}{false}}}}% - {\ifthenelse%black enpassant + {\expandafter\xdef + \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.enpassant\endcsname + {\noexpand\setboolean{xskakboolenpassant}{false}}}% + }% + {\ifthenelse + {\equal{\csname Xskak.\xskak@val@gameid.\the\c@move.b.moveto\endcsname}{p}} + {%pawn move: + \ifthenelse%black enpassant {\equal {\csname Xskak.\xskak@val@gameid.\the\c@move.b.moveto\endcsname}% {\csname Xskak.\xskak@val@gameid.\the\c@move.w.enpassantsquare\endcsname}}% @@ -772,8 +801,11 @@ \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.lostpiece\endcsname{P}}% {\expandafter\xdef \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.enpassant\endcsname - {\noexpand\setboolean{xskakboolenpassant}{false}}}% - }% + {\noexpand\setboolean{xskakboolenpassant}{false}}}}% + {\expandafter\xdef + \csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.enpassant\endcsname + {\noexpand\setboolean{xskakboolenpassant}{false}}}} + % \endgroup %\expandafter\show\csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.enpassant\endcsname %\expandafter\show\csname Xskak.\xskak@val@gameid.\the\c@move.\WhiteToMove{w}{b}.lostpiece\endcsname @@ -978,7 +1010,7 @@ %% tests if the argument is \xskakcomment{...} \def\xskak@test@comment#1=\xskakcomment#2=={% \def\@tempa{#1}% - \ifx\@tempa\empty%#1 beginnt mit \chesscomment + \ifx\@tempa\empty%#1 beginnt mit \xskakcomment \setboolean{xskakboolcomment}{true}% \else \setboolean{xskakboolcomment}{false}% @@ -1013,7 +1045,7 @@ }}% {}%variation \PrintMoves{{\xskak@beforecomment{#1}}}{}% - \Mainline(#2)% + \xskak@do@parsemainline(#2)% \else \xskak@test@nag#1YXX% \ifthenelse% @@ -1058,10 +1090,11 @@ {{\xskak@beforeNAG{\csname#1\endcsname}}}}% %\expandafter\show\csname Xskak.\xskak@val@gameid.\the\c@move.w.nag\endcsname }}% + {}%variation \PrintMoves{{\xskak@beforeNAG{\csname#1\endcsname}}}{}% - \Mainline(#2)}% + \xskak@do@parsemainline(#2)}% {\EqStr{ }{#1}% - {\Mainline(#2)}% + {\xskak@do@parsemainline(#2)}% {% \EqStr{Z}{#1}% {}% @@ -1071,14 +1104,15 @@ % number with a space, eg, 1.e4 %{\gdef\NumberNext{\False}\Mainline(#2)}% %\gdef\NumberNext{\False}% - \Mainline(#2)}% + \xskak@do@parsemainline(#2)}% {\Fen@calculate% 16.10.2008 skak1.5 \expandafter\xdef\csname chessgame.skak.temp.previous\endcsname{\temp@board}%16.10.2008 skak1.5 \MakeMoveMainline{#1}% - \Mainline(#2)}}}}% + \xskak@do@parsemainline(#2)}}}}% \fi} %% overwrite the skak version: +%% currently needed as \runmoves use \Mainline \let\Mainline\xskak@do@parsemainline %% Printing @@ -1305,6 +1339,7 @@ \newcommand\printchessgame[1][]{% \setkeys*[UFXS]{print}{#1}%set style and level + \leavevmode%UF 2012-09-10 to allow wrapping around wrapfigure \begingroup \setkeys*[UFXS]{xprint}{#1}%% getting the id \xdef\xskak@val@movenr{% @@ -1417,7 +1452,7 @@ \gdef\StoreLastMove{\False}% {\variationstyle\opencommands% \variationmovemode - \Mainline(#1 Z )% + \xskak@do@parsemainline(#1 Z )% \closecommands}} %%% Read/store commands @@ -1508,9 +1543,8 @@ %</xskak> %<*xskak-keys> -\def\@rcs@ $#1Date: #2-#3-#4 #5$$#6Version: #7$ { - \ProvidesFile{xskak-keys.sty}[#2/#3/#4 version #7 key definitions for xskak.sty #7]} -\@rcs@ $Date: 2008-10-20 19:58 +0200 $$Version: v1.2 $ +\ProvidesFile{xskak-keys.sty}[2014/04/19 version v1.3 key definitions for xskak.sty] +%%$Date: 2011/03/17 16:54:07 $$Version: 041ab49ae0e2 $ %%%%%%%%%%%%%%%%%%%%% @@ -2274,9 +2308,8 @@ %</xskak-keys> %<*xskak-nagdef> -\def\@rcs@ $#1Date: #2-#3-#4 #5$$#6Version: #7$ { - \ProvidesFile{xskak-nagdef.sty}[#2/#3/#4 version #7 nag definitions for xskak.sty #7]} -\@rcs@ $Date: 2008-10-20 19:58 +0200 $$Version: v1.2 $ +\ProvidesFile{xskak-nagdef.sty}[2014/04/19 version v1.3 nag definitions for xskak.sty] +%%$Date: 2011/03/17 16:54:07 $$Version: 041ab49ae0e2 $ \expandafter\def\csname $1\endcsname{!} \expandafter\def\csname $2\endcsname{?} diff --git a/Master/texmf-dist/source/latex/xskak/xskak.ins b/Master/texmf-dist/source/latex/xskak/xskak.ins index eff7437e74e..7a725a514e3 100644 --- a/Master/texmf-dist/source/latex/xskak/xskak.ins +++ b/Master/texmf-dist/source/latex/xskak/xskak.ins @@ -1,5 +1,5 @@ %% -%% This file will generate fast loadable files from xskak-src.dtx +%% This file will generate fast loadable files from chessfss-ex.dtx %% when run through LaTeX or TeX. %% %% This file is part of the LaTeX2e package xskak @@ -9,7 +9,7 @@ %% but WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. %% -%% Copyright 2007 Ulrike Fischer (skak@nililand.de) +%% Copyright 2006-2014 Ulrike Fischer (chess@nililand.de) %% ------------------------------------------- % % @@ -48,8 +48,8 @@ \declarepreamble\UFpreamble -xskak: an extension to the package skak for chess typesetting -Copyright 2007 Ulrike Fischer (skak@nililand.de) +xskak: a package to parse and print chess games +Copyright 2006-2014 Ulrike Fischer (chess@nililand.de) ------------------------------------------- This file can be redistributed and/or modified under the terms of @@ -60,17 +60,13 @@ License, or (at your option) any later version. For error reports see documentation. \endpreamble - %% File generation: -\usedir{tex/latex/xskak} \generate{% \usepreamble\UFpreamble - %% style \file{xskak.sty}{\from{xskak-src.dtx}{xskak}} \file{xskak-keys.sty}{\from{xskak-src.dtx}{xskak-keys}} \file{xskak-nagdef.sty}{\from{xskak-src.dtx}{xskak-nagdef}} } - \endbatchfile %% -%% end of file `xskak.ins' +%%end of file xskak.ins
\ No newline at end of file |