Consider the following Minimal Working Example (MWE):
\documentclass{article}
\usepackage{xcoffins,kantlipsum}
\begin{document}
\NewCoffin \MyCoffin
\NewCoffin \YourCoffin
\SetVerticalCoffin \MyCoffin {.75\linewidth}
{%
\kant[1]
}
\SetVerticalCoffin \YourCoffin {.75\linewidth}
{%
\kant[2]
}
\JoinCoffins \MyCoffin [b,l] \YourCoffin [t,l]
\TypesetCoffin \MyCoffin
\end{document}
If you prefer the expl3 syntax, here's the same example using the underlying functions rather than the xcoffins interface:
\documentclass{article}
\usepackage{expl3,kantlipsum}
\begin{document}
\ExplSyntaxOn
\coffin_new:N \l_exp_my_coffin
\coffin_new:N \l_exp_your_coffin
\vcoffin_set:Nnn \l_exp_my_coffin {.75\linewidth}
{
\kant[1]
}
\vcoffin_set:Nnn \l_exp_your_coffin {.75\linewidth}
{
\kant[2]
}
\coffin_join:NnnNnnnn \l_exp_my_coffin { b } { l } \l_exp_your_coffin { t } { l } { 0pt } { 0pt }
\coffin_typeset:Nnnnn \l_exp_my_coffin { b } { l } { 0pt } { 0pt }
\ExplSyntaxOff
\end{document}
Either way, the result is
which is obviously not ideal. Ideally, the result would be similar to the result of typesetting the contents of both coffins in a single coffin.
\SetVerticalCoffin \MyCoffin {.75\linewidth}
{%
\kant[1-2]
}
\TypesetCoffin \MyCoffin
Obviously there are ways to work around this problem. The following list of such methods is intended to be indicative rather than exhaustive.
- Include explicit vertical spacing as content at the end of
\MyCoffin. - Include explicit vertical spacing as content at the start of
\YourCoffin. - Use the offset option of
\JoinCoffinsto adjust the point at which\YourCoffinis joined to\MyCoffin.
For example
\SetVerticalCoffin \MyCoffin {.75\linewidth}
{%
\kant[1]
}
\SetVerticalCoffin \YourCoffin {.75\linewidth}
{%
\kant[2]
}
\JoinCoffins\MyCoffin[b,l]\YourCoffin[t,l](0pt,-.2\baselineskip-\parskip)
\TypesetCoffin \MyCoffin
approximates the correct result.
However, not only is this not quite right, it is inflexible and fiddly. Moreover, it seems rather alien to the whole concept of coffins and their approach. At best, it is inelegant: it re-complicates something which the idea of a coffin was, I think, trying to simplify.
That is, I'm certain this cannot be how I'm supposed to do this.
What is the correct way to stack two coffins so that the vertical spacing between their contents is more-or-less what it would be if the content of both was simply set in a single coffin?
Note that a solution need not use the xcoffins interface. I'm really interested in the expl3 layer and have only translated to the higher-level macros to simplify presentation of the question.





\prevdepth. Search this site about\prevdepthwithminipages. May be this should be implemented “officially”? – Manuel Jun 05 '16 at 22:52