I'm redefining \footnote
to put them in them in the margin using \marginpar
. Occasionally, the paragraph will extend below the bottom of the text block when a note appears near the end of a page. I would assume that I could just use \vspace
to move it up, but for some reason this leaves the first line of the note unchanged and pulls up the remaining lines. This seems to be related to using \the
to insert the value of the footnote counter; if I leave out \themynote
then \vspace
works as expected.
More specifically, in the example below there are four footnotes. In the first paragraph, the two footnotes float to avoid colliding with each other. The third footnote starts on the first line of the second paragraph; \vspace{-\baselineskip}
moves the entire paragraph upwards as expected. The fourth footnote is identical to the third footnote except that the macro includes \themynote
to print the value of the footnote counter. In this case, the first line of the footnote doesn't move.
- Why does this happen?
- What is a better way to adjust the vertical position of a note in this case?
Other possible fixes:
- I'm aware of the marginfix package, but this seems to mess up the baseline of the footnotes (the footnotes will start slightly above the baseline of the main text, when they would normally start exactly on the main text baseline). I'm trying to maintain a vertical grid in the page layout, so that's undesirable.
- The marginnote package doesn't float notes, so the two notes in the first paragraph below would collide.
MWE
\documentclass{article}
\newcounter{mynote}
\renewcommand{\footnote}[1]{%
\marginpar{\footnotesize #1}%
}
\newcommand{\footnoteB}[1]{%
\marginpar{\footnotesize\themynote #1}%
}
\begin{document}
Lorem ipsum dolor sit amet, consectetur\footnote{Lorem ipsum dolor sit amet,
consectetur adipisicing elit.} adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut \footnote{Lorem ipsum dolor
sit amet, consectetur adipisicing elit.}enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur\footnote{\vspace{-\baselineskip}Lorem
ipsum dolor sit amet, consectetur adipisicing elit.} adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.\footnoteB{\vspace{-\baselineskip}Lorem ipsum dolor sit amet,
consectetur adipisicing eli.}
\end{document}
sidenotes
package or thesnotez
package