Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I’m using the following commands to customize footnotes:

\usepackage[bottom,norule,hang]{footmisc}
\setlength{\footnotemargin}{2mm}
\setlength{\footnotesep}{4mm}
\addtolength{\footskip}{2mm}

The results were as I wanted but only until the 10th footnote (see image below). Is there a way to define the the footnote text margin as a function of the horizontal space that the footnote number takes?

The numbers are flushed to the left and have the same margin as the main text. The footnote text margin, however, seems to be the main text margin plus a fixed quantity.

share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. knowing what document class you use may be central to answering your question. –  barbara beeton Oct 25 '12 at 12:53
add comment

3 Answers

up vote 3 down vote accepted

footmisc with the hang option has the property that if \footnotemargin is 0 or negative, then the hanging indent is set to the width of the footnote mark. Thus:

\documentclass[a5paper]{article}
\usepackage{lipsum}
\usepackage[bottom,norule,hang]{footmisc}
\setlength{\footnotemargin}{0pt}

\begin{document}
\footnote{Long footnote text, to see whether we get
the hanging effect or not.  Just as a test.}\lipsum[4]
\footnote{Long footnote text, to see whether we get
the hanging effect or not.  Just as a test.}\lipsum[4]

\setcounter{footnote}{1010}
\footnote{Long footnote text, to see whether we get
the hanging effect or not.  Just as a test.}\lipsum[4]

\end{document}

produces the following reasonable effect with no overlapping

No space sample

What is lacking here is some spacing between the footnote mark and the text. To correct this we can patch the relevant command in footmisc so that if the hang option is given and \footnotemargin is negative, we use the length information there to provide the spacing between the mark and the text, e.g. a value of -0.5em leads to a space of 0.5em. In the original package, if \footnotemargin is <=0 then just the width of the footnotemark is used. Below, we change one line so that the width of a box containing the footnotemark plus a skip of -\footnotemargin is used in the same situation:

\documentclass[a5paper]{article}
\usepackage{lipsum}
\usepackage[bottom,norule,hang]{footmisc}
\setlength{\footnotemargin}{-0.5em}

\makeatletter
\ifFN@para
\else
  \long\def\@makefntext#1{%
    \ifFN@hangfoot
      \bgroup
      \setbox\@tempboxa\hbox{%
        \ifdim\footnotemargin>0pt
          \hb@xt@\footnotemargin{\@makefnmark\hss}%
        \else
          \@makefnmark\hskip-\footnotemargin      %%Changed here
        \fi
      }%
      \leftmargin\wd\@tempboxa
      \rightmargin\z@
      \linewidth \columnwidth
      \advance \linewidth -\leftmargin
      \parshape \@ne \leftmargin \linewidth
      \footnotesize
      \@setpar{{\@@par}}%
      \leavevmode
      \llap{\box\@tempboxa}%
      \parskip\hangfootparskip\relax
      \parindent\hangfootparindent\relax
    \else
      \parindent1em
      \noindent
      \ifdim\footnotemargin>\z@
        \hb@xt@ \footnotemargin{\hss\@makefnmark}%
      \else
        \ifdim\footnotemargin=\z@
          \llap{\@makefnmark}%
        \else
          \llap{\hb@xt@ -\footnotemargin{\@makefnmark\hss}}%
        \fi
      \fi
    \fi
    \footnotelayout#1%
    \ifFN@hangfoot
      \par\egroup
    \fi
  }
\fi
\makeatother

\begin{document}
\footnote{Long footnote text, to see whether we get
the hanging effect or not.  Just as a test.}\lipsum[4]
\footnote{Long footnote text, to see whether we get
the hanging effect or not.  Just as a test.}\lipsum[4]

\setcounter{footnote}{1010}
\footnote{Long footnote text, to see whether we get
the hanging effect or not.  Just as a test.}\lipsum[4]

\end{document}

Output with space

share|improve this answer
add comment

The only value that is important here, given the hang option, is:

\setlength{\footnotemargin}{2mm}

which is very small for any two digit number. footmisc sets the length to 1.8em by default, which might be too big for your taste unless your footnotes number in the 100s (in my experience, you really need at least 1.2em if you get into the 100s).

Try this file, for example:

\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage[bottom,norule,hang]{footmisc}
\setlength{\footnotemargin}{1.2em}
%\setlength{\footnotesep}{4mm}
%\addtolength{\footskip}{2mm} 

\begin{document}

\setcounter{footnote}{8}
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]

\setcounter{footnote}{98}
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]

\setcounter{footnote}{198}
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]

\setcounter{footnote}{998}
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]
\footnote{Test.}\lipsum[1]

\end{document}    
share|improve this answer
2  
Why CW? It seems a genuine personal answer –  egreg Oct 25 '12 at 13:06
    
@egreg -- Hmm, didn't mean to make it CW.... How do I change that? –  jon Oct 25 '12 at 13:10
    
Edit the answer and remove the checkmark at the bottom –  egreg Oct 25 '12 at 13:16
    
@egreg -- I may be too dense, but I made an edit and there was no option to 'uncheck' anything anywhere. Perhaps I don't have the right kind of permissions to make that kind of change..? (Not that I need to undo the CW status, but I agree that it is not a CW answer.) –  jon Oct 25 '12 at 13:26
add comment

As I know is the usual way to layout footnotes is to have a look to the resulting number of footnotes (for example 105) after you finished writing your text.

Now you can change \setlength{\footnotemargin}{2mm} to a value that gives you the wished space, for example \setlength{\footnotemargin}{7mm}.

So you get all footnotes layouted with the same space for the footnote number.

If you want to change the space after the 9th footnote you can use a second command \setlength{\footnotemargin}{7mm} as shown in the following MWE:

%http://tex.stackexchange.com/questions/79039/extra-space-between-footnote-numbers-and-content-for-high-count
\documentclass[12pt]{scrartcl}

\usepackage[bottom,norule,hang]{footmisc}

\setlength{\footnotemargin}{2mm}   % set space for first 9 footnotes

\begin{document}
Lorem ipsum\footnote{footnote 1 now extends footnote now extends footnote now extends 
  footnote now extends footnote now extends footnote now extends
  footnote now extends} below the bottom margin 
which\footnote{This footnote 2 now extends} below the bottom margin 
which\footnote{This footnote 3 now extends} below the bottom margin 
which\footnote{This footnote 4 now extends} below the bottom margin 
which\footnote{This footnote 5 now extends} below the bottom margin 
which\footnote{This footnote 6 now extends} below the bottom margin 
which\footnote{This footnote 7 now extends} below the bottom margin 
which\footnote{This footnote 8 now extends} below the bottom margin 
which\footnote{This footnote 9 now extends} below the bottom margin 
\setlength{\footnotemargin}{7mm}  % set new space for number
which\footnote{This footnote 10 now extends footnote now extends 
  footnote now extends footnote now extends footnote now extends
  footnote now extends footnote now extends} below the bottom margin 
which\footnote{This footnote 11 now extends} below the bottom margin 
which\footnote{This footnote 12 now extends} below the bottom margin 
\end{document}

For me that looks not like a good typhography, so I personaly wouldn't do it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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