![在每一章的每页上写一个脚注标题](https://linux22.com/image/315161/%E5%9C%A8%E6%AF%8F%E4%B8%80%E7%AB%A0%E7%9A%84%E6%AF%8F%E9%A1%B5%E4%B8%8A%E5%86%99%E4%B8%80%E4%B8%AA%E8%84%9A%E6%B3%A8%E6%A0%87%E9%A2%98.png)
我必须在第 1 章的所有页面上写相同的脚注。我采用了这种方法,但这在所有有脚注的页面上都有效:
\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}
有没有办法将“脚注标题”限制在一章中?
答案1
将设置恢复为原始设置。在下面的代码中,您可能希望设置\skipfootins
为 6ex 而不是 4ex。请自行尝试。
\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}
如果您想在有标题和无标题的脚注之间来回切换,您可以为其定义一个新命令。
\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}
答案2
你为什么不这样做
\renewcommand{\fixedfootnotetext{}}
当你不再需要它时,或者将其重新定义为其他东西?