I am using the scrreprt class and I want footnotes defined as:

\deffootnote{2.0em}{1.5em}{\makebox[2.0em][l]{\thefootnotemark.\ }}

This footnote style works well for footnotes 1-99. However, there is not enough space for the number in the footnote when the footnote counter reaches 100. Currently, I am redefining the footnote by placing \CenturyFootnote on the page the 100th footnote appears. (It is acceptable if smaller footnotes also appear on this page.)

\newcommand*{\CenturyFootnote}{\deffootnote{2.4em}{1.9em}{\makebox[2.4em][r]{\thefootnotemark.\ \ }}}

However, this means I have to update the placement of this command whenever the text changes. How can I ensure this command is read just prior to the footnote reaching 100.

3 Answers 3


You can add tests to the various arguments of \deffootnote. As long as they are expandable it should work fine:

\deffootnote{\ifnum\the\value{footnote}<100 2.0em\else 3cm\fi}
            {\ifnum\the\value{footnote}<100 2.0em\else 2cm\fi}
            {\makebox[\ifnum\the\value{footnote}<100 2.0em\else 3cm\fi][l]{\thefootnotemark.\ }}

\kant[9]\footnote{\kant[9] blblblb }

\kant[9]\footnote{\kant[9] blblbl }


enter image description here

  • You don't need \the\value, just \value is sufficient: \value{footnote} is a legal <number> in the context of \ifnum.
    – egreg
    Oct 28, 2016 at 8:25
  • @egreg: probably in my next life I will be able to remember when you need \the and when not in the context of mixed tex/latex code (in a real style I would use expl3 for this). Oct 28, 2016 at 8:36
  • Is it possible for the test to be of the value of the maximum footnote on the page?
    – Hugh
    Oct 30, 2016 at 3:39
  • Should be possible with zref. Oct 30, 2016 at 7:35
  • See tex.stackexchange.com/questions/348891/…
    – Hugh
    Jan 26, 2017 at 3:28

Instead of hard-coding the values of the footnote construction, assign them to lengths. This way you can change the lengths and the associated footnote mark definition would change along with it. It's similar to redefining the footnote mark definition, but doesn't require the overhead.

Below I define two lengths - \fnmarkA and \fnmarkB. I also redefine the way \footnote works in order to condition on the footnote number. All footnotes are set in the usual way until you reach footnote number 99. At that point, the \fnmarkA and \fnmarkB lengths are updated, and the original \footnote definition is restored (to avoid more overhead due to unnecessary conditioning).

enter image description here




\let\oldfootnote\footnote% Store \footnote definition
\deffootnote{\fnmarkA}{\fnmarkB}{\makebox[\fnmarkA][l]{\thefootnotemark.\ }}% < 100
\RenewDocumentCommand{\footnote}{ o m }{%
    {\oldfootnote[#1]{#2}}% \footnote[.]{..}
    {\oldfootnote{#2}}% \footnote{..}
    \addtolength{\fnmarkA}{.5em}% Associated with \footnote 100+
    \addtolength{\fnmarkB}{.5em}% Associated with \footnote 100+
    \let\footnote\oldfootnote% Restore original footnote definition (avoid overhead)

\def\x{\lipsum[2]\footnote{Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
  Proin sagittis mattis vulputate. Aliquam dignissim, nulla scelerisque hendrerit dictum, 
  enim ante molestie nulla, in fringilla massa nisi sit amet nulla.}}




xparse was merely used for its easy way of managing optional arguments (which \footnote provides) and/or conditioning on their existence/use.


Modify \footnote to make a check on the footnote number: if it is 99, issue the change.

However, this change should be act globally on the commands redefined by \deffootnote, so we have to make a “global” version. What's the problem? If \deffootnote is issued in an environment, like in the example below, the action will disappear as soon as the environment ends.


\deffootnote{2.0em}{1.5em}{\makebox[2.0em][l]{\thefootnotemark.\ }}

\xpretocmd{\footnote}{\ifnum\value{footnote}=99 \hundredthfootnote\fi}{}{}
  \globaldeffootnote{2.4em}{1.9em}{\makebox[2.4em][r]{\thefootnotemark.\ \ }}%

\textheight=4cm % just for making the picture



x\footnote{Normal footnote}

\item y\footnote{Hundredth footnote}



enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .