Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm knew to TeX. Searching on the Internet, I was able to put the following code together, but the last pair of diagrams keeps generating a second page. How can I reduce the padding between minipages (or chessboards, if that's the case)?

\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}
share|improve this question
    
OK, just found out the answer: by removing the surrounding figure tags around the minipages (they were useless), the exceeding spacing disappeared. –  user1755025 Apr 4 at 1:21
    
You can write a "proper" answer, instead of just a comment; in this way, it will be clear that the problem has already been solved and that one possible solution was the one that you found. You can even accept your own answer. –  Gonzalo Medina Apr 4 at 1:51
    
I don't have enough points for that. Still, it would be interesting to know how to modify the mentioned spacing when the time comes to add figure tags and figure labels. That would certainly mess with the spacing again. –  user1755025 Apr 4 at 1:54
    
Can you please edit your question and add an example with figure tags and figure labels? –  Gonzalo Medina Apr 4 at 2:01
    
You don't have enough points to answer? Surely that's not right? I answered questions here before ever posting my first question so I must have done so with as close to zero points as you can have (1?). –  cfr Apr 4 at 2:24
show 2 more comments

1 Answer 1

up vote 2 down vote accepted

There is a lot of options. You can comment out all the figure environments, you can add \addtolength{\voffset}{-0.5in} to the document preamble, you can also use tinyboard instead of smallboard. You could scale the boards manually by the \resizebox command from the graphicx package. I enclose one try and a preview of it.

Edit: I also enclose a full working example which generates a series of diagrams.

%! *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}

mwe, second try


Full working example

If the chess diagrams are related as in your case, you could take your very last diagram with all those moves and you can use \xskakloop command with step parameter which is a number of halfmoves. It is a powerful feature of the xskak package. It is a sister package to the chessboard package.

If you don't mind several words in Czech in the paper and in the source code, this is what I typesetted once.

%! 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}

fwe

share|improve this answer
    
Please, don't use a4wide: it's deprecated because very buggy. Also \font is not really good in LaTeX. –  egreg Apr 4 at 23:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.