Using the memoir package, I would like to have a vertical line on my margin like this:

Some leading content

      ... vertical space ...

 XYZ  | Content A
      | Content B
      | Content C
      | ...
      | Content N

   *** page break ***

      | Content A1
      | Content B1
      | Content C2
      | ...


I would like the content XYZ to be in a margin note or paragraph (marginpar, and the vertical line to follow the margin of the page, with the content A being in a page the width of that area.

The content will span multiple pages, and be somewhat complex - with e.g. multiple tables that may themselves span pages, and justified content. In essence, the body of the document will be Content * - so I would like to have that be the body of the page.

So on my TODO list I have the following:

  1. Set the margin of the page to be larger (\oddsidemargin);
  2. Add lead-in content that is set at the standard margin position;
  3. Add a vertical line along the page margin that spans multiple pages;
  4. Add margin paragraphs (for "XYZ").

I had in fact figured this out before, but have since forgotten and lost how I worked it out, so am posting in part to preserve the solution but also because I'm sure just about everybody reading this will know better than I how to achieve the objective. I will post my own solution once I re-discover it.

Though I will post my answer with more details, here are my initial thoughts:

  1. Using longtable or equivalent to solve 1, 2, 3 and 4 had crossed my mind, instead of mucking around with page dimensions and such, but as mentioned the "Content *" will include tables and such. It can be worked around I am sure, but it struck me as less elegant than setting the page dimensions accordingly.

  2. Otherwise problems 2, 3 and 4 seem to be mostly an implementation issue with memoir, notwithstanding the vertical line - I cannot recall if that

  3. If the other can be achieved, I am tempted to use the textpos package to solve problem 2.

  4. Vertical rules using the e.g. 'background' package to solve problem 3.

  • The side margin paragraphs will be unique? I mean, there will be just one for each use of the construct, or will there be possibly many margin paragraphs in one construct? The horizontal rule will always be in the same position? – Gonzalo Medina May 16 '13 at 21:53
  • @GonzaloMedina: Thanks for the comment. The side margins will be simple text (maybe italicized, bold, ...), so nothing really special; the horizontal rule will basically always be in the same position and relative to the height of the preamble. – Brian M. Hunt May 16 '13 at 22:43

What if you abused the geometry package?

\documentclass[oneside, 12pt]{memoir}

\makeatletter % <-- all from geometry.sty, but with some lines commented out

  \hskip \textwidth\Gm@vrule
  \hskip \marginparsep
  \hskip \marginparwidth
 \hskip \marginparsep
 %  \llap{\Gm@vrule}
% \rlap{\Gm@vrule}
    \vb@xt@\z@{\vskip-1\Gm@truedimen in\vskip\Gm@layoutvoffset%
     \hb@xt@\z@{\hskip-1\Gm@truedimen in\hskip\Gm@layouthoffset%
     \advance\@tempdima by \marginparsep
     \advance\@tempdima by \marginparwidth
     % \vb@xt@\z@{\vss\Gm@hrule}%
     % \vskip\footskip\vb@xt@\z@{\vss\Gm@hruled}%



a \marginpar{test}\lipsum

b \marginpar{test}


To make for a tidier .tex file, you could wrap this in a personal package of your own, prefaced with \RequirePackage[showframe]{geometry} and then just load it on its own: \usepackage{<filename>}


Here is what I have done, with a preamble as follows:




% textpos settings

% page dimensions

% sidebars

To create the full-page vertical bar on every page I use everypage:

% everypage - add vertical line
    % height is 29.21 (stock height - 11.5in) - 2cm - pad (2cm) = 25cm 

In the document I have on the first page:

   This appears in a static position.

% horizontal line
% ~ width of stock 21.6cm (8.5in) minus 3cm for margins

% vertical line (part of page; leaving room for header}
% ~ height is 29.21 (stock height - 11.5in) - 6cm - pad (2cm) = 21cm 

\sidebar{Some sidebar text}

... Content A-Z

Of course, I will mark as correct an answer that substantially improves on this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.