首页 > 代码库 > 国庆要去学象棋(Latex)

国庆要去学象棋(Latex)

国庆要和朋友一起学象棋了, 看到外国的网站了一个比较有趣的东西, 赶紧把玩下。

先效果:






嘿嘿  代码来了哟:

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=1cm,right=1cm,top=2cm,bottom=2cm]{geometry}
\usepackage{chessboard,xskak}
\usepackage{graphicx,booktabs}
\pagestyle{empty}
\setlength{\parindent}{0pt}
\begin{document}\centering
 
\scalebox{2}{\chessboard[setpieces={Ne4,Ka1,ka2}]}
 
\scalebox{2}{%
\setchessboard{showmover=false}
\newchessgame
\chessboard}
 
\scalebox{2}{%
\setchessboard{showmover=true}
\chessboard[setpieces={Ka1,ka2,Rb1,rb2,Nc1,nc2,Qd1,qd2,Be1,be2,Pf1,pf2,Qd3},
    pgfstyle=straightmove,
    arrow=stealth,
    linewidth=.25ex,
    padding=1ex,
    color=red!75!white,
    pgfstyle=straightmove,
    shortenstart=1ex,
    showmover=true,
    markmoves={d3-h7,d3-a6,d3-b1,d3-f1,d3-d8,d3-d1,d3-a3,d3-h3}]
}
 
Capital letters for white, small letters for black.
 
\begin{tabular}{cll} \toprule
Letter & English & German \\ \midrule
K & King & König \Q & Queen & Dame \R & Rook & Turm \N & Knight & Pferd \B & Bishop & Läufer \P & Pawn & Bauer \\ \bottomrule
\end{tabular}


国庆要去学象棋(Latex)