I want to obtain a certain layout, illustrated below: at some point in a line, I'd like to "switch to paragraph mode" (just like a parbox does) and then at some other point I want to resume back to normal full-width typesetting. In my case, the idea is to get a ToC-like look using dotfill, but the question stands for regular text too, I suppose.
Using the xcoffins package I got this partial solution (MNWE below) which is neither very elegant in terms of code nor correct-looking in terms of result:
My questions (illustrated with arrows in the picture above):
- Is this the right™ way to do it ?
- I want the "dot filling" to go all the way to the right margin. Using two
\dotfillcommands somehow works, but the result doesn't look quite right (cf picture, there is extra space between the two dotfills). Is there a way out of this ? - How do I fix the wrong interline spacing below the coffin ? In the "central column" I'd like all lines to be equally spread apart.
- Is there a more elegant way to horizontally join two coffins with adjacent text ? Here I'm joining
bolandparawith an explicit.5exspacing and this feels wrong (even though it looks OK).
.
\documentclass{minimal}
\setlength{\parindent}{0pt}
\usepackage{xcoffins}
\begin{document}
\NewCoffin\cont% full-width container
\NewCoffin\para% multiline paragraph
\NewCoffin\bol % beginning of line
\NewCoffin\eol % end of line
\SetVerticalCoffin\cont{\linewidth}{~}
\SetHorizontalCoffin\bol{In-coffin beginning of line.}
\SetVerticalCoffin\para{15 em}{Dummy text but long enough to span several lines at the specified width\dotfill}
\JoinCoffins \bol[B,r] \para[T,l](.5ex, 0pt)
\JoinCoffins \cont[B,l] \bol
\SetVerticalCoffin \eol {\CoffinWidth\cont - \CoffinWidth\bol}{\dotfill\rule{1ex}{1ex}}
\JoinCoffins \cont[\para-B,\para-r] \eol
A long chunk of text to show how the thing flows with surrounding lines.
A long chunk of text to show how the thing flows with surrounding lines.
A long chunk of text to show how the thing flows with surrounding lines.
A long chunk of text to show how the thing flows with surrounding lines.
\TypesetCoffin\cont
A long chunk of text to show how the thing flows with surrounding lines.
A long chunk of text to show how the thing flows with surrounding lines.
A long chunk of text to show how the thing flows with surrounding lines.
A long chunk of text to show how the thing flows with surrounding lines.
\end{document}



minimalfor examples. It isn't suitable. – cfr May 27 '16 at 23:55Bisn't supposed to exist for horizontal coffins - only vertical ones. – cfr May 28 '16 at 00:24minimalis unsuitable for minimal examples ? (real question btw). I'm usingmemoirin real life, and wanted to reduce potential interference. Wouldarticlehave been more "suitable" here ? thanks – Gyom May 30 '16 at 07:55articlewould be perfect here. For graphics (e.g. TikZ pictures)standaloneis a popular option, but for other things,articlewould be recommended. (Unless the issue specifically concerns Memoir or something, obviously, as then you'd need that class.) – cfr May 30 '16 at 12:55