]> git.lyx.org Git - features.git/blob - lib/scripts/fen2latex.py
eb5d426a65cd01d56f6b54978316c83d7fe2d678
[features.git] / lib / scripts / fen2latex.py
1 #!/usr/bin/python
2 #
3 # Copyright (C) 2001 The LyX Team.
4 #
5 # This file is distributed under the GPL license.
6 #
7 # This script will convert a chess position in the FEN
8 # format to a chunk of LaTeX to be used with the skak.sty
9 # style.
10
11 import sys,string,os
12
13 os.close(0)
14 os.close(1)
15 sys.stdin = open(sys.argv[1],"r")
16 sys.stdout = open(sys.argv[2],"w")
17
18 line = sys.stdin.readline()
19 if line[-1] == '\n':
20     line = line[:-1]
21
22 print "\\fenboard{"+line+"}" 
23 print "\\showboard%"
24