有一个脚注没有标记和编号,其余正常

有一个脚注没有标记和编号,其余正常

我正在课堂上写一份报告book(使用 LuaLaTeX 编译),我需要在执行摘要 (exec. sum.) 页面上显示页数。我不希望执行摘要页面上的脚注被编号/可见,并且脚注文本前没有缩进(我需要添加的句子刚好占 2 行)。我拼凑了前段时间从其他问题中得到的两段代码,即 PLG 对如何删除脚注中的缩进?经过修改后,如下所示:

\makeatletter
\renewcommand\@makefntext[1]{%
    \setlength\parindent{1em}%
    \noindent
    %\mbox{\@thefnmark.~}{#1}} % Commenting removes the number from the footnote
    \mbox{}{#1}
}
\makeatother

以及 Steven B. Segletes 的回答未编号的脚注经过修改后,如下所示:

\let\svthefootnote\thefootnote
\let\thefootnote\relax
\footnote{The total page count for this report is X~pages out of a maximum 35 pages.}
\addtocounter{footnote}{-1}
\let\thefootnote\svthefootnote

我在我的文档中将两者合并,并尝试创建一个可以放在序言中的命令(而不是字面上我需要一个没有缩进和文本内数字的脚注),但它产生了这样的结果:

在此处输入图片描述

我创建的命令不好,无法工作(我甚至不确定在命令中放入\makeatletter\begingroups等是否需要/可行)。我不确定如何限制重新定义的全局范围\@makefntext(或​​者在哪里通过取消注释 % 行来恢复它):

\newcommand\blankFootnote[1]{%
\begingroup
\makeatletter                         % https://tex.stackexchange.com/a/587493/245306
\renewcommand\@makefntext[1]{%
    \setlength\parindent{1em}%
    \noindent
    %\mbox{\@thefnmark.~}{#1}} % Commenting removes the number from the footnote
    \mbox{}{#1}
}
\makeatother
\let\svthefootnote\thefootnote
\let\thefootnote\relax
\footnote{#1}
\addtocounter{footnote}{-1}
\let\thefootnote\svthefootnote
\endgroup
}

我如何创建一个序言命令,使我可以在我的执行总和页面中放置一个没有缩进和编号的脚注,并book为文档的其余部分恢复正常的脚注?

目前 MWE 的情况如下(第 1 章中的常规脚注):

第1章脚注

它在执行摘要页面上的当前显示方式(空白脚注):

在此处输入图片描述

梅威瑟:

\documentclass[oneside]{book}

%\newcommand\blankFootnote[1]{%
%\begingroup
%\makeatletter                         % https://tex.stackexchange.com/a/587493/245306
%\renewcommand\@makefntext[1]{%
%    \setlength\parindent{1em}%
%    \noindent
%    %\mbox{\@thefnmark.~}{#1}} % Commenting removes the number from the footnote
%    \mbox{}{#1}
%}
%\makeatother
%\let\svthefootnote\thefootnote
%\let\thefootnote\relax
%\footnote{#1}
%\addtocounter{footnote}{-1}
%\let\thefootnote\svthefootnote
%\endgroup
%}

\begin{document}

\chapter*{Executive Summary}
Lorem ipsum dolor sit amet, consectetur adipiscing 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 adipiscing 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.%
\begingroup
\makeatletter                         % https://tex.stackexchange.com/a/587493/245306
\renewcommand\@makefntext[1]{%
    \setlength\parindent{1em}%
    \noindent
    %\mbox{\@thefnmark.~}{#1}} % Commenting removes the number from the footnote
    \mbox{}{#1}
}
\makeatother
\let\svthefootnote\thefootnote
\let\thefootnote\relax
\footnote{The total page count for this report is X~pages out of a maximum 35 pages.}
\addtocounter{footnote}{-1}
\let\thefootnote\svthefootnote
\endgroup

\mainmatter
\chapter{First}
Lorem ipsum dolor sit amet, consectetur adipiscing 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 adipiscing elit}

\end{document}

答案1

为了使您的命令起作用,请使用:

\makeatletter    
\newcommand\blankFootnote[1]{%
\let\old@makefntext\@makefntext
\renewcommand\@makefntext[1]{  \noindent \mbox{}{#1}}
\let\svthefootnote\thefootnote
\let\thefootnote\relax
\footnote{#1}
\addtocounter{footnote}{-1}
\let\thefootnote\svthefootnote
\let\@makefntext\old@makefntext
\makeatother
}

这是一种不同的方法。该\rawfootnote{<text>}命令将使用 tikz 节点将“文本”(示例中为两行)添加到当前页面的底部,并模仿该\footline命令绘制顶线(所需空间必须为空)。

A

\documentclass[oneside]{book}

\usepackage{showframe}% only to show the margins

%*******************************  added <<<<<<<<<<<<<<
\usepackage{tikzpagenodes}
\newcommand{\rawfootnote}[1]{%
\begin{tikzpicture}[remember picture,overlay] 
    \node(F) [text width=\linewidth,align=left, anchor=south west, inner sep=0, font=\footnotesize] at (current page text area.south west) {#1};
    \draw([yshift=0.4\baselineskip]F.north west)--+(0.4\linewidth,0pt); 
    \end{tikzpicture}
}
%*******************************

\begin{document}
    
    \chapter*{Executive Summary}
    Lorem ipsum dolor sit amet, consectetur adipiscing 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 adipiscing 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.%

    \rawfootnote{The total page count for this report is X~pages out of a maximum 35 pages. The total page count for this report is X~pages out of a maximum 35 pages.}


    \mainmatter
    \chapter{First}
    Lorem ipsum dolor sit amet, consectetur adipiscing 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 adipiscing elit}
    
\end{document}

相关内容