2

I don't know if this package is required to make this happen.

\usepackage[bottom]{footmisc}

I reset the footnote counter on every chapter.

\makeatletter
\@addtoreset{footnote}{chapter}

I want to use "lower-case" alpha for my footnotes. This limits me to 26 per chapter, which should be sufficient...

\mainmatter
\renewcommand*{\thefootnote}{\alph{footnote}}

I want to prepend the chapter number in the footnotetext superscript, but not in the inline superscript.

Here is^a some text from^b chapter one.

Here^a is some text^b from chapter^c two.

Which in the footnotes below would render as...

^{1a} Text for footnote a in chapter one.
^{1b} Text for footnote b in chapter one.
^{2a} Text for footnote a in chapter two.
^{2b} Text for footnote b in chapter two.
^{2c} Text for footnote c in chapter two.

where the "chapter" counter is used for the prepend. I tried:

\renewcommand*{\thefootnote}{\thechapter\alph{footnote}}

but that prepends in the inline text and the footnote below. I only want it below.

This link suggests I can reformat the \renewcommand{\@makefntext}[1]{% ...

I have a two-column setup, and two chapters could appear on the same page. Ideally, I would like only the first element^a of each chapter to have the prepend, possibly with the chapter number in bold.

^{1a} Text for footnote a in chapter one.
^{b} Text for footnote b in chapter one.
^{2a} Text for footnote a in chapter two.
^{b} Text for footnote b in chapter two.
^{c} Text for footnote c in chapter two.
2
  • Interesting question. Could you prepare a complete (but a small as possible) document that shows your current setup? That will make it much easier for people interested in answering to start trying to find a solution. – Marijn Jan 1 '20 at 15:28
  • I think I came up with a working hack. I will post. – mshaffer Jan 3 '20 at 12:45
2

Check whether the footnote number is one or not.

\documentclass[oneside]{book}
\usepackage{scrextend}

\usepackage{lipsum} % for mock text

\deffootnote{2em}{0.5em}{\footnoteformatting}

\newcommand{\footnoteformatting}{%
  \makebox[0pt][r]{\textsuperscript{%
    \ifnum\value{footnote}=1
      \thechapter.%
    \fi
    \thefootnote
    \enspace
  }}%
}
\AtBeginDocument{\renewcommand{\thefootnote}{\alph{footnote}}}
\counterwithin{footnote}{chapter}

\setlength{\textheight}{0.5\textheight}

\begin{document}

\chapter{Test}

Text\footnote{First footnote} text\footnote{\lipsum[1][1-3]}

\chapter{Test}

Text\footnote{First footnote} text\footnote{Second footnote}

\end{document}

enter image description here

0

I used the following package:

\usepackage{scrextend}  
\deffootnote{2em}{0.5em}{{\footnoteformatting}} 

I hacked the formatting as follows (package allows string manipulation):

\usepackage{xstring}

\newcommand\footnoteformatting{%
    %\typeout{The footnote: \thefootnote}
    %\typeout{The footnote (value): \value{\thefootnote}}
    %\typeout{The footnote (arabic): \arabic{\thefootnote}}
    \IfInteger{\thefootnote}{%
        % no special formatting, it is an integer.
        \thefootnotemark.\enskip
        }{%
        % it is a \alph ...
        \StrLeft{\thefootnote}{1}[\firstchar]%
        \IfStrEq{\firstchar}{a}{%true
                {\color{black}\textbf{\thechapter}}\thefootnotemark.\enskip
            }{%false
                {\color{white}\textbf{\thechapter}}\thefootnotemark.\enskip
            }%

        }%
    }%

If the alpha string is {a} I place in black, otherwise white. I use the color code of "white" to hide the number. That allows for nice alignment of the footnote letters.

If I need to get passed {z} to {aa} using another footnote package, this logic will still work. An image showing footnote {h} from Chapter 1 and footnote {a} from Chapter 2.

enter image description here

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.