1

In order to neaten up the footnotes of my references, I used the code provided in this post. Before, I was just using \footfullcite{} and additionally \AtEveryCitekey{\clearfield{url}}, because I felt like the URLs were a bit messy.

However, after adding the aforementioned code, this does not seem to have any effect any more.

Example code from the post with \AtEveryCitekey{\clearfield{url}} added:

\documentclass{article}
\usepackage[style=numeric-comp,sorting=none,citetracker,pagetracker=page]{biblatex}
\usepackage[colorlinks]{hyperref}

\makeatletter
% user-level citation command
\DeclareCiteCommand{\sfcite}[\cbx@superscript]
  {\usebibmacro{cite:init}%
   \let\multicitedelim\supercitedelim
   \iffieldundef{prenote}{}{\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}{}{\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:super:foot}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

% save instcount, save key and last inline instcount if seen first on page
\newbibmacro*{cite:super:foot}{%
  \xdef\cbx@key{\thefield{entrykey}}%
  \ifsamepage{\value{instcount}}{\csuse{cbx@instcount@\cbx@key}}{}{%
    \listxadd{\cbx@savelist}{\cbx@key}%
    \ifnumequal{\value{cbx@inst@lastonpage}}{0}{%
      \defcounter{cbx@inst@iter}{\value{instcount}}%
      \loop\ifnum\value{cbx@inst@iter}>0
        \ifsamepage{\value{instcount}}{\value{cbx@inst@iter}}
          {\ifcsundef{blx@fnpage@\number\numexpr\value{cbx@inst@iter}}
             {\setcounter{cbx@inst@lastonpage}{\value{cbx@inst@iter}}}{}%
           \stepcounter{cbx@inst@iter}}
          {\setcounter{cbx@inst@iter}{0}}%
      \repeat}{}}%
  \csnumgdef{cbx@instcount@\cbx@key}{\value{instcount}}}
\let\cbx@savelist\@empty
\newcounter{cbx@inst@iter}
\newcounter{cbx@inst@lastonpage}
\setcounter{cbx@inst@lastonpage}{0}

\newrobustcmd*{\cbx@superscript}[1]{%
  \global\toggletrue{cbx@sfcite}
  \mkbibsuperscript{#1}%
  \cbx@footnote%
  \global\togglefalse{cbx@sfcite}}
\newtoggle{cbx@sfcite}

\AtEveryCitekey{%
  \ifciteseen{}{\csnumgdef{cbx@instcount@\thefield{entrykey}}{-1}}%
  \iftoggle{cbx@sfcite}{}{\cbx@footnote}}
\AtEveryBibitem{\cbx@footnote}
\AtEveryLositem{\cbx@footnote}

% defer citation footnotes to last inline reference instance on page
\newrobustcmd*{\cbx@footnote}{%
  \ifboolexpr{ not test {\ifdefempty{\cbx@savelist}}
               and test {\ifnumequal{\value{instcount}}{\value{cbx@inst@lastonpage}}} }
    {\cbx@sortlist@init%
     \let\do\cbx@do
     \dolistloop{\cbx@sortlist}%
     \global\let\cbx@savelist\@empty
     \setcounter{cbx@inst@lastonpage}{0}}{}}

% print footnotes in 'sorting' order
\def\cbx@do#1{%
  \ifinlist{#1}{\cbx@savelist}
    {\begingroup
     \blx@resetdata
     \blx@getrefcontext{#1}%
     \blx@getdata@cite{#1}%
     \blx@setoptions@type\abx@field@entrytype
     \blx@setoptions@entry
     \blx@execute
     \blx@beglang
     \iffieldundef{shorthand}
       {\gdef\@thefnmark{\printfield{labelprefix}\printfield{labelnumber}}}
       {\gdef\@thefnmark{\printfield{shorthand}}}%
     \gappto\@thefnmark{\blx@initunit}%
     \ifhyperref
       {\H@@footnotetext{\blx@driver\abx@field@entrytype}}
       {\@footnotetext{\blx@driver\abx@field@entrytype}}%
     \blx@endlang
     \endgroup}
    {}}

% access internal list of sorted entry keys
\def\cbx@sortlist@init{%
  \global\letcs{\cbx@sortlist}
    {blx@dlist@entry@\the\c@refsection @\blx@refcontext@context}}
\let\cbx@sortlist\@empty
\makeatother

\addbibresource{biblatex-examples.bib}
\AtEveryCitekey{\clearfield{url}}

\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
\begin{document}
\null\vfill\noindent
New citation.\sfcite{companion}
New and recurrent citations.\sfcite{kant:ku,companion}
Vanilla footnote with citation.\footnote{Following \textcite{companion}...}
\clearpage
\null\vfill\noindent
New citation.\sfcite{ctan}
Recurrent citations from previous and current pages.\sfcite{companion,ctan}
\clearpage
\printbibliography
\end{document}

Any help on this would be greatly appreciated, since the due date for my paper is not far out…

1 Answer 1

1

Was able to solve it myself:

You have to add \iffieldundef{url}{}{\clearfield{url}} in the block that starts with \def\cbx@do#1{ in between \printfield{shorthand}}} and \gappto\@thefnmark.

Working block:

% print footnotes in 'sorting' order
\def\cbx@do#1{%
  \ifinlist{#1}{\cbx@savelist}
    {\begingroup
     \blx@resetdata
     \blx@getrefcontext{#1}%
     \blx@getdata@cite{#1}%
     \blx@setoptions@type\abx@field@entrytype
     \blx@setoptions@entry
     \blx@execute
     \blx@beglang
     \iffieldundef{shorthand}
       {\gdef\@thefnmark{\printfield{labelprefix}\printfield{labelnumber}}}
       {\gdef\@thefnmark{\printfield{shorthand}}}%
    \iffieldundef{url}{}{\clearfield{url}}%
    \iffieldundef{doi}{}{\clearfield{doi}}%
     \gappto\@thefnmark{\blx@initunit}%
     \ifhyperref
       {\H@@footnotetext{\blx@driver\abx@field@entrytype}}
       {\@footnotetext{\blx@driver\abx@field@entrytype}}%
     \blx@endlang
     \endgroup}
    {}}

You must log in to answer this question.

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