On Tue, Oct 30, 2001 at 11:11:42AM -0800, Kayvan A. Sylvan wrote:
>
> I submit my chess patch again. Please apply this. It's quite limited
> in scope and won't break anything else. ;-)
>
> ---Kayvan
Ugh. I just noticed all the *.po file garbage in my patch file.
Sorry. Here is a much smaller file.
? lib/scripts/fen2ascii.py
? lib/tex/lyxskak.sty
? src/version_info.h
Index: lib/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v
retrieving revision 1.121
diff -u -r1.121 ChangeLog
--- lib/ChangeLog 2001/10/30 17:05:57 1.121
+++ lib/ChangeLog 2001/10/30 19:17:59
@@ -1,3 +1,9 @@
+2001-10-30 Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+ * external_templates: Fix up the help message for ChessDiagram
+ again (referring to the new lyxskak.sty). Reworked the LaTeX
+ output to use skak.sty \loadgame{file} feature.
+
2001-10-30 John Levon <[EMAIL PROTECTED]>
* Makefile.am: remove BUGS.lyx mention
@@ -6,6 +12,21 @@
* ui/default.ui: remove Known Bugs entry
+2001-10-28 Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+ * scripts/fen2latex.py: Simplified greatly. Now uses skak.
+
+ * scripts/fen2ascii.py: New file added. Makes a nice ascii
+ representation of the chess position.
+
+2001-10-28 Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+ * external_templates: Changed comment to inform user to use skak
+ package instead of the very old chess.sty for external chess
+ material. Added the -mode EditPosition flag to the "xboard"
+ invocation. Fixed the invocation of fen2ascii (which did *not*
+ exist, even though it was referenced).
+
2001-10-24 José Matos <[EMAIL PROTECTED]>
* layouts/db_lyxmacros.inc:
Index: lib/Makefile.am
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/Makefile.am,v
retrieving revision 1.29
diff -u -r1.29 Makefile.am
--- lib/Makefile.am 2001/10/30 17:05:57 1.29
+++ lib/Makefile.am 2001/10/30 19:17:59
@@ -19,7 +19,7 @@
LAYOUT = layouts/*.layout layouts/*.inc
LYXSCRIPTS = configure configure.cmd scripts/*
TEMPL = templates/*.lyx
-TEXSUPPORT = tex/*.cls
+TEXSUPPORT = tex/*.cls tex/*.sty
UI = ui/*.ui
configure: configure.m4
Index: lib/external_templates
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/external_templates,v
retrieving revision 1.4
diff -u -r1.4 external_templates
--- lib/external_templates 2000/06/20 07:58:10 1.4
+++ lib/external_templates 2001/10/30 19:17:59
@@ -99,21 +99,21 @@
remember to middle and right click to
insert new material in the board.
In order for this to work, you have to
- install the lyxchess.sty which is bundled
- with LyX, and the chess.sty from CTAN.
+ put the bundled lyxskak.sty in a place
+ that TeX will find it, and you will need
+ to install the skak package from CTAN.
HelpTextEnd
FileFilter "*.fen"
ViewCommand "xboard -lpf $$FName"
- EditCommand "xboard -lpf $$FName"
+ EditCommand "xboard -lpf $$FName -mode EditPosition"
AutomaticProduction true
Format LaTeX
- Product "$$Contents(\"$$Basename.tex\")"
- UpdateCommand "python $$Sysdir/scripts/fen2latex.py $$FName
$$Basename.tex"
+ Product "\\loadgame{$$lyxfilepath/$$Basename}\\showboard"
Requirement "chess"
FormatEnd
Format Ascii
Product "$$Contents(\"$$Basename.asc\")"
- UpdateCommand "python $$Sysdir/scripts/fen2ascii.py $$FName
$$Basename.tex"
+ UpdateCommand "python $$Sysdir/scripts/fen2ascii.py $$FName
+$$Basename.asc"
FormatEnd
Format DocBook
Product "[Chess: $$Basename]"
Index: lib/scripts/fen2latex.py
===================================================================
RCS file: /cvs/lyx/lyx-devel/lib/scripts/fen2latex.py,v
retrieving revision 1.1
diff -u -r1.1 fen2latex.py
--- lib/scripts/fen2latex.py 2000/06/12 11:27:08 1.1
+++ lib/scripts/fen2latex.py 2001/10/30 19:17:59
@@ -1,11 +1,11 @@
#!/usr/bin/python
#
-# Copyright (C) 2000 The LyX Team.
+# Copyright (C) 2001 The LyX Team.
#
# This file is distributed under the GPL license.
#
# This script will convert a chess position in the FEN
-# format to a chunk of LaTeX to be used with the chess.sty
+# format to a chunk of LaTeX to be used with the skak.sty
# style.
import sys,string,os
@@ -19,33 +19,6 @@
if line[-1] == '\n':
line = line[:-1]
-line=string.split(line,' ')[0]
-comp=string.split(line,'/')
-
-first = 1
-cont=1
-margin= " "*6
-
-for i in range(8):
-
- cont = cont + 1
- tmp=""
- for j in comp[i]:
- if j>='0' and j <= '9':
- for k in range(int(j)):
- cont = cont + 1
- x, mod = divmod(cont,2)
- if mod : tmp = tmp + ' '
- else : tmp = tmp + '*'
- else :
- tmp = tmp + j
- cont = cont + 1
-
- if first:
- first = 0
- print "\\board{"+tmp+"}"
- else :
- print margin+"{"+tmp+"}"
-
+print "\\fenboard{"+line+"}"
print "\\showboard%"
Index: src/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/ChangeLog,v
retrieving revision 1.378
diff -u -r1.378 ChangeLog
--- src/ChangeLog 2001/10/30 17:05:57 1.378
+++ src/ChangeLog 2001/10/30 19:17:59
@@ -2,6 +2,15 @@
* lyx_main.C: change ref to known bugs
+2001-10-30 Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+ * LaTeXFeatures.C (getPackages): Use lyxskak.sty now instead
+ to work around older babel problems.
+
+2001-10-28 Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+ * LaTeXFeatures.[hC]: Now uses skak.sty for chess material.
+
2001-10-24 Juergen Vigna <[EMAIL PROTECTED]>
* tabular-old.C (ReadOld): below variable changes reflected.
Index: src/LaTeXFeatures.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/LaTeXFeatures.C,v
retrieving revision 1.47
diff -u -r1.47 LaTeXFeatures.C
--- src/LaTeXFeatures.C 2001/10/23 09:42:13 1.47
+++ src/LaTeXFeatures.C 2001/10/30 19:17:59
@@ -189,9 +189,9 @@
// packages << "\\usepackage{algorithm}\n";
//}
- // lyxchess.sty
+ // lyxskak.sty --- newer chess support based on skak.sty
if (chess) {
- packages << "\\usepackage{lyxchess}\n";
+ packages << "\\usepackage[ps,mover]{lyxskak}\n";
}
// setspace.sty
Index: src/LaTeXFeatures.h
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/LaTeXFeatures.h,v
retrieving revision 1.33
diff -u -r1.33 LaTeXFeatures.h
--- src/LaTeXFeatures.h 2001/10/23 09:42:13 1.33
+++ src/LaTeXFeatures.h 2001/10/30 19:17:59
@@ -94,7 +94,7 @@
///
bool prettyref; // prettyref.sty
///
- bool chess; // chess.sty
+ bool chess; // skak.sty (new chess support)
///
bool natbib; // natbib.sty
///
Index: src/insets/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.213
diff -u -r1.213 ChangeLog
--- src/insets/ChangeLog 2001/10/24 15:07:39 1.213
+++ src/insets/ChangeLog 2001/10/30 19:17:59
@@ -1,3 +1,8 @@
+2001-10-30 Kayvan A. Sylvan <[EMAIL PROTECTED]>
+
+ * insetexternal.C (doSubstitution): Added $$lyxfilepath token
+ to list of usable substitutions in external inset templates.
+
2001-10-24 Juergen Vigna <[EMAIL PROTECTED]>
* insettabular.C: use new ltType struct for setting longtable
Index: src/insets/insetexternal.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/insets/insetexternal.C,v
retrieving revision 1.31
diff -u -r1.31 insetexternal.C
--- src/insets/insetexternal.C 2001/09/04 11:02:06 1.31
+++ src/insets/insetexternal.C 2001/10/30 19:17:59
@@ -235,9 +235,12 @@
{
string result;
string const basename = ChangeExtension(params_.filename, string());
+ string buf = MakeAbsPath(params_.filename);
+ string filepath = OnlyPath(buf);
result = subst(s, "$$FName", params_.filename);
result = subst(result, "$$Basename", basename);
result = subst(result, "$$Parameters", params_.parameters);
+ result = subst(result, "$$lyxfilepath", filepath);
result = ReplaceEnvironmentPath(result);
result = subst(result, "$$Tempname", tempname_);
result = subst(result, "$$Sysdir", system_lyxdir);
newchessfiles.tgz