0

I'd like to personalize my footnotes. So I wrote the following command:

\documentclass[12pt]{book}

\usepackage[oldstyle,proportional]{libertine}

\makeatletter
    \def\thefootnote{\arabic{footnote}}

    \renewcommand\footnoterule{
        \kern -3\p@
        \hrule \@width .2\columnwidth  height 1\p@
        \kern 2.6\p@
    }

    \renewcommand\@makefnmark{% appel de note
        \mbox{\footnotesize\textsuperscript{\libertineLF{\thefootnote}}}%
    }

    \renewcommand\@makefntext[1]{%
        \parindent = 0em%
        \hangindent = 2.15em%
        \hangafter = 1%
        \noindent%
        \hb@xt@2.15em{\hss\libertineLF{\@thefnmark.\quad}}#1
    }
\makeatother

\begin{document}

Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo
\footnote{First footnote. Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo. Praesent feugiat sapien aliquet odio. Sed neque lectus, consectetuer at, consectetuer sed, eleifend ac, lectus.

Praesent feugiat sapien aliquet odio. Integer vitae justo. Ut mi mi, lacinia sit amet, placerat et, mollis vitae, dui.}. 
Praesent feugiat sapien aliquet odio. Integer vitae justo\footnote{Footnote n°2}. Aliquam vestibulum fringilla lorem\footnote{Footnote n°3}. Sed neque lectus, consectetuer at, consectetuer sed, eleifend ac, lectus. Nulla facilisi\footnote{Footnote n°4}. Pellentesque eget lectus\footnote{Footnote n°5}. Proin eu metus. Sed porttitor\footnote{Footnote n°6}. In hac habitasse platea dictumst\footnote{Footnote n°7}. Suspendisse eu lectus\footnote{Footnote n°8}. Ut mi mi, lacinia sit amet, placerat et, mollis vitae, dui\footnote{Footnote n°9}. Sed ante tellus, tristique ut, iaculis eu, malesuada ac, dui\footnote{Footnote n°10}. Mauris nibh leo, facilisis\footnote[30]{Footnote n°30} non, adipiscing quis\footnote[33]{Footnote n°33} , ultrices a, dui\footnote[70]{Footnote n°70} .

\end{document}

Which gives :

footnote with book class

The result is not bad, but I would like paragraphs 2, 3, 4 . . . in the same footnote to have the same indentation as the first paragraph. (By the way, do you know what \hss does ? I find nothing on it.)

On the other hand, when I integrate this same code in my Document Class, there is an extra space just before the footnote mark. I would like to delete it.

footnote with myclass

Here is a part of the code of my document class :

\NeedsTeXFormat{LaTeX2e}[2020/02/13]
\ProvidesClass{myclass2}
        [2020/02/13]

%%%%    PAGE LAYOUT    %%%%

\setlength\paperheight      {200mm}
\setlength\paperwidth       {200mm}     

\setlength\topmargin        {1.25cm}
\setlength\headheight       {0.75cm} 
\setlength\headsep          {0.5cm}
\setlength\topskip          {18\p@}
\setlength\footskip         {1.25cm}

\setlength\footnotesep      {12\p@}
\setlength{\skip\footins}   {12\p@      \@plus 4\p@     \@minus 2\p@}

%%%%    FONT SIZE    %%%%

\renewcommand\normalsize{%
    \@setfontsize\normalsize{12}{18\p@      \@plus  1\p@        \@minus 0.5\p@ }%
%
    \abovedisplayskip=          12\p@       \@plus  3\p@        \@minus 3\p@%
    \belowdisplayskip=          \abovedisplayskip%
%
    \abovedisplayshortskip=     3\p@        \@plus  2\p@%
    \belowdisplayshortskip=     12\p@       \@plus  3\p@        \@minus 3\p@%
%
    \let\@listi\@listI%
}

\normalsize

\ifx
    \MakeRobust\@undefined
\else
    \MakeRobust\normalsize
\fi

