对 \thanks 脚注使用与 footmisc 创建的格式相同的格式

对 \thanks 脚注使用与 footmisc 创建的格式相同的格式

我使用footmisc包。下面,我将脚注标记刷新到左边距,并包括\doublespacing\raggedright。但这些对命令创建的脚注没有影响\thanks。下面,您可以看到它没有刷新到边距,没有双倍行距,也没有右边参差不齐。我如何才能强制脚注的格式\thanks与 修改的常规脚注相同\footmisc

请注意,下面我包含了来自这个答案\thanks这会删除标题后创建的星号。

\documentclass{article}
\raggedright
\usepackage{setspace}
    \doublespacing
\usepackage[flushmargin, hang]{footmisc} % flush footnote mark to left margin
    \renewcommand{\footnotelayout}{\doublespacing\raggedright}
\usepackage{etoolbox}
    \makeatletter
        \patchcmd{\maketitle}
            {\def\@makefnmark}
            {\def\@makefnmark{}\def\useless@macro}
            {}{}
    \makeatother
\begin{document}
\title{My title\thanks{Doubtful two bed way pleasure confined followed. Shew up ye away no eyes life or were this. Perfectly did suspicion daughters but his intention. Started on society an brought it explain. Position two saw greatest stronger old. Pianoforte if at simplicity do estimating.}}
\maketitle
A sentence.\footnote{Doubtful two bed way pleasure confined followed. Shew up ye away no eyes life or were this. Perfectly did suspicion daughters but his intention. Started on society an brought it explain. Position two saw greatest stronger old. Pianoforte if at simplicity do estimating.} Another sentence.\footnote{Doubtful two bed way pleasure confined followed. Shew up ye away no eyes life or were this. Perfectly did suspicion daughters but his intention. Started on society an brought it explain. Position two saw greatest stronger old. Pianoforte if at simplicity do estimating.}
\end{document}

在此处输入图片描述

似乎有一个手动黑客程序来强制左边距齐平使用 footmisc 标注文档作者的脚注但是我想知道是否存在更有原则的方法来实现它(例如,1.8em在那个 hack 中大小从何而来?),以及一种也适用于间距和对齐的方法。

答案1

请不要再问了。;-)但请注意,\strut连续\footnotelayout的脚注间距会很糟糕。

\documentclass{article}

\usepackage{setspace}
\usepackage[flushmargin, hang]{footmisc} % flush footnote mark to left margin
\usepackage{regexpatch}
\makeatletter
% 1. remove all redefinitions about footnotes done by \maketitle
%    and add \titletrue
\regexpatchcmd{\maketitle}
 {\c{def}\c{@makefnmark}.*\c{if@twocolumn}}
 {\c{titletrue}\c{if@twocolumn}}
 {}{}
% 2. define a conditional
\newif\iftitle
% 3. redefine \@makefnmark to print nothing when \titletrue
\xpretocmd{\@makefnmark}{\iftitle\else}{}{}
\xapptocmd{\@makefnmark}{\fi}{}{}
% 4. ensure \@makefntext has \titlefalse
%    that's justified by the fact that \@makefnmark
%    in \@makefntext is set in a box
\xpretocmd{\@makefntext}{\titlefalse}{}{}

\makeatother

\renewcommand{\footnotelayout}{\doublespacing\raggedright\strut}
\doublespacing


\textheight=12cm % just to have a smaller picture

\begin{document}

\makeatletter
\makeatother

\title{My title\thanks{Doubtful two bed way pleasure confined followed. Shew up ye away no 
eyes life or were this. Perfectly did suspicion daughters but his intention. Started on 
society an brought it explain. Position two saw greatest stronger old. Pianoforte if at 
simplicity do estimating.}}

\author{Sverre}

\maketitle

A sentence.\footnote{Doubtful two bed way pleasure confined followed. Shew up ye away no eyes 
life or were this. Perfectly did suspicion daughters but his intention. Started on society an 
brought it explain. Position two saw greatest stronger old. Pianoforte if at simplicity do 
estimating.} Another sentence.\footnote{Doubtful two bed way pleasure confined followed. Shew 
up ye away no eyes life or were this. Perfectly did suspicion daughters but his intention. 
Started on society an brought it explain. Position two saw greatest stronger old. Pianoforte 
if at simplicity do estimating.}

\end{document}

在此处输入图片描述

如果你不能使用regexpatch,你可以做

\usepackage{xpatch}
\makeatletter
% 1. remove all redefinitions about footnotes done by \maketitle
%    and add \titletrue
\renewcommand\maketitle{\par
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \titletrue
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{plain}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
% 2. define a conditional
\newif\iftitle
% 3. redefine \@makefnmark to print nothing when \titletrue
\xpretocmd{\@makefnmark}{\iftitle\else}{}{}
\xapptocmd{\@makefnmark}{\fi}{}{}
% 4. ensure \@makefntext has \titlefalse
%    that's justified by the fact that \@makefnmark
%    in \@makefntext is set in a box
\xpretocmd{\@makefntext}{\titlefalse}{}{}

\makeatother

相关内容