2

The posting Incompatibility between footmisc-option multiple and hyperref contains a solution to having consecutive footnote markers hyper-linked and automatically separated by raised commas.

How to have the same when there is a sequence of footnotes and footcites, such as

Text\footnote{First footnote}\footcite{firstcitation}\footnote{citation}

This is the solution on the linked page:

\documentclass{article}
\usepackage{hyperref}

\let\oldFootnote\footnote
\newcommand\nextToken\relax

\renewcommand\footnote[1]{%
    \oldFootnote{#1}\futurelet\nextToken\isFootnote}

\newcommand\isFootnote{%
    \ifx\footnote\nextToken\textsuperscript{,}\fi}

\textheight=3cm
\begin{document}

Text\footnote{First footnote}\footnote{Second footnote}\footnote{Third footnote} Text\footnote{Fourth footnote} Text

\end{document} 
1

The solution to your query involves making two additions to @Holle's code you quoted in your posting.

  • First, modify the \isFootnote macro to test whether the very next token is either \footnote or \footcite (and, if the test is "true", to instruct LaTeX to insert \textsuperscript{,}).

  • Second, renew the \footcite macro in the same way the \footnote macro has been renewed.

enter image description here

\documentclass{article}
\usepackage{biblatex} % for '\footcite' macro
\usepackage[colorlinks]{hyperref}

\let\oldFootnote\footnote
\let\oldFootcite\footcite
\newcommand\nextToken\relax   
\renewcommand\footnote[1]{%
    \oldFootnote{#1}\futurelet\nextToken\isFootnoteOrFootcite}
\renewcommand\footcite[1]{%
    \oldFootcite{#1}\futurelet\nextToken\isFootnoteOrFootcite}
\newcommand\isFootnoteOrFootcite{%
    \ifx\footnote\nextToken\textsuperscript{,}%
    \else\ifx\footcite\nextToken\textsuperscript{,}\fi%
    \fi}

\setlength\textheight{3cm} % just for this example
\begin{document}

Text.\footnote{First footnote}\footcite{An entry to be cited}\footcite{Another entry to be cited}\footnote{Second footnote}  
More text

\end{document} 
| 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.