7

I need to put a rather long list of names in a footnote. They can't be properly hyphenated and do not break into pretty lines, so leaving the right side of text ragged seems a perfect solution to me.

However, I was surprised when \footnote{\raggedright ABC} did not work out. \RaggedRight from ragged2e package fails too as well as \usepackage[ragged]{footmisc}.

I'm using memoir as a document style, so I tried plain article instead... and \raggedright started working as expected.

\documentclass[a4paper, 12pt]{memoir}
%\documentclass[a4paper, 12pt]{article}

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.\footnote{\raggedright 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 upidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.\footnote{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 upidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}

I suspect memoir's footnote series are the cause, but their source code is, ugh... complex.

So, a question: how do a I make a certain footnote left-justified with memoir?

5

Using a redefinition of \@makefntext you can achieve what you want. The original definition is

\newcommand{\@makefntext}[1]{\makefootmark #1}

so you can say something like

\renewcommand{\@makefntext}[1]{\makefootmark\raggedright##1}}

In the example below I used the redefinitions inside commands such that you can switch to the new style (and restore the original behaviour) at any moment:

\documentclass[a4paper, 12pt]{memoir}

\makeatletter
\newcommand\RaggedFootnote{%
  \renewcommand{\@makefntext}[1]{\makefootmark\raggedright##1}}
\newcommand\StandardFootnote{%
  \renewcommand{\@makefntext}[1]{\makefootmark##1}}
\makeatother

\begin{document}
\null\vfill%just for the example
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.\RaggedFootnote\footnote{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.}\StandardFootnote Excepteur sint occaecat upidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.\footnote{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 upidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}

enter image description here

| improve this answer | |
3

There's no real need to mess with the internal footnoting commands, as long as you are using the ragged2e package, since memoir provides a hook for styling the footnote text. You simply need to add

\renewcommand\foottextfont{\footnotesize\RaggedRight}

(assuming you're loading ragged2e).

For some reason this doesn't work with plain \raggedright.

| improve this answer | |
  • 1
    This was my first idea too, unfortunately, this doesn't work with \raggedright. – Gonzalo Medina Aug 31 '13 at 19:36
  • @GonzaloMedina Strange, I didn't actually test this. Any idea why? – Alan Munn Aug 31 '13 at 19:49
  • Not really. I was reading the code for footnotes in memoir.cls to find the explanation, but I got lazy and didn't finish ;-) – Gonzalo Medina Aug 31 '13 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.