TransWikia.com

How do I remove citation number from footcite

TeX - LaTeX Asked on June 30, 2021

How can I display footnote citations with only the citation text without any footnote number (and also remove it in the text). For example, I would like to get the following footnote (MWE follows):


Doe 2013, Public 2013

documentclass{article}
usepackage{filecontents}
begin{filecontents}{jobname.bib}
    @article{Doe2013,
        title   = {Lorem Ipsum},
        volume  = {1},
        journal = {J. Foo},
        author  = {J. Doe},
        year    = {2013},
        pages   = {1--10},
    }

    @article{Public2013,
        title   = {Dolor Sit Amet},
        volume  = {1},
        journal = {J. Foo},
        author  = {J. Q. Public},
        year    = {2013},
        pages   = {11--20},
    }
end{filecontents}

usepackage[
    style=authoryear-icomp,
    backend=biber
]{biblatex}
addbibresource{./test.bib}

begin{document}
    footcite{Doe2013,Public2013}
end{document}

One Answer

One way to do it is to redefine the blx@mkbibfootnote command that is defining citation in footnote. You can the use a modified version of the footnote command, with no number.

Redefinition of the footnote command:

newcommandfootnotenonun[1]{%
  begingroup
  renewcommandthefootnote{}footnote{#1}%
  addtocounter{footnote}{-1}%
  endgroup
}

Redefinition of the blx@mkbibfootnote command:

makeatletter
renewrobustcmd{blx@mkbibfootnote}[2]{%
  iftoggle{blx@footnote}
    {blx@warning{Nested notes}%
     addspacemkbibparens{#2}}
    {unspace
     ifnumblx@notetype=tw@
       expandafter@firstoftwo
     else
       expandafter@secondoftwo
     fi
       {csuse{blx@theendnote#1}{protecting{blxmkbibnote{end}{#2}}}}
       {csuse{footnotenonum#1}{protecting{blxmkbibnote{foot}{#2}}}}}}
makeatother

The good point is that it won't interfeer with footnote numbering if you use the "normal" footnote command. Of course, if you want all your footnotes without number, you can renewcommand the footnote command instead of creating a new one.

MWE:

documentclass{article}
usepackage{filecontents}
begin{filecontents}{jobname.bib}
    @article{Doe2013,
        title   = {Lorem Ipsum},
        volume  = {1},
        journal = {J. Foo},
        author  = {J. Doe},
        year    = {2013},
        pages   = {1--10},
    }

    @article{Public2013,
        title   = {Dolor Sit Amet},
        volume  = {1},
        journal = {J. Foo},
        author  = {J. Q. Public},
        year    = {2013},
        pages   = {11--20},
    }
end{filecontents}

usepackage[
    style=authoryear-icomp,
    backend=biber
]{biblatex}
addbibresource{jobname.bib}

newcommandfootnotenonum[1]{%
  begingroup
  renewcommandthefootnote{}footnote{#1}%
  addtocounter{footnote}{-1}%
  endgroup
}

makeatletter
renewrobustcmd{blx@mkbibfootnote}[2]{%
  iftoggle{blx@footnote}
    {blx@warning{Nested notes}%
     addspacemkbibparens{#2}}
    {unspace
     ifnumblx@notetype=tw@
       expandafter@firstoftwo
     else
       expandafter@secondoftwo
     fi
       {csuse{blx@theendnote#1}{protecting{blxmkbibnote{end}{#2}}}}
       {csuse{footnotenonum#1}{protecting{blxmkbibnote{foot}{#2}}}}}}
makeatother

begin{document}
    footcite{Doe2013,Public2013} testfootnote{test}, testfootnotenonum{test2}, testfootcite{Doe2013}
end{document}

Output: Obtained after running pdflatex test.tex (there are BibTeX warnings, one may launch biber test then rerun pdflatex test.tex but it works however).

enter image description here

enter image description here

Correct answer by MBR on June 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP