1

How do I make the footnote counter automatically reset to 0 whenever it reaches 25?

I am trying to duplicate the footnote style from a book where the footnote marks are the letters of the alphabet--but the footnote marks reset to 'a' after every 'z'.

The kludge I have worked out involves compiling and whenever I get “LaTeX Error: Counter too large,” I insert the command: \setcounter{footnote}{0} just before the footnote that caused the error.

Unfortunately, whenever I add or remove a footnote, I will have to manually adjust and subsequent footnote resets.

Here is the kludge code I am using:

\documentclass{amsbook}
\renewcommand{\thefootnote}{\alph{footnote}}    %   footnotes a, b, c,

%\makeatletter                          %   reset footnote counter
%\@addtoreset{footnote}{section}            %   at each section break
%\makeatother

\begin{document}
When\footnote{something} the\footnote{something} quick\footnote{something} brown\footnote{something} fox--which\footnote{something} had\footnote{something} a\footnote{something} short\footnote{something} bushy\footnote{something} tail\footnote{something} that\footnote{something} looked\footnote{something} like\footnote{something} something\footnote{something} you\footnote{something} might\footnote{something} have\footnote{something} gotten\footnote{something} from\footnote{something} the\footnote{something} Fuller\footnote{something} brush\footnote{something} man\footnote{something} back\footnote{something} when\footnote{something} they\footnote{something} %
\setcounter{footnote}{0}%
came\footnote{something} house\footnote{something} to\footnote{something} house\footnote{something} selling\footnote{something} their\footnote{something} goods--jumped\footnote{something} over\footnote{something} the\footnote{something} fat\footnote{something} and\footnote{something} lazy\footnote{something} calico\footnote{something} cat,\footnote{something} a\footnote{something} little\footnote{something} dog\footnote{something} which\footnote{something} had\footnote{something} been\footnote{something} yapping\footnote{something} at\footnote{something} a\footnote{something} squirrel\footnote{something} laughed\footnote{something} to\footnote{something} %
\setcounter{footnote}{0}%
see\footnote{something} such\footnote{something} a\footnote{something} sight:\footnote{something} and\footnote{something} the\footnote{something} dish\footnote{something} ran\footnote{something} away\footnote{something} with\footnote{something} the\footnote{something} spoon\footnote{something} as\footnote{something} the\footnote{something} cow\footnote{something} jumped\footnote{something} over\footnote{something} the\footnote{something} moon.\footnote{something}
\end{document}

A second, related question (omitting 'j' and 'w' from the alphabet) has a solution incorporating both questions.

  • 2
    Try \renewcommand{\thefootnote}{\ifnum\value{footnote}=26 \setcounter{footnote}{0} \fi \alph{footnote}}. If you want to have a more serious answer, please consider asking your question in a more thoughtful way. Why do you expect that users looking at your question enjoy installing FreeSerif? Do you really think FreeSerif has any, even remote, relation to your problem? Please remove this from your code as well as all special characters. – user121799 Sep 28 '18 at 1:25
  • I didn't want to ask two question in the same post, so I made two posts (based on the same code) to ask the two questions. That is why there were two posts both using FreeSerief. I've adjusted the command as you suggested, marmot, and it worked both in my example and the actual document. It accomplishes the task in both. I'll also try out @Werner suggestion of a different counter. I'm now going to work on incorporating the answers from both questions before posting a final (this time actually) MWE. – Bryan M-H Sep 28 '18 at 2:03
  • Glad to hear! You are doing it (this part, at least) perfectly right: one question per question. And thanks for removing the unnecessary FreeSerif fonts. BTW, I am not planning to post an answer, and my comment is part of the answer below, so I guess you are all set. – user121799 Sep 28 '18 at 2:07
0

You should define a new counter representation, say \cyclealph:

enter image description here

\documentclass{amsbook}

\renewcommand{\thefootnote}{\cyclealph{footnote}}

\newcommand{\cyclealph}[1]{\ifnum\value{#1}=26 \setcounter{#1}{0}\fi\alph{#1}}

\begin{document}

When\footnote{something} the\footnote{something} quick\footnote{something} brown\footnote{something} fox--which\footnote{something} 
had\footnote{something} a\footnote{something} short\footnote{something} bushy\footnote{something} tail\footnote{something} 
that\footnote{something} looked\footnote{something} like\footnote{something} something\footnote{something} you\footnote{something} 
might\footnote{something} have\footnote{something} gotten\footnote{something} from\footnote{something} the\footnote{something} 
Fuller\footnote{something} brush\footnote{something} man\footnote{something} back\footnote{something} when\footnote{something} 
they\footnote{something} %
came\footnote{something} house\footnote{something} to\footnote{something} house\footnote{something} selling\footnote{something} 
their\footnote{something} goods---jumped\footnote{something} over\footnote{something} the\footnote{something} fat\footnote{something} 
and\footnote{something} lazy\footnote{something} calico\footnote{something} cat,\footnote{something} a\footnote{something} 
little\footnote{something} dog\footnote{something} which\footnote{something} had\footnote{something} been\footnote{something} 
yapping\footnote{something} at\footnote{something} a\footnote{something} squirrel\footnote{something} laughed\footnote{something} 
to\footnote{something} %
see\footnote{something} such\footnote{something} a\footnote{something} sight:\footnote{something} and\footnote{something} 
the\footnote{something} dish\footnote{something} ran\footnote{something} away\footnote{something} with\footnote{something} 
the\footnote{something} spoon\footnote{something} as\footnote{something} the\footnote{something} cow\footnote{something} 
jumped\footnote{something} over\footnote{something} the\footnote{something} moon.\footnote{something}

\end{document}

However, it seems more feasible to use alphalph:

\usepackage{alphalph}
\renewcommand{\thefootnote}{\alphalph{\value{footnote}}}

It avoids having duplicate footnote entries on the same page as in your example.

enter image description here

  • Remarkably close to this comment ... – user121799 Sep 28 '18 at 1:36
  • @marmot: Indeed. I generalised for use as \cyclealph, but recommend using alphalph. – Werner Sep 28 '18 at 1:42
  • I had looked at alphalph, but the example I was trying to mimic didn't double letters. Applying @marmot command to my own document, and then coming back and studying how you incorporated the same command with a new counter really helped. (One step at a time.) I'm now working through your response to my other (omit j and v) question (which adds a third element to the solution). – Bryan M-H Sep 28 '18 at 2:35

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.