# Use same formatting for \thanks footnote as the one created by footmisc

I change the layout of my footnotes with the footmisc package. Below, I flush the footnotemark to the left margin, and I include \doublespacing and \raggedright. But these have no effect on the footnote created by the \thanks command. Below, you can see that it is not flushed to the margin, it is not double spaced, and not ragged right. How can I enforce the same formatting for the \thanks footnote as for regular footnotes modified by \footmisc?

Note below that I have included code from this answer which removes the star created by \thanks after the title.

\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}


There's what appears to be a manual hack to enforce the left margin flush in Footnote on document author with footmisc, but I'd wonder if there's a more principled way of doing it (where does, for example, the size 1.8em come from in that hack?), and one that applies to the spacing and justification as well.

• Please add to your question a MWE showing the relevant setttings. – Gonzalo Medina Aug 7 '15 at 17:38
• @GonzaloMedina Yikes! I forgot! (Note my many references to a non-existing code "below") :-P – Sverre Aug 7 '15 at 17:42
• not addressing the question, but you'll want also to increase the spacing between footnotes. right now, that's less than the spacing between lines of a single footnote, and looks confusing. – barbara beeton Aug 7 '15 at 18:17
• @barbarabeeton I agree. I have code that does just that, but I removed it from the MWE above in order to make it more minimal. – Sverre Aug 7 '15 at 18:20
• @barbarabeeton For the record, this is the code I use to change the spacing between footnotes. – Sverre Aug 7 '15 at 18:25

Don't ask more, please. ;-) But note the \strut in \footnotelayout or consecutive footnotes would be badly spaced.

\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
\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}


If you can't use regexpatch, you can do

\usepackage{xpatch}
\makeatletter
% 1. remove all redefinitions about footnotes done by \maketitle
\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

• I thought you liked challenges, egreg! :) What worries me here is that I don't understand what parts of your code make sure that the \thanks footnote has the formatting of other footnotes, and what parts of the code cause the star after the title to be surpressed. It might be very useful (to me and others) to have code that only does the former, since the star-removal thing is quite idiosyncratic to a style sheet I'm following now. Would you mind adding such an example to your answer? – Sverre Aug 8 '15 at 14:56
• Also, my main document won't compile because my .sty file also uses the xpatch package to tweak some biblatex stuff via \xpatchbibmacro and \xpatchbibdriver. I get an error Command '\xpatchcmd' already defined!. Is there a quick and easy fix to this, or should I open a separate question about it? – Sverre Aug 8 '15 at 15:07
• @Sverre regexpatch has all the functionalities of xpatch. – egreg Aug 8 '15 at 17:36
• Right - I expected that, so I tried to just comment out the loading of \xpatch, but compiling that gives me an error msg Undefined control sequence. <argument> \xpatch_main:Ncnnnn \xpatch_patchcmd_once: [...]. Sounds like I should open up a separate question about this. – Sverre Aug 8 '15 at 17:41
• @Sverre I'll add the patch without regexpatch. – egreg Aug 8 '15 at 17:42