我对 TeX 很熟悉。在互联网上搜索后,我能够将以下代码放在一起,但最后一对图表不断生成第二页。我该如何减少小页面(或棋盘,如果是这种情况)之间的填充?
\documentclass[10pt]{article}
\usepackage[skaknew]{chessboard,skak}
\usepackage{latexsym}
\usepackage[utf8]{inputenc}
\font\logo=logo10
\font\sknf=SkakNew-Figurine
\font\sknfbx=SkakNew-FigurineBold
\font\skndia=SkakNew-DiagramT
\def\Metafont{\mbox{\logo METAFONT}}
\usepackage{a4wide}
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
\frenchspacing
\begin{document}
\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkbnr/pppppppp/8/8/2P5/8/PP1PPPPP/RNBQKBNR b KQkq c3 0 1,
]
\end{minipage}
\hspace{1.3cm}
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pppppppp/5n2/8/2P5/8/PP1PPPPP/RNBQKBNR w KQkq - 1 2,
]
\end{minipage}
\end{figure}
\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pppppppp/5n2/8/2P5/2N5/PP1PPPPP/R1BQKBNR b KQkq - 2 2,
]
\end{minipage}
\hspace{1.3cm}
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp1ppppp/2p2n2/8/2P5/2N5/PP1PPPPP/R1BQKBNR w KQkq - 0 3,
]
\end{minipage}
\end{figure}
\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp1ppppp/2p2n2/8/2P1P3/2N5/PP1P1PPP/R1BQKBNR b KQkq e3 0 3,
]
\end{minipage}
\hspace{1.3cm}
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp2pppp/2p2n2/3p4/2P1P3/2N5/PP1P1PPP/R1BQKBNR w KQkq d6 0 4,
]
\end{minipage}
\end{figure}
\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp2pppp/2p2n2/3pP3/2P5/2N5/PP1P1PPP/R1BQKBNR b KQkq - 0 4,
]
\end{minipage}
\hspace{1.3cm}
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp2pppp/2p2n2/4P3/2Pp4/2N5/PP1P1PPP/R1BQKBNR w KQkq - 0 5,
]
\end{minipage}
\end{figure}
\clearpage
\end{document}
答案1
有很多选项。您可以注释掉所有环境figure
,可以将其添加\addtolength{\voffset}{-0.5in}
到文档前言中,也可以使用tinyboard
而不是。您可以通过包中的命令smallboard
手动缩放板。我附上一次尝试和预览。\resizebox
graphicx
编辑:我还附上了一个可以生成一系列图表的完整工作示例。
%! *latex mal-chess.tex
\documentclass[10pt]{article}
\usepackage[skaknew]{chessboard,skak}
%\usepackage{latexsym}
%\usepackage[utf8]{inputenc}
%\font\logo=logo10
%\font\sknf=SkakNew-Figurine
%\font\sknfbx=SkakNew-FigurineBold
%\font\skndia=SkakNew-DiagramT
%\def\Metafont{\mbox{\logo METAFONT}}
%\usepackage{a4wide}
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
\addtolength{\voffset}{-0.5in}
%\frenchspacing
\begin{document}
\def\malspace{\hspace{10mm}}
%\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[tinyboard, % smallboard
setfen=rnbqkbnr/pppppppp/8/8/2P5/8/PP1PPPPP/RNBQKBNR b KQkq c3 0 1,
]
\end{minipage}%
\malspace
\resizebox{3cm}{!}{%
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard, % smallboard
setfen=rnbqkb1r/pppppppp/5n2/8/2P5/8/PP1PPPPP/RNBQKBNR w KQkq - 1 2,
]
\end{minipage}}%
%\end{figure}
%\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pppppppp/5n2/8/2P5/2N5/PP1PPPPP/R1BQKBNR b KQkq - 2 2,
]
\end{minipage}%
\malspace
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp1ppppp/2p2n2/8/2P5/2N5/PP1PPPPP/R1BQKBNR w KQkq - 0 3,
]
\end{minipage}%
%\end{figure}
%\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp1ppppp/2p2n2/8/2P1P3/2N5/PP1P1PPP/R1BQKBNR b KQkq e3 0 3,
]
\end{minipage}%
\malspace
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp2pppp/2p2n2/3p4/2P1P3/2N5/PP1P1PPP/R1BQKBNR w KQkq d6 0 4,
]
\end{minipage}%
%\end{figure}
%\begin{figure}[ht]
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp2pppp/2p2n2/3pP3/2P5/2N5/PP1P1PPP/R1BQKBNR b KQkq - 0 4,
]
\end{minipage}%
\malspace
\begin{minipage}[b]{0.45\linewidth}
\chessboard[smallboard,
setfen=rnbqkb1r/pp2pppp/2p2n2/4P3/2Pp4/2N5/PP1P1PPP/R1BQKBNR w KQkq - 0 5,
]
\end{minipage}%
%\end{figure}
%\clearpage
\end{document}
完整工作示例
如果棋图与你的情况类似,你可以将最后一张图与所有这些动作放在一起,然后使用\xskakloop
带有参数的命令 step
,该参数是半步的数量。这是xskak
包。它是chessboard
包裹。
如果您不介意论文和源代码中出现几个捷克语单词,这就是我曾经排版过的内容。
%! lualatex mal-chess.tex
\documentclass{article}
\usepackage[svgnames]{xcolor}
\usepackage{pifont,graphicx}
\usepackage[utf8]{luainputenc}
\usepackage[LSBC3,IL2]{fontenc}
\pagestyle{empty}
\usepackage[czech]{babel}
\usepackage{xskak}
\parindent=0pt
\addtolength{\voffset}{-1in}
\addtolength{\hoffset}{-1in}
\addtolength{\textwidth}{2.95cm}
\addtolength{\textheight}{10\baselineskip}
\begin{document}
\shorthandoff{-}
\fontsize{10pt}{14pt}\selectfont
\def\prvni{Gold}
\def\druha{Gold}
\def\treti{black}
\def\ctvrta{black}
\font\sachy=SkakNew-Diagram at 10pt
\newdimen\muj \muj=-0.32ex
\def\leva#1#2{\color{\prvni}\sachy \raisebox{\muj}{#1}\color{\ctvrta}\raisebox{\muj}{#2}}
\def\prava#1#2{\color{\druha}\sachy \raisebox{\muj}{#1}\color{\treti}\raisebox{\muj}{#2}}
\makeatletter
%\def\cfss@symrook{{\figfont H}}
\ifx
\def\lrook{Vr} \def\rrook{VR}
\def\lknight{Un} \def\rknight{UN}
\def\lbishop{Wb} \def\rbishop{WB}
\def\lqueen{Xq} \def\rqueen{XQ}
\def\lking{Tk} \def\rking{TK}
\fi
\renewcommand*\cfss@rook@@LSB{\WhiteToMove{\leva Vr}{\prava VR}}
\renewcommand*\cfss@knight@@LSB{\WhiteToMove{\leva Un}{\prava UN}}
\renewcommand*\cfss@bishop@@LSB{\WhiteToMove{\leva Wb}{\prava WB}}
\renewcommand*\cfss@queen@@LSB{\WhiteToMove{\leva Xq}{\prava XQ}}
\renewcommand*\cfss@king@@LSB{\WhiteToMove{\leva Tk}{\prava TK}}
% \WhiteToMove{\color{\prvni}\cfss@BlackRookOnWhite}{\color{\druha}\cfss@WhiteRookOnWhite}%
% \WhiteToMove{\color{\prvni}\cfss@symrook}{\color{\druha}\cfss@symrook}%
\cbDefineMoverStyle%
%#1: optional, can be used e.g. for checks
%#2=style name, #3=white top, #4=white bottom,
%#5=black top, #6=black bottom
[\@ifundefined{rotatebox}%
{\PackageError{chessboard}%
{You must load the package graphics or graphicx
if you want to use the mover style squarearrow}{}}%
{}%
\@ifundefined{ding}%
{\PackageError{chessboard}%
{You must load the package pifont
if you want to use the mover style squarearrow}{}}%
{}]
{squarearrow}% #2
{\rotatebox{-90}{{\color{Gold}\makebox[0pt][l]{$\blacksquare$}}$\square$\,\ding{222}}}%
{\rotatebox{90}{{\color{Gold}\makebox[0pt][l]{$\blacksquare$}}$\square$\,\ding{222}}}%
{\rotatebox{-90}{$\blacksquare$\,\ding{222}}}%
{\rotatebox{90}{$\blacksquare$\,\ding{222}}}%
\makeatother
\hfil\textbf{{\color{Gold}Jana Jacková (2388)} {\color{red}versus} Anatoli Karpov (2651)}\medskip
\hfil Sněženky a Machři, Mariánské Lázně, Miniaturky\par
\hfil Odehráno 29. listopadu 2008 s výsledkem 1--0%
\bigskip
\setfigstyle{\normalfont}
\longmoves
\xskaknewstyleitem[%
whiteopen={.~},
blackopen={.\,\space\ldots},
beforewhite={},%\space,
beforeblack=\space,%\space,
afterwhite=,%\space,
afterblack={\space\,},%\space,
]{styleD}
\xskaknewstyle[level=1,styleitem=styleD,font=\bfseries]{styleD} %
\newchessgame[%
%print,
id=A,
result=1--0,%
]
\mainline[style=styleD]
{%\mainline %\hidemoves Nf3
1.e4 c5 2. Nf3 e6 3.d4 cxd4 4.Nxd4 a6 5.Nc3 Qc7 6.Bd3 Nf6
7.O-O Bd6 8.f4 Bc5 9.Nce2 Nc6 10.c3 d6 11.Kh1 Bd7 12.Qe1
O-O 13.Qh4 Rfe8 14.Nf3 e5 15.b4 Bb6 16.fxe5 dxe5 17.Ng5
h6 18.Rxf6 hxg5 19.Bxg5 Be6 20.Nf4 Ne7 21.Nd5 Qd7 22.Rh6
Ng6 \xskakcomment{ a černý se vzdal!}}% \xskakgetgame{result} %1-0
%\xskakcomment{1-0}
\medskip
\ifx
\def\prvni{Gold}
\def\druha{Gold}
\def\treti{black}
\def\ctvrta{black}
\def\lrook{VR} \def\rrook{Vr}
\def\lknight{UN} \def\rknight{Un}
\def\lbishop{WB} \def\rbishop{Wb}
\def\lqueen{XQ} \def\rqueen{Xq}
\def\lking{TK} \def\rking{Tk}
\fi
\usetextfig %\usesymfig
\xskakloop[step=3,showlast]{%
\begin{tabular}{@{}c@{}}
\chessboard[
tinyboard,
inverse,
%showmoves=false,
showmover=true,
boardfontfamily=skaknew,
boardfontencoding=LSBC3,
whitepiecemaskcolor=Gold,
blackpiecemaskcolor=Gold,
%color=Gold,
setfontcolors,
moverstyle=squarearrow,
setfen=\xskakget{nextfen},
]\\
\xskakget{opennr}%
\xskakget{lan}%
\end{tabular}\quad}%
\medskip
\centering\bfseries
{\color{Gold}%
Jana Jacková (* 1982) je absolventka Fakulty managementu a ekonomiky Univerzity Tomáše Bati ve Zlíně a jediná česká šachistka s titulem mezinárodního mistra.}%
\smallskip%
Anatoli Karpov (* 1951) je významný ruský šachista a vícenásobný mistr světa v~šachu. Jeho šachová rivalita s Garrim Kasparovem je dnes již legendární.
\end{document}