2

Is there a way to put marginal notes at the bottom of the page?

I'm using the medieval page setting in a memoir class document so I can have extensive marginal notes on a page. This works nicely for sidenotes, but it generates a lot of white-space at the bottom of the page that I would like to fill with glosses---as was often done in medieval manuscripts. Footnotes don't work, as they are not placed in the margin, but at the bottom of the text space.

That is, I'm looking for an analog of \sidepar, say, \bottompar, that, instead of putting the comment to the side, puts it in the bottom margin. (Ideally with a sign linking it to the text.)

Here's a minimal not-quite-working example:

\documentclass{memoir}
\usepackage{lipsum} 
\medievalpage
\checkandfixthelayout
\sideparmargin{outer}

\begin{document}
\sidepar{\footnotesize\lipsum[8]}\lipsum[1]\bottompar{
\lipsum[6-7]
}

\lipsum[2-5]
\end{document}

Which should produce this:

Marginalia in bottom margin

Not this, as with \footnote:

Footnote

4
  • If the space is constant, you could use flowfram to put a dynamic frame at the bottom of each page. Commented Jan 16, 2025 at 21:37
  • I use flowfram to make a single comment look good. And I could automate it so a single command puts a flowfram with given text at the bottom of the current page. But I want to comment on multiple bits of text throughout a document (I guess I didn't specify that), and I don't see how to make it so I can have multiple comments that end up being on the same page. So I'd have to compile the document, and then manually check that frams work as desired. It would also be nice (though not necessary) if it could measure the text height on the current page. (I'm already using strictpagecheck.) Commented Jan 16, 2025 at 22:38
  • Sorry, I can use flowfram, not ``I use flowfram''. Commented Jan 16, 2025 at 22:50
  • I wouldn't recommend flowfram with memoir. are you OK with checking things fit manually? (you would get a warning in the log, but the bottom-note wouldn't move to another page.) if so, you could just add them into the shipout hook. unlike margin notes, you don't even need to remember a position - you've got a fixed point on the page. Commented Jan 17, 2025 at 2:38

1 Answer 1

3

Syntax:

\bottompar[<symbol>]{<content>}

where

  • <symbol> is an optional marker. If unspecified, a letter is used i.e. a for the first, then b etc.
  • <content> is contents to be appended to the bottom note for this page.

If used multiple times on a single page, the content is accumulated and the notes are set as a single paragraph at the bottom. Paragraph breaks may be added, but are not created.

Aside from the symbol or letter, \bottompar adds a small amount of space between each separate addition to its content.

At the end of the page, the accumulation of material is typeset and the settings are cleared, except that the counter used to keep track of which letter to use as a marker is not reset.

\documentclass{memoir}
\usepackage{lipsum}
\medievalpage
\checkandfixthelayout
\sideparmargin{outer}
% ateb: https://tex.stackexchange.com/a/735227/
% addaswyd o gwestiwn Matt Petersen: https://tex.stackexchange.com/q/735217/
\ExplSyntaxOn
\coffin_new:N \g__bottompar_note_coffin
\tl_new:N \g__bottompar_content_tl
\cs_new_protected:Npn \__bottompar_make:
{
  \tl_if_empty:NF \g__botttompar_content_tl
  {
    % change the width of the bottompars on the next line
    \vcoffin_gset:NnV \g__bottompar_note_coffin { 0.5\foremargin + \linewidth } \g__bottompar_content_tl
    \tl_gclear:N \g__bottompar_content_tl
  }
}
\cs_generate_variant:Nn \vcoffin_gset:Nnn { NnV }
\cs_new:Npn \__bottompar_do:
{
  \coffin_typeset:Nnnnn \g__bottompar_note_coffin { t } { l } { 0pt } { 0pt }
  \coffin_gclear:N \g__bottompar_note_coffin
}
\cs_new_eq:NN \makebottompar \__bottompar_make:
\cs_new_eq:NN \dobottompar \__bottompar_do:
\hook_gput_code:nnn { begindocument } {bottompar}
{
  \hook_gput_code:nnn {shipout/foreground} {bottompar}
  {
    % typeset the bottompar into a coffin and clear the token list
    \makebottompar
    % the next line determines where the top left corner of the bottom par is placed
    % this is half the foremargin to the right of the far left of the page (horizontal)
    % and the total of the upper margin, text height, header height and header sep from the top
    \put (\dimexpr 0.5\foremargin, \dimexpr -\uppermargin-\textheight-\headheight-\headsep) {
      %  typeset and clear the coffin
      \dobottompar
    }
  }
}
\int_new:N \g__bottompar_no_int
\NewDocumentCommand \bottompar { o +m }
{
  \tl_if_empty:NT \g__bottompar_content_tl
  {
    \tl_gset:Nn \g__bottompar_content_tl { \hskip -0.5em }
  }
  % create marker and append to token list
  \IfValueTF { #1 } {
    \tl_gput_right:Nn \g__bottompar_content_tl { \hskip 0.5em \textsuperscript{ #1 } }
    \textsuperscript { #1 }
  } {
    \int_gincr:N \g__bottompar_no_int
    \textsuperscript { \int_to_alph:n { \g__bottompar_no_int } }
    \tl_gput_right:Ne \g__bottompar_content_tl {
      \hskip 0.5em \noexpand\textsuperscript { \int_to_alph:n { \g__bottompar_no_int } }
    }
  }
  % append the content of the bottom par to the token list
  \tl_gput_right:Nn \g__bottompar_content_tl { #2 }
}
\ExplSyntaxOff
\begin{document}
\sidepar{\footnotesize\lipsum[8]}\lipsum[1]\bottompar{% did you really want a space here?
  \lipsum[6-7]% or here?
}

\lipsum[2-5]

A paragraph with a footnote\footnote{A regular, common-or-garden footnote of the ordinary kind. \lipsum[10]}

\lipsum[8-9]

\sidepar{\footnotesize\lipsum[8]}\lipsum[1]\bottompar{%
  \lipsum[11]%
}

Something else\bottompar{Another bottom one.}
Furthermore\bottompar[\textdagger]{A bottom note with a custom symbol.}
However\bottompar{Perhaps letters are best.}
\end{document}

bottom pars on an odd and even page

I couldn't remember exactly what the various dimensions specify in terms of the layout and I wasn't able to determine this immediately from the manual, so I just guessed and did it by trial-and-error. So positioning may need fine-tuning. Also, I wasn't sure how wide the note should be, so you may need to modify that according to your desiderata.

6
  • 2
    Really this is awesome, it is much helpful if you add the screenshot for the output too Commented Jan 17, 2025 at 4:28
  • @MadyYuvi see above. Commented Jan 17, 2025 at 16:12
  • This is amazing. Thanks! Commented Jan 17, 2025 at 17:30
  • And yes, you're right, I did not want those spaces. Commented Jan 17, 2025 at 17:40
  • @MattPetersen you do need to make sure stuff fits as it can't flow to somewhere else. but that's true for marginal notes/pars, too. Commented Jan 17, 2025 at 18:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.