1

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}

  • 1
    You might want to have a look at the sidenotes package or the snotez package – clemens Feb 27 '15 at 7:27
  • Why do you have changed completely your MWE? – karlkoeller Feb 27 '15 at 8:16
4

Use \marginnote instead of \marginpar. \marginnote accepts a vertical offset as optional argument, so you can rewrite your definition of footnote as

\renewcommand{\footnote}[2][0pt]{%
        \refstepcounter{mynote}%
        \mbox{\textsuperscript{\tiny\sffamily\themynote}}%
        \marginnote{\sffamily\makebox[0pt][r]{\tiny\textsuperscript{\themynote}}\footnotesize #2}[#1]%
}

and use it like

\footnote[-\baselineskip]{...}

MWE:

\documentclass{article}

\usepackage{mathpazo}
\usepackage{marginnote}

\newcounter{mynote}

\renewcommand{\footnote}[2][0pt]{%
        \refstepcounter{mynote}%
        \mbox{\textsuperscript{\tiny\sffamily\themynote}}%
        \marginnote{\sffamily\makebox[0pt][r]{\tiny\textsuperscript{\themynote}}\footnotesize #2}[#1]%
}

\begin{document}

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.\footnote{Lorem ipsum dolor sit amet, consectetur adipisicing elit.}

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.\footnote[-\baselineskip]{Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.}

\end{document} 

enter image description here


If you prefer to keep going with \marginpar here is a solution that reproduces the above:

\renewcommand{\footnote}[2][]{%
        \refstepcounter{mynote}%
        \ifx\relax#1\else{\setlength{\baselineskip}{12pt}\vspace*{#1}}\fi%
        \mbox{\textsuperscript{\tiny\sffamily\themynote}}%
        \marginpar{\sffamily\makebox[0pt][r]{\tiny\textsuperscript{\themynote}}\footnotesize #2}%
}

MWE

\documentclass{article}

\usepackage{mathpazo}

\newcounter{mynote}

\renewcommand{\footnote}[2][]{%
        \refstepcounter{mynote}%
        \ifx\relax#1\else{\setlength{\baselineskip}{12pt}\vspace*{#1}}\fi%
        \mbox{\textsuperscript{\tiny\sffamily\themynote}}%
        \marginpar{\sffamily\makebox[0pt][r]{\tiny\textsuperscript{\themynote}}\footnotesize #2}%
}

\begin{document}

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.\footnote{Lorem ipsum dolor sit amet, consectetur adipisicing elit.}

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.\footnote[-\baselineskip]{Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.}

\end{document} 

Output:

enter image description here

  • Thanks for pointing out the marginnote package! Unfortunately, with this solution a bunch of the other footnotes in my document collide with each other. – DGrady Feb 27 '15 at 6:41
  • @DGrady See the edit. I've added the same solution with \marginpar – karlkoeller Feb 27 '15 at 6:52
  • Using \vspace*{0pt} this way alters the baseline of the footnotes; the first footnote is pushed down a bit. Sorry to be picky; I appreciate the suggestions, and am also trying to understand why this happens! I revised my question to incorporate this. – DGrady Feb 27 '15 at 7:28
  • @DGrady I've adjusted it. See the new definition of \footnote – karlkoeller Feb 27 '15 at 7:41
  • @DGrady Still something wrong with my answer? – karlkoeller Mar 1 '15 at 15:28

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.