I am trying to set a layout for a twocolumn book with a particular page layout (specified with the geometry
package) and with the text in both columns aligned to each other. For this I've already adjusted the lengths of the spaces between paragraphs and before and after floats:
%%% adjust all spacings to \baselineskip to align text paragraphs and floats
\usepackage{setspace}
\setstretch{1.5}
\setlength{\parskip}{\baselineskip}
\usepackage{etoolbox}
\BeforeBeginEnvironment{figure}{\kern \baselineskip}
and it works out fine for the standard page layout*:
However, once I alter the page layout, specifically the body text, with the geometry
package it stops working.
Can somebody explain me why this happens and how I can fix it?
Here's the MWE.
\documentclass[twocolumn]{book}
% page layout settings with geometry
\usepackage[papersize={240mm,300mm}
,hmargin={25mm}
,top={20mm}
,columnsep={10mm}
,body={190mm, 220mm} % <- when textbody is changed, fig/float placement changes!
]{geometry} %,
\usepackage{lipsum} % generates filler dummy text
\usepackage[demo]{graphicx} % demo option replace images with black rectangles for testing purposes
\usepackage{caption}
% adjust all spacings to \baselineskip to align text paragraphs and floats
\usepackage{setspace}
\setstretch{1.5}
\setlength{\parskip}{\baselineskip}
\usepackage{etoolbox}
\BeforeBeginEnvironment{figure}{\kern \baselineskip}
\begin{document}
\lipsum[4]
\begin{figure}[tb]
\centering
\includegraphics[width=0.8\columnwidth]{castle}
\caption{This is a caption This is a caption This is a caption This is a cThis is a captionThis is a captionThis is a captionThis is a captionaption This is a caption.}
\end{figure}
\lipsum
\end{document}
\setstretch{1.9}
, the text is aligned fine again. The setstretch command has to match the new dimensions of the textbody...which i think is most easily done with trial and error.