\DeclareRobustCommand\footnotesize{%
    \@setfontsize\footnotesize{10}{15}%
    \abovedisplayskip=      10\p@           \@plus 3\p@     \@minus 3\p@%
    \belowdisplayskip=      \abovedisplayskip%
    \abovedisplayshortskip= 2\p@            \@plus 2\p@%
    \belowdisplayshortskip= 10\p@           \@plus 3\p@     \@minus 3\p@%
%
    \def\@listi{%
        \leftmargin=        \leftmargini%
        \topsep=            6\p@            \@plus 2\p@     \@minus 2\p@%
        \parsep=            3\p@            \@plus 1\p@     \@minus \p@%
        \itemsep=           \parsep%
    }
}

%%%%    PARAGRAPH    %%%%

\setlength\parindent        {2em}
\setlength\parskip          {0 pt}

%%%%    SKIP AMOUNT    %%%%

\setlength\smallskipamount  {3\p@       \@plus 1\p@         \@minus 1\p@}
\setlength\medskipamount    {6\p@       \@plus 2\p@         \@minus 2\p@}
\setlength\bigskipamount    {12\p@      \@plus 4\p@         \@minus 4\p@}

%%%%    PACKAGES    %%%%

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{fontspec}
\RequirePackage[left=2.5cm, right=2.5cm]{geometry}
\RequirePackage[oldstyle,proportional]{libertine}

%%%%    FOOTNOTE    %%%%

\interfootnotelinepenalty=2000      % saut de page d'une note

\def\thefootnote{\arabic{footnote}}

    \renewcommand\footnoterule{%
        \kern -3\p@%
        \hrule width .2\columnwidth  height 1\p@%
        \kern 2.6\p@%
    }

    \renewcommand\@makefnmark{% appel de note
         \mbox{\footnotesize\textsuperscript{\libertineLF{\thefootnote}}}%
    }

    \newcommand\@makefntext[1]{%
        \parindent = 0em%
        \hangindent = 2.15em%
        \hangafter = 1%
        \noindent%
        \hb@xt@2.15em{\hss\libertineLF{\@thefnmark.\quad}}#1
    }

And the MWE I used:

\documentclass{myclass}

\usepackage[oldstyle,proportional]{libertine}

\begin{document}

Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo\footnote{First footnote. Donec odio elit, dictum in, hendrerit sit amet, egestas sed, leo. Praesent feugiat sapien aliquet odio. Sed neque lectus, consectetuer at, consectetuer sed, eleifend ac, lectus.

Praesent feugiat sapien aliquet odio. Integer vitae justo. Ut mi mi, lacinia sit amet, placerat et, mollis vitae, dui. Sed neque lectus, consectetuer at, consectetuer sed, eleifend ac, lectus.}. 
Praesent feugiat sapien aliquet odio. Integer vitae justo\footnote{Footnote n°2}. Aliquam vestibulum fringilla lorem\footnote{Footnote n°3}. Sed neque lectus, consectetuer at, consectetuer sed, eleifend ac, lectus. Nulla facilisi\footnote{Footnote n°4}. Pellentesque eget lectus\footnote{Footnote n°5}. Proin eu metus. Sed porttitor\footnote{Footnote n°6}. In hac habitasse platea dictumst\footnote{Footnote n°7}. Suspendisse eu lectus\footnote{Footnote n°8}. Ut mi mi, lacinia sit amet, placerat et, mollis vitae, dui\footnote{Footnote n°9}. Sed ante tellus, tristique ut, iaculis eu, malesuada ac, dui\footnote{Footnote n°10}. Mauris nibh leo, facilisis\footnote[30]{Footnote n°30} non.

\end{document}

Thank you in advance for your answers

  • 1
    If you have more text than will fit in a \hbox to 2.15em, \hss will allow the text of overflow (to the left). See also \hfill. IThis is used to right align the numbers. If you want to left align the numbers, lose the \hbox and just add \hskip., \hspace or \hspace*.) – John Kormylo Mar 31 at 4:46
0

I solved my paragraph indentation problem by changing the definition of \@makefntext:

\newcommand\@makefntext[1]{%
        \parindent = 2.15em%
        \hangindent = 2.15em%
        \hangafter = 1%
        \noindent%
        \hb@xt@2.15em{\hss\libertineLF{\@thefnmark.\quad}}{#1}%
}

But I still have an extra space problem before the note call when using my document class... I can't explain it.

| improve this answer | |

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.