From: Kornel Benko Date: Thu, 23 Aug 2018 09:58:32 +0000 (+0200) Subject: Replacement for chess support X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=017b25b0c715edfb57a525310ef5ceb0bb707714;p=features.git Replacement for chess support This layout does not use lyxskak.sty, which depends on skak.sty Instead it uses chessboard.sty, depending on chessfss and xskak. Compiles and displays fine with pdflatex, XeTeX but still does not compile with lualatex. We are now able again to mark fields and moves on the chessboard --- diff --git a/lib/Makefile.am b/lib/Makefile.am index d6e8f429cf..fc8f2706b5 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -329,6 +329,7 @@ dist_examples_DATA = \ examples/beamerposter.lyx \ examples/biblioExample.bib \ examples/chess-article.lyx \ + examples/chessboard-article.lyx \ examples/chessgame.lyx \ examples/colored-boxes.lyx \ examples/docbook_article.lyx \ @@ -2168,6 +2169,7 @@ dist_layouts_DATA =\ layouts/bxjsslide.layout \ layouts/changebars.module \ layouts/chess.layout \ + layouts/chessboard.layout \ layouts/cl2emult.layout \ layouts/copernicus.layout \ layouts/ctex-article.layout \ diff --git a/lib/examples/chessboard-article.lyx b/lib/examples/chessboard-article.lyx new file mode 100644 index 0000000000..a4abf0d0dc --- /dev/null +++ b/lib/examples/chessboard-article.lyx @@ -0,0 +1,677 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 563 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass chessboard +\begin_preamble +\usepackage{multicol} +\columnsep 0.25in +\columnseprule 0.4pt +\hyphenpenalty 10000 +\end_preamble +\use_default_options true +\maintain_unincluded_children false +\language english +\language_package default +\inputencoding auto +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize 10 +\spacing single +\use_hyperref false +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine biblatex-natbib +\cite_engine_type authoryear +\biblatex_bibstyle authoryear +\biblatex_citestyle authoryear +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_minted 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 1cm +\topmargin 1cm +\rightmargin 1cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation skip +\defskip medskip +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tracking_changes false +\output_changes false +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\end_header + +\begin_body + +\begin_layout Title + +\series bold +\size larger +Email Chess Game analyzed +\end_layout + +\begin_layout Author + +\series bold +\size large +Kayvan A. + Sylvan +\begin_inset Newline newline +\end_inset + + +\end_layout + +\begin_layout Author + +\series bold +\emph on +Game start 05/29/2001 +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +begin{multicols}{2} +\end_layout + +\end_inset + + +\end_layout + +\begin_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 \SpecialChar LyX +'s new chessboard + layout (based on the +\begin_inset Quotes eld +\end_inset + +xskak.sty +\begin_inset Quotes erd +\end_inset + + package from CTAN +\end_layout + +\begin_layout Standard +\begin_inset CommandInset line +LatexCommand rule +offset "0.5ex" +width "100line%" +height "1pt" + +\end_inset + + +\end_layout + +\begin_layout Standard + +\noun on +Sylvan, Kayvan +\begin_inset space \hfill{} +\end_inset + +Wakeham, Marc +\noun default + +\begin_inset Newline newline +\end_inset + +(1623) +\begin_inset space \hfill{} +\end_inset + + (1639) +\end_layout + +\begin_layout Standard +\noindent +\begin_inset CommandInset line +LatexCommand rule +offset "0.5ex" +width "100line%" +height "1pt" + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 1 +status collapsed + +\begin_layout Plain Layout + +outvar +\end_layout + +\end_inset + + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +1. + e4 c5 2. + Nc3 d6 3. + g3 Nc6 4. + Bg2 e6 5. + Nge2 +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\noindent +\align center +\begin_inset Flex ChessBoard +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout + +d2-d4 +\end_layout + +\end_inset + + +\begin_inset Argument 3 +status open + +\begin_layout Plain Layout +d4,f4 +\end_layout + +\end_inset + + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout +g1-e2 +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\noindent +\align block +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. +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +5... + Be7?! +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\noindent +\align block +\begin_inset Flex Variation +status open + +\begin_layout Plain Layout + +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout + +invar +\end_layout + +\end_inset + + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +5... + Ng7 +\end_layout + +\end_inset + + +\begin_inset Argument 3 +status open + +\begin_layout Plain Layout + + +\backslash +equal{} was better +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 1 +status collapsed + +\begin_layout Plain Layout + +outvar +\end_layout + +\end_inset + + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +6. + d4 cxd4 7. + Nxd4 a6 +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +With 7... + a6, we are back in the well-trodden theory of this opening. +\end_layout + +\begin_layout Standard +\noindent +\align center +\begin_inset Flex ChessBoard +status open + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +8. + Nxc6 bxc6 9. + O-O Bb7 10. + Qg4 Bf6 11. + Bf4 Ne7 12. + Rad1 +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\noindent +\align center +\begin_inset Flex ChessBoard +status open + +\begin_layout Plain Layout +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout + +a1-d1 +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +White continues to develop pieces and also sets a trap for Black. +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +12... + O-O? +\end_layout + +\end_inset + + +\begin_inset Argument 3 +status open + +\begin_layout Plain Layout + +This move loses instantly. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +The following was better, even though white retains the upper hand. +\end_layout + +\begin_layout Standard +\begin_inset Flex Variation +status open + +\begin_layout Plain Layout + +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout + +invar +\end_layout + +\end_inset + + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +12... + e5 13. + Be3 Qc7 14. + Na4 O-O +\end_layout + +\end_inset + + +\begin_inset Argument 3 +status open + +\begin_layout Plain Layout + + +\backslash +wbetter +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 1 +status open + +\begin_layout Plain Layout + +outvar +\end_layout + +\end_inset + + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +13. + e5! +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Black's knight and bishop form a bumbling pair here. + The bishop is doomed. +\end_layout + +\begin_layout Standard +\begin_inset Flex Mainline +status open + +\begin_layout Plain Layout + +\begin_inset Argument 2 +status open + +\begin_layout Plain Layout + +13... + Nd5!? 14. + Bxd5 cxd5 15. + exf6 Qxf6 16. + Bxd6 Rfd8 17. + Bc7 Rd7 18. + Bf4 1-0 +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\noindent +\align center +\begin_inset Flex ChessBoard +status open + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + + +\backslash +end{multicols} +\end_layout + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/lib/layouts/chessboard.layout b/lib/layouts/chessboard.layout new file mode 100644 index 0000000000..01f3ee888c --- /dev/null +++ b/lib/layouts/chessboard.layout @@ -0,0 +1,132 @@ +#% Do not delete the line below; configure depends on this +# \DeclareLaTeXClass[scrartcl]{Chessboard} +# \DeclareCategory{Articles} +# chessboard article textclass definition file. + +Format 69 + +Requires chessfss + +ClassOptions + Other "parskip" +End + +Preamble + \usepackage{xskak} + \pagestyle{empty} + \AtBeginDocument{ + \newchessgame + \setchessboard{pgfstyle=straightmove, arrow=to,linewidth=0.1em, smallboard} + } +EndPreamble + +Style Standard + Align Block + AlignPossible Block, Left, Right, Center +End + +Input stdsections.inc +Input stdtitle.inc + +InsetLayout Flex:Mainline + LyXType custom + LatexType Command + LatexName mainline + Decoration Classic + LabelString "Mainline:" + PassThru 1 + ParbreakIsNewline 1 + LabelFont + Color blue + Series bold + EndFont + Font + Color blue + EndFont + Argument 1 + LabelString id + ToolTip "'invar' or 'outvar'" + Decoration Conglomerate + EndArgument + Argument 2 + Mandatory 1 + LabelString "Moves" + Decoration Conglomerate + EndArgument + Argument 3 + LabelString "Comment" + Mandatory 1 + LeftDelim "{ " + Font + Color Green + EndFont + Decoration Conglomerate + EndArgument +End + +InsetLayout Flex:Variation + CopyStyle Flex:Mainline + LatexName variation + LabelString Variation +End + +InsetLayout Flex:ChessBoard + LyXType custom + LatexType Command + LatexName chessboard + LabelString "[chessboard]" + Decoration Classic + KeepEmpty 1 + LabelFont + Color Red + EndFont + Argument 1 + LabelString "Arrows" + ToolTip "Comma separated list of the form from-to (like d2-d4)" + LeftDelim "[pgfstyle=straightmove,markmoves={" + RightDelim "}," + DefaultArg " " + PassThru 1 + Decoration Conglomerate + EndArgument + Argument 2 + LabelString "Knigt" + ToolTip "List of knight moves (crooked arrows) g1-e2, g1-h3" + LeftDelim "pgfstyle=knightmove,markmove={" + RightDelim "}," + Decoration Conglomerate + EndArgument + Argument 3 + LabelString "Mark" + ToolTip "Comma separated list of fields to be marked with a circle (like d4,f4,c7)" + DefaultArg " " + LeftDelim "pgfstyle=circle,markfields={" + RightDelim "}]" + Decoration Conglomerate + EndArgument +End + +InsetLayout Flex:ChessBoardStore + CopyStyle Flex:ChessBoard + ResetArgs 1 + LabelString "StoreChessboard" + Argument 1 + LabelString "Store FEN" + ToolTip "Store the 'FEN' under the given name" + LeftDelim "[print=false,storefen={" + RightDelim "}]" + EndArgument +End + +InsetLayout Flex:ChessBoardRestore + CopyStyle Flex:ChessBoard + ResetArgs 1 + LabelString "RestoreChessboard" + Argument 1 + LabelString "Restore FEN" + ToolTip "Restore the 'FEN' to the version saved under the given name" + LeftDelim "[print=false,restorefen={" + RightDelim "}]" + EndArgument +End +