From 2c38621296bf9859266da2433f18e924e40b2cc9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 22 Jul 2023 20:18:30 +0000 Subject: mpchess (22jul23) git-svn-id: svn://tug.org/texlive/trunk@67704 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/metapost/mpchess/mpchess-doc-en.pdf | Bin 862646 -> 1000703 bytes .../doc/metapost/mpchess/mpchess-doc-en.tex | 109 ++++++++++++++++++--- .../doc/metapost/mpchess/mpchess-doc-fr.pdf | Bin 867272 -> 1005336 bytes .../doc/metapost/mpchess/mpchess-doc-fr.tex | 103 ++++++++++++++++--- .../doc/metapost/mpchess/mpchess-preamble.tex | 2 +- 5 files changed, 189 insertions(+), 25 deletions(-) (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.pdf b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.pdf index 421fa6b0608..741544029ed 100644 Binary files a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.pdf and b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.pdf differ diff --git a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.tex b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.tex index bcc74e5003f..5ad5abdb1a6 100644 --- a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.tex +++ b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-en.tex @@ -68,7 +68,7 @@ } \vfill \begin{center} - Version 0.6, 2023, April, 26th \\ + Version 0.7, 2023, July, 20th \\ \url{https://plmlab.math.cnrs.fr/mchupin/mpchess} \end{center} %% == Page de garde ==================================================== @@ -293,12 +293,15 @@ command: \item[\meta{string}] can be: \begin{itemize} \item \lstinline+"BlueLichess"+ (default); -\item \lstinline+"BrownLichess"+ ; +\item \lstinline+"BrownLichess"+; +\item \lstinline+"GreenLichess"+; +\item \lstinline+"PinkPyramidalLichess"+; +\item \lstinline+"Wood"+; \item or \lstinline+"Classical"+. \end{itemize} \end{description} -The following examples show the results obtained from each theme: +The following example shows the results obtained from \lstinline+"BrownLichess"+: \begin{ExempleMP} input mpchess beginfig(0); @@ -307,21 +310,65 @@ init_backboard; draw backboard; endfig; \end{ExempleMP} -\begin{ExempleMP} -input mpchess -beginfig(0); -set_color_theme("Classical"); -init_backboard; -draw backboard; -endfig; -\end{ExempleMP} -The two color themes provided borrow the colors of the Lichess themes. +The table~\ref{tab:color} shows the different results of the different themes. + +\begin{table} + \centering +\begin{tabular}{cc} + +\lstinline+"GreenLichess"+ theme&\lstinline+"Classical"+ theme\\ +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("GreenLichess"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode} +&\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("Classical"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}\\ +\lstinline+"PinkPyramidalLichess"+ theme& \lstinline+"Wood"+ theme\\ +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("PinkPyramidalLichess"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}& +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("Wood"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}\\ +\end{tabular} +\caption{The different color themes provided by \mpchess.}\label{tab:color} +\end{table} + \subsubsection{Configuring a Personal Color Theme} -A color theme is really just the definition of two colors. +\paragraph{Colors.} +A color theme is the definition of two colors. These can be defined with the following commands\footnote{Attention, in version 0.6, \lstinline+set_white_color+ became \lstinline+set_white_squares_color+ and \lstinline+set_black_color+ became @@ -341,6 +388,40 @@ init_backboard; draw backboard; endfig; \end{ExempleMP} + +\paragraph{Color Types.} + +To choose a type, you can use the following command: + +\commande|set_board_type(«string»)|\index{set_board_type@\lstinline+set_board_type+}\smallskip + + +Three types of coloring are available: + +\begin{description} + \item[\meta{string}] can be: +\begin{itemize} +\item \lstinline+"flat"+, simple flat coloring (default); +\item \lstinline+"pyramidal"+, Lichess \emph{pyramidal} coloring; +\item \lstinline+"wood"+, wood imitation. +\end{itemize} +\end{description} + +Here is an example coupling color and type definitions. + +\begin{ExempleMP} +input mpchess +beginfig(0); +set_white_squares_color((0.9,0.8,0.8)); +set_black_squares_color((0.7,0.6,0.6)); +set_board_type("wood"); +init_backboard; +draw backboard; +endfig; +\end{ExempleMP} + + + \subsection{Display Coordinates} You may have noticed in the various examples that by default, the coordinates are, as on the Lichess site, written in small letters inside the boxes. @@ -1367,6 +1448,8 @@ endfig; \section{History} \begin{description} +\item[v0.7, juillet 2023:] Black knight adjustment, adding color board themes (\lstinline+GreenLichess+, \lstinline+PinkPyramidalLichess+, +\lstinline+Wood+ with color type (\lstinline+set_board_type+). \item[v0.6, April 26, 2023:] Fixed bugs concerning castling management, and moves ambiguities in \textsc{pgn} format. Changed \lstinline+set_white_color+ to diff --git a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.pdf b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.pdf index fd467b65954..bcca5a85f97 100644 Binary files a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.pdf and b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.pdf differ diff --git a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.tex b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.tex index 2ee8714da40..db6a5f8b866 100644 --- a/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.tex +++ b/Master/texmf-dist/doc/metapost/mpchess/mpchess-doc-fr.tex @@ -71,7 +71,7 @@ } \vfill \begin{center} - Version 0.6, 26 avril 2023 \\ + Version 0.7, 20 juillet 2023 \\ \url{https://plmlab.math.cnrs.fr/mchupin/mpchess} \end{center} %% == Page de garde ==================================================== @@ -289,6 +289,9 @@ Plusieurs thèmes de couleurs sont accessibles. Pour choisir un thème de couleu \begin{itemize} \item \lstinline+"BlueLichess"+ (thème par défaut); \item \lstinline+"BrownLichess"+ ; +\item \lstinline+"GreenLichess"+; +\item \lstinline+"PinkPyramidalLichess"+; +\item \lstinline+"Wood"+; \item ou \lstinline+"Classical"+. \end{itemize} \end{description} @@ -302,20 +305,64 @@ init_backboard; draw backboard; endfig; \end{ExempleMP} -\begin{ExempleMP} -input mpchess -beginfig(0); -set_color_theme("Classical"); -init_backboard; -draw backboard; -endfig; -\end{ExempleMP} -Les deux thèmes colorés fournis empruntent les couleurs des thèmes de Lichess. +Le tableau~\ref{tab:color} montre les résultats des différents thèmes fournis +par \mpchess. + +\begin{table} + \centering +\begin{tabular}{cc} + +Thème \lstinline+"GreenLichess"+&Thème \lstinline+"Classical"+\\ +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("GreenLichess"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode} +&\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("Classical"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}\\ +Thème \lstinline+"PinkPyramidalLichess"+&Thème \lstinline+"Wood"+\\ +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("PinkPyramidalLichess"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}& +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("Wood"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}\\ +\end{tabular} +\caption{Les différents thèmes de couleur fournis par \mpchess.}\label{tab:color} +\end{table} \subsubsection{Configuration d’un thème personnel} -Un thème de couleur est en réalité simplement la définition de deux couleurs. +\paragraph{Couleurs.} +Un thème de couleur conciste en la définition de deux couleurs. Celles-ci peuvent se définir avec les commandes suivantes \footnote{Attention, lors du passage à la version 0.6, \lstinline+set_white_color+ est devenu \lstinline+set_white_squares_color+ et \lstinline+set_black_color+ est devenu @@ -335,6 +382,37 @@ init_backboard; draw backboard; endfig; \end{ExempleMP} + +\paragraph{Type de coloriage.} + + +On peut choisir un type de coloriage avec la commande suivante: + +\commande|set_board_type(«string»)|\index{set_board_type@\lstinline+set_board_type+}\smallskip + +Les trois types de coloriage fournis par \mpchess{} se choisissent avec +\begin{description} + \item[\meta{string}] qui peut valoir: +\begin{itemize} +\item \lstinline+"flat"+, coloriage à plat (défaut); +\item \lstinline+"pyramidal"+, coloriage \emph{pyramidal} à la Lichess; +\item \lstinline+"wood"+, imitation bois. +\end{itemize} +\end{description} + +Voici un exemple de paramétrage de couleur et de type de coloriage. + +\begin{ExempleMP} +input mpchess +beginfig(0); +set_white_squares_color((0.9,0.8,0.8)); +set_black_squares_color((0.7,0.6,0.6)); +set_board_type("wood"); +init_backboard; +draw backboard; +endfig; +\end{ExempleMP} + \subsection{Affichage des coordonnées} Vous avez pu constater dans les divers exemples que par défaut, les coordonnées @@ -1346,6 +1424,9 @@ endfig; \section{Historique} \begin{description} +\item[v0.7, juillet 2023:] Ajustement du cavalier noir, ajout de thèmes +d'échiquier (\lstinline+GreenLichess+, \lstinline+PinkPyramidalLichess+, +\lstinline+Wood+ avec des types de coloriage (\lstinline+set_board_type+). \item[v0.6, avril 2023:] Corrections de bugs concernant la gestion des roques, et des ambiguïtés de pièces pour les déplacements sous format \textsc{pgn}. Changement de \lstinline+set_white_color+ en diff --git a/Master/texmf-dist/doc/metapost/mpchess/mpchess-preamble.tex b/Master/texmf-dist/doc/metapost/mpchess/mpchess-preamble.tex index 62e5ad24132..6a7f11d747a 100644 --- a/Master/texmf-dist/doc/metapost/mpchess/mpchess-preamble.tex +++ b/Master/texmf-dist/doc/metapost/mpchess/mpchess-preamble.tex @@ -97,7 +97,7 @@ set_no_coords,set_white_view,set_black_view, set_white_player,set_black_player,set_pieces_theme,set_players_side,init_chessboard,set_empty_chessboard,add_white_pieces,add_black_pieces,clear_areas,clear_files,clear_ranks,clear_squares,build_chessboard_from_fen,build_chessboards_from_pgn,clear_chessboard, color_square,draw_arrows,draw_circles,draw_comment,draw_crosses,get_halfmove_number,get_totalmove_number, - reset_mpchess,set_black_to_move,set_last_move_color,set_comment_color,set_white_to_move,set_whos_to_move,show_last_move,unset_whos_to_move,set_arrow_width,clip_chessboard,build_chessboard_from_fen_file,build_chessboard_from_pgn_file,draw_black_main_lines,draw_black_main_lines_step,draw_white_main_lines,draw_white_main_lines_step,set_main_lines_color,set_possible_moves_color,show_possible_moves,show_possible_moves_step,hide_coordinates,hide_whos_to_move,set_black_squares_color,set_coordinates_font,set_coordinates_position,set_white_squares_color,show_coordinates,show_whos_to_move}, + reset_mpchess,set_black_to_move,set_last_move_color,set_comment_color,set_white_to_move,set_whos_to_move,show_last_move,unset_whos_to_move,set_arrow_width,clip_chessboard,build_chessboard_from_fen_file,build_chessboard_from_pgn_file,draw_black_main_lines,draw_black_main_lines_step,draw_white_main_lines,draw_white_main_lines_step,set_main_lines_color,set_possible_moves_color,show_possible_moves,show_possible_moves_step,hide_coordinates,hide_whos_to_move,set_black_squares_color,set_coordinates_font,set_coordinates_position,set_white_squares_color,show_coordinates,show_whos_to_move,set_board_type}, keywordstyle=\color{darkred}, classoffset=2,% frame=tb morekeywords={backboard,chessboard,chessboard_step}, -- cgit v1.2.3