chess article layout

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2964 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-11-05 16:42:09 +00:00
parent 6b2366646d
commit 38aac55887
3 changed files with 415 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2001-11-05 Kayvan A. Sylvan <kayvan@sylvan.com>
* layouts/chess.layout:
* examples/chess-article.lyx: a new class and example for writing
articles about chess.
2001-11-02 Dekel Tsur <dekelts@tau.ac.il> 2001-11-02 Dekel Tsur <dekelts@tau.ac.il>
* external_templates: Use UpdateResult * external_templates: Use UpdateResult

View File

@ -0,0 +1,239 @@
#LyX 1.2 created this file. For more info see http://www.lyx.org/
\lyxformat 220
\textclass chess
\begin_preamble
\usepackage{multicol}
\usepackage{chess-workshop-symbols}
\smallboard
\columnsep 0.25in
\columnseprule 0.4pt
\hyphenpenalty 10000
\end_preamble
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize 12
\spacing single
\papersize Default
\paperpackage a4
\use_geometry 1
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\leftmargin 0.5in
\topmargin 0.5in
\rightmargin 0.5in
\bottommargin 0.5in
\headheight 0cm
\headsep 0cm
\footskip 0in
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle empty
\layout Standard
\align center
\series bold
\size larger
Email Chess Game analyzed
\size large
\newline
\newline
Kayvan A.
Sylvan
\newline
<kayvan@sylvan.com>
\size default
\emph on
\newline
\newline
Game start 05/29/2001
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
begin{multicols}{2}
\end_inset
\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
layout (based on the
\begin_inset Quotes eld
\end_inset
skak.sty
\begin_inset Quotes erd
\end_inset
package from CTAN).
\layout Standard
\added_space_top medskip \added_space_bottom smallskip \line_top \line_bottom
\noun on
Sylvan, Kayvan
\hfill
Wakeham, Marc
\noun default
\newline
(1623)
\hfill
(1639)
\layout Mainline
\added_space_bottom bigskip
1.
e4 c5 2.
Nc3 d6 3.
g3 Nc6 4.
Bg2 e6 5.
Nge2
\layout BoardCentered
\layout HighLight
d4,f4
\layout Arrow
d2->d4
\layout KnightMove
g1->e2
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
vspace*{-1in} % This is a hack!
\end_inset
\layout Standard
So far, so good.
The e2 knight controls the d4 and f4 squares, preparing an eventual d4
push.
The diagrammed position has been reached before in hundreds of GM games.
\layout Mainline
5...
Be7?!
\layout Variation
5...
Nge7}
\backslash
equal{} was better.{
\layout Mainline
6.
d4 cxd4 7.
Nxd4 a6
\layout Standard
With 7...
a6, we are back in the well-trodden theory of this opening.
\layout BoardCentered
\layout Mainline
8.
Nxc6 bxc6 9.
O-O Bb7 10.
Qg4 Bf6 11.
Bf4 Ne7 12.
Rad1
\layout BoardCentered
\layout Arrow
a1->d1
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
vspace*{-0.5in} % Another hack!
\end_inset
\layout Standard
White continues to develop pieces and also sets a trap for Black.
\layout Mainline
12...
O-O?} This move loses instantly.
{
\layout Standard
The following was better, even though white retains the upper hand.
\layout Variation
12...
e5 13.
Be3 Qc7 14.
Na4 O-O }
\backslash
wbetter {
\layout Mainline
13.
e5!
\layout Standard
Black's knight and bishop form a bumbling pair here.
The bishop is doomed.
\layout Mainline
13...
Nd5!? 14.
Bxd5 cxd5 15.
exf6 Qxf6 16.
Bxd6 Rfd8 17.
Bc7 Rd7 18.
Bf4 1-0
\layout BoardCentered
\layout Standard
\begin_inset ERT
status Collapsed
\layout Standard
\backslash
end{multicols}
\end_inset
\the_end

170
lib/layouts/chess.layout Normal file
View File

@ -0,0 +1,170 @@
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article,lyxskak.sty]{article (Chess)}
# chess article textclass definition file.
# This layout file was designed to allow easy access to all
# the cool features of the skak package for chess notation.
#
# Author : Kayvan A. Sylvan <kayvan@sylvan.com>
#
# Copyright (C) 2001 - The LyX team.
#
# Remaining minor problem:
#
# Sometimes there is too much space under a \showboard, especially
# if you use some of the ornamentation commands (\printknightmove,
# \highlight or \printarrow). For now, a workaround for the problem
# is to insert (using ERT) a \vspace* command (for example,
# \vspace*{-0.5in})
#
Preamble
\usepackage[ps,mover]{lyxskak}
%%% Modified routines from skak.sty
%
\def\lyxprintarrow#1{\lyxprintarrow@#1@}
\def\lyxprintarrow@#1->#2@{\ncline[style=psskak]{-|>}{#1}{#2}}
\def\lyxknightmove#1{\lyxknightmove@#1@}
\def\lyxknightmove@#1->#2@{%
\setcounter{ps@knightangle}{\get@fileangle{\First#1}{\First#2}+%
\get@rankangle{\Second#1}{\Second#2} + \value{ps@inverse}}%
\ncdiagg[style=psskak,angleA=\arabic{ps@knightangle}]{-|>}{#1}{#2}}
%%% Variation indent (You can set this in your preamble)
%
\newlength{\lyxvarindent}
\setlength{\lyxvarindent}{0.2in}
%%% \Var[ moves ] - use in the Variation paragraph styles.
%
\def\Var[#1]{\variation{#1}}
%%% initialize board
%
\newgame
EndPreamble
Style Standard
# To be filled in later. This makes Standard first on the list of layouts.
End
# This is the main line of the chess game. Use PGN notation here.
# Also, this layout can be continued with Control-Enter without
# starting a new paragraph.
#
Style Mainline
LatexType Command
LatexName mainline
Margin Static
LeftMargin MMMMMM
Labeltype Static
LabelString "Mainline: "
Newline 0
PassThru 1
TopSep 0.0
ParSep 0.0
LabelFont
Color blue
Series bold
EndFont
TextFont
Color blue
EndFont
End
# This is a variation. It shows up in the normal fashion (styleB).
# You are free to redefine it by making a new \variationstyle
# as talked about in the skak documentation.
#
Style Variation
CopyStyle Mainline
LatexType Command
LatexName hspace*\lyxvarindent\variation
LabelString "Variation: "
LeftMargin MMMMMMMM
End
# Same as mainline, but it does not print the moves (only updates the
# board position.
#
Style HideMoves
CopyStyle Mainline
LatexName hidemoves
LabelString "HideMoves: "
End
# This simply prints a block left chessboard.
#
Style ChessBoard
CopyStyle Mainline
LatexType Command
LatexName showboard
LabelString "[chessboard]"
KeepEmpty 1
LabelFont
Color red
EndFont
End
# This prints a centered chessboard.
#
Style BoardCentered
CopyStyle Mainline
LatexType Command
LatexName [\showboard\]
LeftMargin MMMMMMMMMMMMM
LabelString "[centered board]"
KeepEmpty 1
LabelFont
Color red
EndFont
End
# This should be a list of comma-separated chessboard squares.
# Should be placed after a ChessBoard or BoardCentered.
#
Style HighLight
CopyStyle Mainline
LatexType Command
LatexName highlight
LeftMargin MMMMMMM
LabelString "Highlights: "
LabelFont
Color black
Series Bold
Shape SmallCaps
EndFont
TextFont
Series Bold
Color black
EndFont
End
# This should be a list of two squares with an ascii arrow (a1->c3)
# Should be placed after a ChessBoard or BoardCentered.
#
Style Arrow
CopyStyle HighLight
LatexType Command
LatexName lyxprintarrow
LeftMargin MMMMMMM
LabelString "Arrow: "
End
# This should be a list of two chessboard squares (again, like g1->e2)
# Should be placed after a ChessBoard or BoardCentered.
#
Style KnightMove
CopyStyle Arrow
LatexType Command
LatexName lyxknightmove
LeftMargin MMMMMMM
LabelString "KnightMove: "
End
Input article.layout