summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/texmate
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-09-24 13:20:21 +0000
committerKarl Berry <karl@freefriends.org>2006-09-24 13:20:21 +0000
commiteccd9ce5303a7466f5bf33c5c9924766cdf5b370 (patch)
tree0c3d1e524139617b531989ca5e6c9b4413f52322 /Master/texmf-dist/tex/latex/texmate
parent590fc0fc39d1d41de6da3f905c76a1971d176ca1 (diff)
texmate update (22sep06)
git-svn-id: svn://tug.org/texlive/trunk@2181 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/texmate')
-rw-r--r--Master/texmf-dist/tex/latex/texmate/texmate.sty39
1 files changed, 25 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/texmate/texmate.sty b/Master/texmf-dist/tex/latex/texmate/texmate.sty
index ef00a1a86eb..3f6261b5fdf 100644
--- a/Master/texmf-dist/tex/latex/texmate/texmate.sty
+++ b/Master/texmf-dist/tex/latex/texmate/texmate.sty
@@ -173,10 +173,11 @@
\ifcat\noexpand~\noexpand#1%
\def\next{\@#1}%
\else
+ \catcode`\x=11\relax
\ifcat\relax\noexpand#1%
\def\next{\@#1}%
\else
- \def\next{\@@piece}%
+ \def\next{\catcode`\x=\active\@@piece}%
\if@skaking
\ifcat1\noexpand#1%
\@tmtoskak\expandafter{\the\@tmtoskak #1}%
@@ -191,7 +192,7 @@
\ifx\temp\@Queen\textsymqueen\else
\ifx\temp\@King\textsymking\else
\ifx\temp\@Castle\let\next\@castle\else
- \def\next{#1\@@piece}%
+ \def\next{#1\catcode`\x=\active\@@piece}%
\fi\fi\fi\fi\fi\fi
\fi\fi
\next}
@@ -322,7 +323,7 @@
\@turn
\if@white\advance\move1\relax\fi
\@execute}
-\long\def\threat#1{\bgroup\@skakingfalse\ifcase\@commlevel\or
+\def\threat#1{\bgroup\@skakingfalse\ifcase\@commlevel\or
\iifont\or\iiifont\or\ivfont\or\ivfont\fi\
\catcode`\>\active\withidea\@@piece}
\long\def\Threat#1{\bgroup
@@ -331,8 +332,10 @@
\ifcase\@commlevel\or
\iifont\or\iiifont\or\ivfont\or\ivfont\fi
\catcode`\>\active
- \if@delimited\@turn\fi
- \ddummy\@execute}
+ \if@delimited\else\@turn\fi
+ \@turn
+ \if@white\advance\move1\relax\fi
+ \@execute}
\newcommand*\var{\relax}
\newenvironment{variations}{%
\renewcommand\var{\@ifstar{\tm@vars}{\tm@var}}%
@@ -448,20 +451,24 @@
\newcommand*\analysistop{Analysis}
\newcommand*\diagramtop{\textbf{\bname}}
\newcommand*\diagrambottom{\textbf{\wname}}
-\newcommand*\diagramsign{~\mdseries(\textit{D})}
+\newcommand*\diagramsign{~{\mdseries(\textit{D})}}
\let\@diagramtop\diagramtop
\let\@diagrambottom\diagrambottom
\newcount\@diagramsbuilt
\newcommand*\DiagramCache[1]{%
\@tempcnta#1
- \@whilenum\@tempcnta>0\do{%
+ \@whilenum\@tempcnta>\MaxDiagramCache\do{%
\expandafter\newbox\csname chessdiag\@roman\@tempcnta\endcsname
\expandafter\newbox\csname chessdiag\@roman\@tempcnta top\endcsname
\expandafter\newbox\csname chessdiag\@roman\@tempcnta bottom\endcsname
\expandafter\newbox\csname chessdiag\@roman\@tempcnta move\endcsname
\@namedef{chessdiag\@roman\@tempcnta turn}{}%
\advance\@tempcnta-1\relax}%
+ \ifnum#1>\MaxDiagramCache
+ \def\MaxDiagramCache{#1}%
+ \fi
}
+\def\MaxDiagramCache{0}
\DiagramCache3
\newcounter{diagram}
\newcommand*\makediagrams[1][\@diagramsbuilt]{%
@@ -533,7 +540,7 @@
}%
\fi
}
-\newcommand*\drawdiagram[2]{%
+\newcommand*\preparediagram[2]{%
\global\advance\@diagramsbuilt1\relax
\expandafter\global\expandafter
\sbox\csname chessdiag\@roman\the\@diagramsbuilt\endcsname{\showboard}%
@@ -590,16 +597,17 @@
\newif\if@blacksq
\newcommand\diagram[2][w 1]{%
\position[#1]{#2}%
- \showdiagram}
-\newcommand*\fenposition[1]{\@fenposition#1.}
+ \showboard}
\if@skakon
+ \let\skak@fenboard\fenboard
+ \renewcommand*\fenboard[1]{\tm@fenboard#1.}
\newcommand*\toD{\if@delimited\else\@@turn\fi\@ifstar{\@toD}{\diagramsign\@toD}}
\newcommand\position[2][w 1]{%
\@squarecount8\relax
\def\tm@tofen{}%
\@convertdiagram#2.%
\@completefen#1.%
- \expandafter\fenboard\tm@tofen%
+ \expandafter\skak@fenboard\tm@tofen%
}
\def\@convertdiagram#1{%
\let\next\@convertdiagram
@@ -624,12 +632,12 @@
\edef\tm@tofen{{\tm@tofen\space #1 KQkq - 0 #2}}%
\move#2\relax
\ifx#1w\@whitetrue\else\@whitefalse\fi}
- \def\@fenposition#1 #2 #3 #4 #5 #6.{%
+ \def\tm@fenboard#1 #2 #3 #4 #5 #6.{%
\@squarecount8\relax
\def\tm@tofen{}%
\@convertdiagram#1.%
\edef\tm@tofen{{\tm@tofen\space #2 #3 #4 #5 #6}}%
- \expandafter\fenboard\tm@tofen
+ \expandafter\skak@fenboard\tm@tofen
\move#6\relax
\ifx#2w\@whitetrue\else\@whitefalse\fi
}
@@ -678,9 +686,12 @@
\let\@next\@gobble\fi
\@next\@tempcntb\fi}
\def\@togglesq{\if@blacksq\@blacksqfalse\else\@blacksqtrue\fi}
- \def\@fenposition#1 #2 #3 #4 #5 #6.{%
+ \newcommand*\fenboard[1]{\tm@fenboard#1.}
+ \def\tm@fenboard#1 #2 #3 #4 #5 #6.{%
\position[#2 #6]{#1}}
\fi
+\let\fenposition\fenboard
+\let\drawdiagram\preparediagram
\def\wname{}
\def\bname{}
\let\@welo\relax