2

I have a document with a cover page and foonote. I would like to add a rule above the foonote. What is the way to do this?

\documentclass[english,titlepage]{article}
\begin{document}

\title{ddd}


\author{ccc%
\thanks{bbb%
}}
\maketitle
\begin{abstract}
aaa
\end{abstract}
\maketitle

\end{document}
Alex
  • 2,111

1 Answers1

1

To your document preamble, add

\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\patchcmd{\maketitle}{\let\footnoterule\relax}{}{}{}

This removes the line that clears the \footnoterule from \maketitle. If you're using hyperref, you have two options:

  1. Either load hyperref after performing the patch and you're good-to-go; or
  2. (if loading hyperref before this patch) patch \HyOrg@maketitle which contains the original pre-hyperref \maketitle information. Remember to brace the patch with a \makeatletter-\makeatother pair, since you're working with macros containing @. See What do \makeatletter and \makeatother do?

etoolbox's \patchcmd has the following interface:

\patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}

where it searches for <search> in <cmd> and replaces it with <replace>. If the replacement is successful, it executes <success>, otherwise <failure>. Therefore, the above patch searches for \let\footnoterule\relax and removes it (replaces it with an empty group {}. Since it works in the default article document class, no <success> or <failure> executions are necessary, although you could add them yourself.

Werner
  • 603,163
  • 1
    awesome, thanks. could you just explain what was going on? i couldn't figure it out – Alex Apr 02 '13 at 01:08
  • For some reason this stopped working. When I do the tracing in etoolbox i get: [debug] -- search pattern not found in replacement text – Alex Sep 17 '13 at 04:37
  • the issue is i started using the hyperref package which seems to conflict with this... – Alex Sep 17 '13 at 04:49
  • 1
    @Alex: I've added your options when loading hyperref also. Since \maketitle may contain footnotes, hyperref intervenes, causing the "search pattern not found" with etoolbox's \patchcmd. Easiest is to load hyperref after \patchcmd. – Werner Sep 17 '13 at 05:24
  • much appreciated. – Alex Sep 17 '13 at 15:03