]> git.lyx.org Git - features.git/commitdiff
more skak tweaks
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 31 Oct 2001 17:16:35 +0000 (17:16 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 31 Oct 2001 17:16:35 +0000 (17:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2957 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/examples/chessgame.lyx [new file with mode: 0644]
lib/examples/iecc05.fen [new file with mode: 0644]
lib/examples/iecc07.fen [new file with mode: 0644]
lib/examples/iecc12.fen [new file with mode: 0644]
lib/external_templates
lib/scripts/fen2latex.py [deleted file]
src/insets/ChangeLog
src/insets/insetexternal.C

index dc6ccecba6c9d574a0134c1e93be38b3c97058a1..f6577abe55e11aa2724f4ba0c33a2840867ab90e 100644 (file)
@@ -1,3 +1,15 @@
+2001-10-31  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * examples/iecc05.fen: 
+       * examples/iecc07.fen: 
+       * examples/iecc12.fen:
+       * lib/examples/chessgame.lyx: an example for the new chess support.
+
+2001-10-31  Kayvan A. Sylvan  <kayvan@sylvan.com>
+
+       * external_templates: Minor tweak. Changed $$FPath/$$Basename
+       to $$FPath$$Basename.
+
 2001-10-30  Kayvan A. Sylvan  <kayvan@sylvan.com>
 
        * external_templates: Fix up the help message for ChessDiagram
diff --git a/lib/examples/chessgame.lyx b/lib/examples/chessgame.lyx
new file mode 100644 (file)
index 0000000..68ed659
--- /dev/null
@@ -0,0 +1,255 @@
+#LyX 1.2 created this file. For more info see http://www.lyx.org/
+\lyxformat 220
+\textclass article
+\begin_preamble
+\usepackage{chess-workshop-symbols}
+\end_preamble
+\language english
+\inputencoding auto
+\fontscheme default
+\graphics default
+\paperfontsize 12
+\spacing single 
+\papersize letterpaper
+\paperpackage a4
+\use_geometry 1
+\use_amsmath 0
+\use_natbib 0
+\use_numerical_citations 0
+\paperorientation portrait
+\topmargin 0in
+\bottommargin 0.5in
+\headheight 0in
+\headsep 0in
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation skip
+\defskip smallskip
+\quotes_language english
+\quotes_times 2
+\papercolumns 2
+\papersides 1
+\paperpagestyle empty
+
+\layout Title
+
+Email Chess Game analyzed
+\layout Author
+
+Kayvan A.
+ Sylvan
+\newline 
+<kayvan@sylvan.com>
+\layout Date
+
+
+\emph on 
+Game start 05/29/2001
+\layout Standard
+
+The following game was played at the IECC (International Email Chess Club).
+ It is presented as an example of the fun you can have with LyX's new chess
+ support.
+ You must have xboard installed on your machine to be able to open and view
+ the chess positions from LyX.
+\layout Standard
+\line_top \line_bottom 
+
+\noun on 
+Sylvan, Kayvan
+\hfill 
+Wakeham, Marc 
+\newline 
+(1623)
+\hfill 
+(1639)
+\layout Standard
+
+
+\begin_inset ERT
+status Open
+
+\layout Standard
+
+\backslash 
+newgame
+\backslash 
+smallboard%
+\layout Standard
+
+\backslash 
+mainline{1. e4 c5 2. Nc3 d6 3. g3 Nc6 4. Bg2 e6 5. Nge2}
+\end_inset 
+
+
+\layout Standard
+\added_space_top medskip 
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+[
+\end_inset 
+
+
+\begin_inset External ChessDiagram,"iecc05.fen",""
+
+\end_inset 
+
+
+\begin_inset ERT
+status Inlined
+
+\layout Standard
+
+\backslash 
+]
+\backslash 
+printknightmove{g1}{e2}
+\backslash 
+highlight{d4,f4}
+\end_inset 
+
+
+\layout Standard
+
+So far, so good.
+ This is all according to theory.
+\layout Standard
+
+
+\begin_inset ERT
+status Open
+
+\layout Standard
+
+\backslash 
+mainline{5... Be7?!} 
+\backslash 
+variation{5... Nge7}
+\backslash 
+equal %
+\layout Standard
+
+\backslash 
+mainline{6. d4 cxd4 7. Nxd4 a6}
+\end_inset 
+
+
+\layout Standard
+
+With 7...\SpecialChar ~
+a6, we are back in the well-trodden theory of this opening.
+\layout Standard
+
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+[
+\end_inset 
+
+
+\begin_inset External ChessDiagram,"iecc07.fen",""
+
+\end_inset 
+
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+]
+\end_inset 
+
+
+\layout Standard
+
+
+\begin_inset ERT
+status Open
+
+\layout Standard
+
+\backslash 
+mainline{8. Nxc6 bxc6 9. O-O Bb7 10. Qg4 Bf6 11. Bf4 Ne7 12. Rad1}
+\end_inset 
+
+
+\layout Standard
+
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+[
+\end_inset 
+
+
+\begin_inset External ChessDiagram,"iecc12.fen",""
+
+\end_inset 
+
+
+\begin_inset ERT
+status Inlined
+
+\layout Standard
+
+\backslash 
+]
+\backslash 
+printarrow{a1}{d1}
+\end_inset 
+
+
+\layout Standard
+
+White continues to develop pieces and also sets a trap for Black.
+\layout Standard
+
+
+\begin_inset ERT
+status Open
+
+\layout Standard
+
+\backslash 
+mainline{12... O-O?} This loses instantly.
+\layout Standard
+Best was 
+\backslash 
+variation{12... e5 13. Be3 Qc7 14. Na4 O-O}
+\backslash 
+wbetter
+\layout Standard
+
+\backslash 
+mainline{13. e5!} Black's knight and bishop form a bumbling pair here, the Bishop is doomed.
+\layout Standard
+
+\backslash 
+mainline{13... Nd5!? 14. Bxd5 cxd5 15. exf6 Qxf6 16. Bxd6 Rfd8 17. Bc7 Rd7 18. Bf4 1-0 }%
+\layout Standard
+
+\backslash 
+[
+\backslash 
+showboard
+\backslash 
+]
+\end_inset 
+
+
+\the_end
diff --git a/lib/examples/iecc05.fen b/lib/examples/iecc05.fen
new file mode 100644 (file)
index 0000000..bd120ec
--- /dev/null
@@ -0,0 +1 @@
+r1bqkbnr/pp3ppp/2npp3/2p5/4P3/2N3P1/PPPPNPBP/R1BQK2R b KQkq - 0 5
diff --git a/lib/examples/iecc07.fen b/lib/examples/iecc07.fen
new file mode 100644 (file)
index 0000000..e631996
--- /dev/null
@@ -0,0 +1 @@
+r1bqk1nr/1p2bppp/p1npp3/8/3NP3/2N3P1/PPP2PBP/R1BQK2R w KQkq - 0 8
diff --git a/lib/examples/iecc12.fen b/lib/examples/iecc12.fen
new file mode 100644 (file)
index 0000000..1f827c3
--- /dev/null
@@ -0,0 +1 @@
+r2qk2r/1b2nppp/p1pppb2/8/4PBQ1/2N3P1/PPP2PBP/3R1RK1 b kq - 0 12
index 91efbb8d667087038fce3243e1983362eca1fec5..28760b22d871ad605150aa106675a0ae74d96268 100644 (file)
@@ -108,7 +108,7 @@ Template ChessDiagram
        EditCommand "xboard -lpf $$FName -mode EditPosition"
        AutomaticProduction true
        Format LaTeX
-               Product "\\loadgame{$$FPath/$$Basename}\\showboard"
+               Product "\\loadgame{$$FPath$$Basename}\\showboard"
                Requirement "chess"
        FormatEnd
        Format Ascii
diff --git a/lib/scripts/fen2latex.py b/lib/scripts/fen2latex.py
deleted file mode 100644 (file)
index eb5d426..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/python
-#
-# 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 skak.sty
-# style.
-
-import sys,string,os
-
-os.close(0)
-os.close(1)
-sys.stdin = open(sys.argv[1],"r")
-sys.stdout = open(sys.argv[2],"w")
-
-line = sys.stdin.readline()
-if line[-1] == '\n':
-    line = line[:-1]
-
-print "\\fenboard{"+line+"}" 
-print "\\showboard%"
-
index ace8d765b45d75d93fc8d5392a4a4a3c5202964e..a4b2e950f9a2093120b7382ac9c182ee94b85e3b 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-31  Kayvan A. Sylvan  <kayvan@sylvan.com>
+
+       * insetexternal.C (doSubstitution): Fix filepath ($$FPath in
+       external_templates) to use the buffer->fileName() but only if
+       previewing. Generating a TeX file should make FPath return
+       "".
+
 2001-10-30  John Levon  <moz@compsoc.man.ac.uk>
 
        * insetert.h:
index 6870de8fb8f7da0ba619f62023f03685d37d4ced..6fb09380e78dcadac45ccc82176c20a941545ecf 100644 (file)
@@ -235,7 +235,10 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
 {
        string result;
        string const basename = ChangeExtension(params_.filename, string());
-       string const filepath = OnlyPath(MakeAbsPath(params_.filename));
+       string filepath = "";
+       if (buffer && (!buffer->niceFile)) {
+               filepath = OnlyPath(MakeAbsPath(buffer->fileName()));
+       }
        result = subst(s, "$$FName", params_.filename);
        result = subst(result, "$$Basename", basename);
        result = subst(result, "$$Parameters", params_.parameters);