# How can I insert a paragraph or image into the same spot on every page of a memoir doc?

How can I duplicate one feature of this layout from 'House of Leaves' in a 100ish-page book using LaTeX?

(I'm presently using memoir for document formatting/structure.)

The specific feature I want to duplicate is the blue-bordered box. It'll appear on every page of the book, always in the same spot. On the left-hand pages it'll contain an image; on the facing pages, a paragraph of text. The paragraphs won't flow continuously from page to page - i.e. it's not strictly speaking a 'parallel' column. It's just a boxed element in the same spot with different content on every page.

Because it's a longish book and the main text is still somewhat in flux, I'd like to do this programmatically rather than by hand -- to issue, ideally, a single command (or one each for images and text-chunks) that causes LaTeX to populate each page of the document from a list of images and text-chunks.

Is this possible? If so, how do I go about it? If this duplicates another question, I'm sorry -- on my own I couldn't find an answer to my precise question.

-
Please have a look at: tex.stackexchange.com/questions/45709/… – Marco Daniel Mar 6 '12 at 19:34

To a first approximation, the layout you show is not possible in TeX. You could do something similar to the context images shown in the first answer with LaTeX, but the style you show with the cutout at a fixed position in the page is really hard to do in TeX.

TeX's galley model is that text is broken in to lines and placed on an infinite scroll "the galley" and then at certain times an asynchronous page breaker the "output routine" chops off the top of the galley, perhaps decorating it and adding head and foot, and then shipping out the page. An important point to note though is that the line breaking is not reconsidered at this point.

So while it is not too hard to have cutouts tied to a position in the paragraph (picins picinpar wrapfig packages for example) these packages affect line breaking not the page breaker. To achieve the effect you want you really need the page breaker to affect the paragraph shape.

TeX being what it is, nothing is ever impossible, but it's not easy and depends greatly on the details of the text you have. It is likely to take a multi-pass system where you leave marks on one pass after a page break that are picked up next run to adjust the paragraph shape, but this of course affects page breaking......

UPDATE: I was looking for Frank's original "Reconsider Paragraphs" Proposal, but there is some discussion of it in these etex/latex meeting motes http://www.latex-project.org/papers/pdfTeX-meeting-2005-09-24/LinkedDocuments/etex-meeting-notes.pdf

-

Not what you asked for. It's neither LaTeX, nor memoir. Nevertheless, here is a ConTeXt solution:

% Used for the fake text
\usemodule [visual]

% Defines the two main columns
\definecolumnset [maincolumns] [n=2]

% Defines the middle part
\definecolumnsetarea [middlecolumn] [both]
[
y=20,         % y-offset, number of lines
nx=2,         % columns in x direction
ny=8,         % numer of lines
offset=5mm,   % separate the inner content from the text
loffset=2cm,  % left offset
state=repeat, % see text below
]

% Content for the text area
\setupcolumnsetareatext [middlecolumn] [both]
[\flushtextflow{myflow}]

% The text should be broken as needed
\definetextflow [myflow]
[width=10cm]

\starttext
\startcolumnset [maincolumns]

% Text for the inner content
\starttextflow [myflow]
\input knuth
\stoptextflow

% Random text for the main part
\dorecurse{30}{\fakewords{50}{100}}

\stopcolumnset
\stoptext


The first four pages look like this:

I tried to comment the source as much as possible. Still, here comes a short description: It creates a column set of two columns (which is filled with fake text). It furthermore defines a column set area. The state can be set to start or to repeat. The value start typesets this area as long as there is enough text to place, the value repeat typesets the are always. You see this on page four. The column set area is white because there is no text left to display, with start=start, the area would simply not being reserved.

Then, a textflow is created to break the text (onto the next page), when the predefined column set area is full, so that no text exceeds its reserved space.

The code is a slightly altered version of the code found in the columns manual by Hans Hagen.

-