使用 footmisc 包使 \vfill 工作

使用 footmisc 包使 \vfill 工作

我在将脚注粘贴到页面底部时遇到了一些麻烦,因此我使用了:

\usepackage[hang,bottom]{footmisc}.

这解决了这个问题,但是对于我的文档的一部分,我想在页面底部放置一行,我这样做:

\vfill

通常情况下,这种方法可以正常工作,但页面上有一个脚注,并且 footmisc 的 [bottom] 选项似乎出于某种原因在脚注上方保留了空白,因此 \vfill 不会将该行一直推到底部。我当然可以手动放置它,但这不是我使用 Latex 的原因。任何解决方法都将不胜感激。

以下是 MWE:

\documentclass[a4paper]{article}
\usepackage[hang,bottom]{footmisc}
\begin{document}
This is my text\footnote{this is my footnote}
\vfill
This is my bottom-of-page comment
\end{document}

答案1

bottom选项基本上添加\vfill到每一页的末尾,因此您\vfill让 TeX 将空白空间分成两个相等的块。

使用三阶无限胶合:

\documentclass[a4paper]{article}
\usepackage[hang,bottom]{footmisc}

\begin{document}

This is my text\footnote{this is my footnote}

\vspace{0pt plus 1filll}

This is my bottom-of-page comment

\end{document}

在此处输入图片描述

答案2

基于测量页面上的剩余空间并将其用于另一页,我制定了\fixV宏,应用于页末评论。

\documentclass[a4paper]{article}
\usepackage[hang,bottom]{footmisc}
\newcommand\fixV[1]{\edef\tmp{\the\parindent}\setbox0=\hbox{%
  \begin{minipage}{\textwidth}\hspace{\tmp}\strut#1\strut\end{minipage}}\box0%
  \vspace{\dimexpr-\pagegoal+\pagetotal+\baselineskip}}
\begin{document}
This is my text\footnote{this is my footnote}
\vfill
\fixV{This is my bottom-of-page comment}
\clearpage
This is my text\footnote{this is my footnote}
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
\vfill
\fixV{This is my bottom-of-page comment}\clearpage
This is my text\footnote{this is my footnote}
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
This is my text This is my text This is my text This is my text This is my text 
\vfill
\fixV{This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment
This is my bottom-of-page comment This is my bottom-of-page comment}
\end{document}

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

相关内容