0

Is there a way to force footnotes to stay on the page they belong?

I have a document with only enumerate environment and each item of the enumerate has a footnote. Sometimes this footnote goes in the next page but I want to keep the footnote on the same page and, if needed, send another item on the next page.

Is it possible?

PROBLEM (the older code didn't work):

\documentclass{article}
\usepackage[italian]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{verbatim}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[bottom]{footmisc}
\usepackage[T1]{fontenc}
\usepackage{enumitem,xparse}

%%COUNT EVERY THREE ITEM
\ExplSyntaxOn
\DeclareExpandableDocumentCommand{\counterbythree}{m}
 {
  \doc_counter_by_three:c { c@#1 }
 }
\cs_new:Nn \doc_counter_by_three:N
 {
  \int_div_truncate:nn { #1 + 2 } { 3 }
 }
\cs_generate_variant:Nn \doc_counter_by_three:N { c }
\AddEnumerateCounter{\counterbythree}{\doc_counter_by_three:c}{0}
\ExplSyntaxOff

\newenvironment{enumerateeachthree}[1][]
 {\enumerate[label=\counterbythree*.]}
 {\endenumerate}
%%END COUNT EVERY THREE ITEM


%%FIXED FOOTNOTE HEADER
\let\svthefootnote\thefootnote

\newcommand\blankfootnote[1]{%
    \let\thefootnote\relax\footnotetext{#1}%
    \let\thefootnote\svthefootnote%
}
\let\svfootnote\footnote
\renewcommand\footnote[2][?]{%
    \if\relax#1\relax%
        \blankfootnote{#2}%
    \else%
        \if?#1\svfootnote{#2}\else\svfootnote[#1]{#2}\fi%
    \fi
}

\usepackage{etoolbox} % this is necessary

\makeatletter
% keep the original \footnoterule for minipage
\let\latex@footnoterule\footnoterule
\patchcmd{\endminipage}{\footnoterule}{\latex@footnoterule}{}{}
% redefine \footnoterule
\renewcommand{\footnoterule}{%
    \vtop to 0pt{
    \vss
    \hrule \@width .4\columnwidth
    \vskip 3\p@
    \hbox{\footnotesize\itshape\fixedfootnotetext}
    \vskip 3\p@
    \hrule \@height \z@
}
}
\newlength{\savedskipfootins}
\setlength{\savedskipfootins}{\skip\footins}
\setlength{\skip\footins}{4ex}

\newcommand{\revertfootnotes}{%
    \clearpage % just to be sure
    \let\footnoterule\latex@footnoterule
    \setlength{\skip\footins}{\savedskipfootins}%
}
\makeatother

\newcommand\fixedfootnotetext{
    \begin{minipage}[t]{0.45\linewidth}%
        \fbox{%
            \begin{minipage}[t]{\linewidth}%
                \begin{center}
                    Prima minuta 1821-1823
                \end{center}
            \end{minipage}
        }
    \end{minipage}\hfill\hspace{4.3em}
    \begin{minipage}[t]{0.45\linewidth}%
        \fbox{%
            \begin{minipage}[t]{\linewidth}%
                \begin{center}
                    Seconda minuta 1823-1827
                \end{center}
            \end{minipage}
        }
    \end{minipage}
    \vspace*{0.02cm}
}
%%END FIXED FOOTNOTE HEADER

\usepackage[hypertexnames=false]{hyperref}


\begin{document}


    \begin{enumerateeachthree}

        \item \begin{minipage}[t]{\linewidth}\textit{Perchè al primo avviso s'era egli mosso così sollecitamente, come ad una chiamata del padre provinciale? [\ldots]} (IV.5)\\

        \- Similitudine monotematica con modalizzatore ``Come''\\

        \- Avviso $\sim$ d. Lucia $\rightarrow$ Chiamata $\sim$ d. Padre Provinciale\\
        \end{minipage}
        \footnote[]{\hspace{-2em}
            \begin{minipage}[t]{0.45\linewidth}%
                \item Invariata (IV.9)
            \end{minipage}\hfill
            \begin{minipage}[t]{0.45\linewidth}%
                \item Invariata (IV.5)
            \end{minipage}
        }

        \item \begin{minipage}[t]{\linewidth}\textit{Il suo capo raso, salvo la picciola \textbf{striscia} di capegli che lo cingeva al mezzo come una \textbf{corona} [\ldots]} (IV.6)\\

        \- Similitudine monotematica con modalizzatore ``Come''\\

        \- Striscia $\sim$ d. Capegli $\rightarrow$ Corona\\
        \end{minipage}
        \footnote[]{\hspace{-2em}
            \begin{minipage}[t]{0.45\linewidth}%
                \item \textit{Il suo capo calvo e coperto all'intorno secondo il rito cappuccinesco di una \textbf{corona} di capelli che l'età aveva renduti bianchi [\ldots]} (IV.12)

                \-Varianti:\\
                \begin{itemize}
                    \item Metafora\\
                    \item Capo $\sim$ Calvo (Ed.1827- ``Raso'')
                    \item Corona $\sim$ d. Capelli $\Rightarrow$ Chierica
                \end{itemize}
            \end{minipage}\hfill
            \begin{minipage}[t]{0.45\linewidth}%
                \item Invariata (IV.6)
            \end{minipage}
        }

        \item \begin{minipage}[t]{\linewidth}\textit{Due \textbf{occhi} incavati erano per lo più chinati a terra, ma talvolta sfolgorati con vivacità repentina, come due \textbf{cavalli} bizzarri, condotti a mano da un \textbf{cocchiere} [\ldots] pure danno di tratto in tratto qualche scambietto, che scontano tosto con una buona strappata di morso.} (IV.7)\\

        \- Similitudine bitematica con modalizzatore ``Come''\\

        \- Occhi $\sim$ Incavati $\rightarrow$ Cavalli $\sim$ Bizzarri\\

        \- Cocchiere $\leftarrow$ Fra Cristofaro\\
        \end{minipage}
        \footnote[]{\hspace{-2em}
            \begin{minipage}[t]{0.45\linewidth}%
                \item \textit{[\ldots] Due \textbf{occhj} vivi, pronti, che talvolta sfolgoravano con vivacità repentina, come due \textbf{cavalli} bizzarri condotti a mano da un cocchiere [\ldots] pure fanno di tratto in tratto qualche salto, col quale non guadagnano altro che una buona stirata di briglie} (IV.13)\\

                \- Varianti:\\
                \begin{itemize}
                    \item Occhj Vivi/Pronti (Ed.1827- ``Incavati'')
                    \item Verbo ``Sfolgorare'' alla 3\ap{a} Pers. Plu. Imp. Ind. (Ed. 1827- al Part. Pass.)
                    \item Verbo  ``Fare'' (Ed.1827-  ``Dare'')
                    \item Salto (Ed.1827-  ``Scambietto'')
                    \item Stirata $\sim$ d. Briglie (Ed.1827- Strappata $\sim$ d. Morso)
                \end{itemize}
            \end{minipage}\hfill
            \begin{minipage}[t]{0.45\linewidth}%
                \item Invariata (IV.7)
            \end{minipage}
        }

    \end{enumerateeachthree}
\end{document}

Ok, if you compile this, you should see the problem ;)

  • 2
    Please show as the minimal code which results in this effect. We can not guess what you have. Thank you. – LaRiFaRi Aug 7 '15 at 9:29
  • 1
    Isn't is the default that footnotes stay on the page? – user31729 Aug 7 '15 at 9:34
  • 1
    @ChristianHupfer, yes, it is. However, if there is not enough place to fit all footnote in the place, they can be split between two pages. It seems, that this is problem of OP, but I only guess. – Zarko Aug 7 '15 at 9:37
  • @Zarko: Thanks, of course, I thought of one or two small footnotes. I am a Physicist -- we don't use more than one or two footnotes per page (if at all) – user31729 Aug 7 '15 at 9:39
  • Your example doesn't compile \fixedfootnotetext is not defined. – Ulrike Fischer Aug 7 '15 at 10:02
2

Use minipage for footnote

\documentclass{article}

\newcommand{\mtitem}[2]{%
\item \begin{minipage}[t]{\linewidth}
#1\footnotemark
\end{minipage}%
\footnotetext{%
\begin{minipage}[t]{\linewidth}
#2\strut
\end{minipage}}}

\newcommand{\mylipsum}{Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
adipiscing vitae, felis.}

\begin{document}

\begin{enumerate}
\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}

\mtitem{Long text 2 \mylipsum}%
{Long Footnote Text 2 \mylipsum}
\end{enumerate}
\end{document}
  • the cost of your interesting solution is that \footnotemark appear in separate line of enumeration paragraphs. And footnote text is over right margin ... you need to reduce footnote minipage width accordingly. – Zarko Aug 7 '15 at 16:40
  • @Zarko thank you. 1) \footnotemark because in the body the footnote is outside the minipage I don't do anything here (first code of the OP) 2) footnotetext, you're right. As you know one can fix this two but I am not sure I understande what the OP need. – touhami Aug 7 '15 at 16:59
  • I added a working example of my problem. I don't want to separate a footnote in two pages. I need the footnote remains in the page that belongs. If you compile my example you can see the item number three in the first page and the footnote of the item number three in the second page – Doc Aug 7 '15 at 17:05
  • @Doc Did you try my answer? and why items are formated in minipages? – touhami Aug 7 '15 at 17:21
  • @touhami, the width of footnotes is easy to fix. T MWE add package calc and in deffintion of footnote replace \linewidth with \labewith-\labelwidth. A new MWE, also not work. If OP will allow to split the item paragraph text than the result be more nice and with far less complex code. – Zarko Aug 7 '15 at 17:33

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.