2

I have to write the same footnote in all pages of chapter 1. I have adopted this method but this work in all pages that has a footnote:

\documentclass{article}

\usepackage[paperwidth=21cm,paperheight=8cm]{geometry}
\usepackage{lipsum}

\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@
}
}
\setlength{\skip\footins}{4ex}
\makeatother

\newcommand\fixedfootnotetext{Footnote space title that should go in each page}


\begin{document}

a\footnote{First footnote} \lipsum[1-3]

c\footnote{Second footnote} \lipsum[2]

\end{document}

is there a way to limit the "footnote title" only in one chapter?

Doc
  • 173

2 Answers2

1

Why don't you just do

\renewcommand{\fixedfootnotetext{}}

when you don't need anymore, or redefine it as something else?

  • YEAH this work! but I had to insert another command:

    \providecommand\fixedfootnotetext{} \renewcommand\fixedfootnotetext{}

    or I get an error

    – Doc Jul 13 '15 at 15:16
  • You can only use \renewcommand to redefine a command that has already been defined; \providecommand is similar but works either with a new or existing command. So you may use       \providecommand{\fixedfootnotetext{}} in the preamble to make sure the \fixedfootnotetext command exists and then later use \renewcommand – lichinho Jul 14 '15 at 16:25
  • I am so dumb... – Vincent Krebs Apr 01 '22 at 17:32
1

Revert the setting to the original one. In the code below you may want to set \skipfootins to 6ex instead of 4ex. Experiment on your own.

\documentclass{book}

\usepackage[paperwidth=21cm,paperheight=12cm]{geometry}
\usepackage{lipsum}

\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{Footnote space title that should go in each page}


\begin{document}

\mainmatter

\chapter{Title}

a\footnote{First footnote} \lipsum[1-3]

c\footnote{Second footnote} \lipsum[2]

\revertfootnotes

\chapter{Another}

a\footnote{First footnote} \lipsum[1-3]

c\footnote{Second footnote} \lipsum[2]

\end{document}

enter image description here

If you want to switch back and forth between titled and untitled footnotes, you can define a new command for it.

\documentclass{book}

\usepackage[paperwidth=21cm,paperheight=12cm]{geometry}
\usepackage{lipsum}

\usepackage{etoolbox} % this is necessary

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

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

\newcommand\fixedfootnotetext{Footnote space title that should go in each page}


\begin{document}

\mainmatter

\chapter{Title}

a\footnote{First footnote} \lipsum[1-3]

c\footnote{Second footnote} \lipsum[2]

\revertfootnotes

\chapter{Another}

a\footnote{First footnote} \lipsum[1-3]

c\footnote{Second footnote} \lipsum[2]

\titledfootnotes

\chapter{Again}

a\footnote{First footnote} \lipsum[1-3]

c\footnote{Second footnote} \lipsum[2]

\end{document}
egreg
  • 1,121,712
  • how can I enable and disable the "footnote title" on my own? I have tried to renew again the footnoterule command after the revertfootnotes command (obviously in the text not in the preamble) but it didn't work :( – Doc Mar 15 '16 at 10:25
  • 1
    @Doc Here it is. ;-) – egreg Mar 15 '16 at 12:50
  • YEAH thanks! It's exactly what I needed! (be prepared...a new question is coming ;) ) XD – Doc Mar 15 '16 at 13:25