Text FormattingFormating Footnotes

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Formating Footnotes

Post by gwada74 »

Hi,
I have a really hard trying to get my footnotes without left blank before the fnmark. I need this :
1. blablablablablabl
bkbakbkabkakka


Is someone can help me on this, it drives me crazy. The document class I am using is Book.

Thanks in advance.
Last edited by gwada74 on Tue Jan 04, 2011 6:03 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Formating Footnotes

Post by meho_r »

Try this:

Code: Select all

\documentclass{book}

\makeatletter

\renewcommand\@makefntext[1]{%
\setlength\parindent{1em}%
\noindent
\mbox{\@thefnmark.~}{#1}}

\makeatother

\usepackage{lipsum}% just to generate dummy text

\begin{document}
Test\footnote{\lipsum[1]}.
\end{document}
Also, instead of \mbox{\@thefnmark.~}{#1}, you may use something like this:

Code: Select all

\makebox[1.5em][r]{\@thefnmark.~}{#1}
where 1.5em is the width of the box in which footnote mark is placed, and r means it is raggedleft.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formating Footnotes

Post by localghost »

Or just use the footmisc package.

Code: Select all

\usepackage[bottom,flushmargin,hang,multiple]{footmisc}
Thorsten
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Formating Footnotes

Post by gwada74 »

meho_r wrote:Try this:

Code: Select all

\documentclass{book}

\makeatletter

\renewcommand\@makefntext[1]{%
\setlength\parindent{1em}%
\noindent
\mbox{\@thefnmark.~}{#1}}

\makeatother

\usepackage{lipsum}% just to generate dummy text

\begin{document}
Test\footnote{\lipsum[1]}.
\end{document}
Also, instead of \mbox{\@thefnmark.~}{#1}, you may use something like this:

Code: Select all

\makebox[1.5em][r]{\@thefnmark.~}{#1}
where 1.5em is the width of the box in which footnote mark is placed, and r means it is raggedleft.
This is not working, my command are not highlight as error and are not taken into account. I am completely lost.
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Re: Formating Footnotes

Post by gwada74 »

\renewcommand{\footnote}[1]{%
%\makeatletter
%\newcommand\@makefntext[1]%
% {\parbox[t]{2mm}{\@thefnmark. \,}\parbox[t]{110mm}{#1}}
%\makeatother


This is I think my best solution to obtain what I want, but written like this the footnotes are in the principal text and not at the bottom of the page. What should I add to my code to specify the text at the bottom of my page ?
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Formating Footnotes

Post by meho_r »

Let's start from the beginning: what exactly do you want to achieve?

1. Do you want numbers in footnotes to be normal, not superscript, followed by a period?

2. Do you want numbers not to be indented (as well as the text of the footnote in general)?

This is what I concluded from your first post and the code I provided does exactly that (see the output in the attachment). If you want something else, please state that clearly and we'll try to find a solution.
Attachments
example.pdf
(30.44 KiB) Downloaded 469 times
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Re: Formating Footnotes

Post by gwada74 »

Hi,

Your example shows almost what I am looking for. Except that I would like the footnote text lines that are under the footnotemark to be align with the first footnotetext line. Is that clear ?

Concerning the footenote mark position this is exactly what I want.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Formating Footnotes

Post by meho_r »

Well, in that case localghost's suggestion is exactly the solution you're looking for.

In case that superscript numbers in footnotes pose a problem, you can try something like this:

Code: Select all

\documentclass{article}

\usepackage[bottom,flushmargin,hang,multiple]{footmisc}

\renewcommand*\hangfootparskip{0\baselineskip}% vertical space between paragraphs in a footnote
\renewcommand*\hangfootparindent{1em}% indentation of paragraphs after the first one in a footnote

\makeatletter

% the original code from footmisc.sty (except for the two lines marked as == added ==)
\long\def\@makefntext#1{%
   \renewcommand{\@makefnmark}{\mbox{% == added ==
   \normalfont\@thefnmark.~}}% == added ==
    \ifFN@hangfoot
      \bgroup
      \setbox\@tempboxa\hbox{%
        \ifdim\footnotemargin>0pt
          \hb@xt@\footnotemargin{\@makefnmark\hss}%
        \else
          \@makefnmark
        \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
}

\makeatother

\usepackage{lipsum}% just to generate dummy text

\begin{document}

Test\footnote{Some dummy text which serves only one purpose: to show how a footnote would look like when you are using the code I provided earlier. As you can see, now all lines are indented by the same amount as the first one.

A second paragraph in a footnote should be indented.}

\setcounter{footnote}{9}

Test\footnote{Some dummy text which serves only one purpose: to show how a footnote would look like when you are using the code I provided earlier. As you can see, now all lines are indented by the same amount as the first one.}

\setcounter{footnote}{99}

Test\footnote{Some dummy text which serves only one purpose: to show how a footnote would look like when you are using the code I provided earlier. As you can see, now all lines are indented by the same amount as the first one.}

\end{document}
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Re: Formating Footnotes

Post by gwada74 »

It is working in your example and this is what I am looking for.
But with my code it is not working, I am using the class book.
Is this can be a problem ? This drives me really really crazy.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Formating Footnotes

Post by meho_r »

Can you create a Minimal Working Example (MWE) from that file of yours? The code works for me with book class too.
Post Reply