0

I'm looking for a way to lay out a series of chess problems, each of which has a figure (a chessboard diagram) and some text. Each figure is about 70x70mm. In an effort to avoid too much wasted page space, I have tried using packages floatflt and wrapfig to get text typeset to wrap around a figure. However, this does not prevent figures overlapping each other -- this can happen if one problem has so little text that its figure extends further down the page than its text.

So how can I prevent figures overlapping?

It would be nice to resume typesetting at a y-coordinate which is just below the lowest figure, or just below the lowest line of text, whichever is the lower.

I envisage something which is like a \FloatBarrier but which is impervious to figures. Perhaps coupled with something like \parshape which controls the margin behaviour of a block of text which includes several paragraphs.

I have tried enclosing each problem (figure and text) in

\begin{minipage}[l]{\textwidth}
...
\end{minipage}

(where \textwidth is the distance between the margins on the full page) but that again fails to keep the figures apart.

I tried

\begin{tabular}{cc}
  \rule{0mm}{70mm}&
  \begin{minipage}[l]{\textwidth}
    ...
  \end{minipage}
\end{tabular}

but the result is a typographical disaster when there is so little text that it occupies less vertical space than the figure. Again, figures overlap. My intention was to use something which is like a \strut but taller, and taking effect over a block of text which contains a few paragraphs.

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[LSBC4,T1]{fontenc} % use fontenc before chessboard
\usepackage{chessboard}
\usepackage{placeins,floatflt}
\usepackage{lipsum}

\setboardfontencoding{LSBC4}

\setlength{\hoffset}{-20mm}
\setlength{\textwidth}{180mm}
\setlength{\voffset}{-30mm}
\setlength{\textheight}{262mm}

\newcommand{\figWidth}{69mm}

\begin{document}

\begin{floatingfigure}[l]{\figWidth}
  \setchessboard{setfen=/PP/k//K///1q}
  \chessboard
\end{floatingfigure}

Frank M\"uller

Mezija, Jan-Mar 1997, no. 883

s\#3

Solution:  1 a8=Q+ Kb6 2 b8=Q+ Kc5 3 Qb4+ Qxb4\#

%\FloatBarrier
%\subsubsection{}

\begin{floatingfigure}[r]{\figWidth}
  \setchessboard{setfen=2kr1B/p1pNK1p/RPp2P/4P/2P/1p}
  \chessboard
\end{floatingfigure}

Gustav Jönsson

Eskilstuna Kuriren, 1939; FIDE Album 1914--44, no. 334

Proca-retractor. White retracts four moves and then checkmates in one

Keywords: Valladao theme (castling, en passant capture and underpromotion)

Solution: \lipsum[1] And some of this text has overlapped the figure's bottom.

\end{document}
Rosie F
  • 444
  • You could use \wrapskip from https://tex.stackexchange.com/questions/495675/make-wrapfigure-span-over-two-exsheets-questions/495707?r=SearchResults&s=1|0.0000#495707 – John Kormylo Jun 26 '19 at 15:53
  • @JohnKormylo Thank you for that reference. I tried that. I tried the code in that answer of yours, and the code in that question by pozitron you answered. In all 3 cases pdfLaTex and LuaLaTex both give error: exsheets.sty 2794 LaTeX3 Error: Variant form 'n' deprecated for base form (LaTeX3) '__exsheets_blank_skip:N'. One should not change an argument from type 'N' to type 'n': base form only accepts a single token argument. – Rosie F Jun 27 '19 at 05:53
  • The error is from exsheets itself and I get it too. Nothing i can do about it, though. At least it doesn't seem to affect the result. – John Kormylo Jun 27 '19 at 13:26
  • @JohnKormylo \wrapskip works. But \wrapspacer{ } seems to not wrap the text, but just confine it all to the same margins throughout. – Rosie F Jun 27 '19 at 14:58
  • \wrapspacer was intended for (short) things which are not text, like equations or secdtion headers. More precisely, anything which is not spaced \baselineskip apart. – John Kormylo Jun 28 '19 at 04:14

0 Answers0