views:

355

answers:

6

Hello,

how could i make a blank after the number in my footnotes? In a general way, means for ALL footnotes!

Thanks for helping!

Example:

good: 1 Hello World

bad : 1Hello World

+1  A: 

You could try ~ a non-breakable space

JanHudecek
+2  A: 
\hspace

can always supply horizontal spacing somewhere.

\footnote{\ insert footnote here}
\footnote{~insert footnote here}

Work, but I do not know if it is the official way to do it. The "~" is officially used in cases like:

Mr.~Smith

To provide the usual whitespace after the abbreviation "." The "\ " I do not know, I just happend to see its use some time ago after accidently putting it in a sentence.

bastijn
`~` is non-breaking space. `\ ` is plain old breaking space.
Will Robertson
A: 

Sorry, I mean change it for the hole document and not only ones.

lony
Should have been a comment.
Joey
Sorry, I didn't know. Next time!
lony
+1  A: 

EDIT: Ok, redesigned. Ugly hack, but hey, isn't LaTeX just a whole bunch of those?

Put the following into your preamble:

\let\myfootnote\footnote
\renewcommand{\footnote}[1]{\myfootnote{~#1}}

This will simply prefix your footnote text automagically with a non-breaking space, therefore creating a space after the foot note mark at the bottom of the page. And it won't touch the footnote mark in the middle of the text which is why it still works properly directly before punctuation.

Joey
Looks great, whats the problem including it in the marker?
lony
This does not include the footnote marker. Nice answer, this is the correct one.
bastijn
For me it looks OK. Maybe I found a problem later, then I ask again ;). Thanks for your help!
lony
The footmisc package (http://www.ctan.org/tex-archive/macros/latex/contrib/footmisc/footmisc.pdf) also seems to have a whole host of options related to footnotes. Maybe there is another way with that package.
Joey
I have checked it for you and the problem Johannes is referring to is not the case. So no worries, you can use his answer for solving your problem.
bastijn
Thank you both! Now back to writing *sigh*
lony
Nope, Johannes is correct. This does add extra space in unwanted situations.
Will Robertson
Ups my bad, with testing I have put it at the end of the line/sentence and the unwanted whitespace is placed _behind_ the marking number instead of in front. Yes this does place unwanted whitespace. Im sorry for such a fool testing ;).
bastijn
Ok, another solution. Tested this time and working :-)
Joey
You might also want to use an optional argument to support `\footnote[num]{text}` syntax.
Will Robertson
If I only know how to write that ... it was hard enough to find out how to call original commands augmented with stuff :-). Still, for individual documents this will probably suffice. I never needed the optional argument so far
Joey
+1  A: 

The correct answer is not to redefine \thefootnote, because that adds space wherever the footnote is referenced; for example:

\documentclass{article}
\renewcommand{\thefootnote}{\arabic{footnote}~}
\begin{document}
hello\footnote{test\label{foo}} but don't forget about fn.\,\ref{foo}.
\end{document}

Note the extra space when the footnote number is referred to!

The footnote itself (including the number) is placed by the macro \@makefntext, whose default definition is

\parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark }#1

Here's an example of a replacement that adds some space after the footnote number:

\documentclass{article}
\makeatletter
\long\def\@makefntext#1{%
  \parindent 1em\noindent\hb@xt@ 1.8em{\hss\@makefnmark}~#1%
}
\makeatother
\begin{document}
hello\footnote{test\label{foo}} but don't forget about fn.\,\ref{foo}.
\end{document}

You might also wish to reduce the indent on the left, for example.

Will Robertson
May I ask how you found that? I searched through the LaTeX sources (not that I can read TeX very well but I thought I *could* find it) and didn't find a suitable definition I could use. I updated my answer with a working and tested solution, by the way.
Joey
I've done it before so I knew what to look for `:)`. Section 62.2 in source2e.pdf is fairly instructive (for the standards of that document).
Will Robertson
A: 

Hello everyone,

I made myself an account, but now I couldn't comment the answers, so I posed my solution. I tried Will's version, but I have problems if the footnote is to long and needed a new line.

So based on his work I find this:

\makeatletter
 \renewcommand{\@makefntext}[1]{%
    \setlength{\parindent}{0pt}
    \begin{list}{}{%
     \setlength{\topsep}{0pt}
     \setlength{\partopsep}{0pt}
     \setlength{\labelwidth}{1em} % Space from number to border
     \setlength{\labelsep}{0.3em} % Space from number to text
     \setlength{\leftmargin}{\labelwidth}
     \addtolength{\leftmargin}{\labelsep}
     \footnotesize}\item[{\makebox[\labelwidth][r]{\@makefnmark}}]#1%
    \end{list}
 }
\makeatother

Thanks for all of your help, now it is looking very nice and I haven account ;).

lony