11

I'm writing a document where I'm using biblatex (with BibTeX as back-end). In my document I would like to have citations as footnotes, "normal" footnotes containing text and at the end a consolidated bibliography of the references my document contains.

There is only one, quite small, issue. I would like the final bibliography to also display the footnote number associated with the citation. How do I accomplish that?

The references at the end should then appear as:

(footnote number) (author) (title) (year)

Here's a simple example of my problem:

Generated document: http://fuskbugg.se/dl/ySqEUE/test.pdf

\documentclass[a4paper,12pt]{article}

\usepackage[style=verbose]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{test.bib}
    @book{Foo,
        title={Book title1},
        author={Author1},
        year= {Year1},
    }
    @book{Bar,
        title={Book title2},
        author={Author2},
        year= {Year2},
    }
\end{filecontents}

\addbibresource{test.bib}

\begin{document}

This is some text\footcite{Foo}, with\footnote{"Normal" footnotes also appear.} footnotes.\footcite{Bar}

\newpage

How can I make the footnote number associated with the reference be printed along with the reference? (First entry should be numbered 1 and second numbered 3.)

\printbibliography

\end{document}
5
  • Welcome to TeX.sx! Is there a special reason why you are using BibTeX instead of Biber? It appears you are using an outdated version of biblatex. The newer version of biblatex (2.x) has the default option backend=biber. To help you more effective I recommend that you have a updated LaTeX distribution. Sep 23, 2012 at 17:23
  • What will happen if you use \footcite{foo} more often? How do you expect the output in the references? Sep 23, 2012 at 17:28
  • @MarcoDaniel I guess the OP wants the number of the first footnote.
    – lockstep
    Sep 23, 2012 at 17:29
  • @lockstep: And the option \nocite isn't explained here ;-). I think the question might become really complex. Sep 23, 2012 at 17:31
  • @MarcoDaniel 1. I'm using bibtex for no special reason. I just started writing a document and bibtex seemed to work just fine. 2. Multiple citations of the same source is an interesting issue. I'm pretty much neutral on this issue but I'm kinda leaning towards that multiple occurrences in the bibliography would be the best solution. (the solution presented by lockstep is good though) 3. As for \nocite that's nothing I have utilized.
    – user19051
    Sep 24, 2012 at 18:26

1 Answer 1

11

The following must be done:

  • Amend the cite:full bibmacro so that it will also store the current footnote number in a new macro whose name uses the entrykey of the current entry;

  • Use the numeric bibstyle and the option sorting=none;

  • Change the labelnumber format so that it displays the meaning of the "footnote number" macro of the current entry.

Note that the bibliography "labels" will be ambiguous if you cite several entries for the first time in the same footnote.

(EDIT: The OP stated that he/she uses BibTeX as backend, but the current biblatex version [2.2] willl by default [as in the OP's MWE] use Biber. That said, the following solution will also work with BibTeX if one adds the appropriate backend=bibtex package option.)

\documentclass[a4paper,12pt]{article}

\usepackage[citestyle=verbose,bibstyle=numeric,sorting=none]{biblatex}

\makeatletter

\renewbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
%  \usebibmacro{shorthandintro}}% DELETED
  \usebibmacro{shorthandintro}% NEW
  \csxdef{cbx@\thefield{entrykey}@footnotenumber}{\the\value{footnote}}% NEW
}% NEW

\DeclareFieldFormat{prefixnumber}{}
\DeclareFieldFormat{labelnumber}{\csuse{cbx@\thefield{entrykey}@footnotenumber}}

\makeatother

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
    @book{Foo,
        title={Book title1},
        author={Author1},
        year= {Year1},
    }
    @book{Bar,
        title={Book title2},
        author={Author2},
        year= {Year2},
    }
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\null\vfill% just for the example

This is some text\footcite{Foo}, with\footnote{"Normal" footnotes also appear.}
footnotes.\footcite{Bar}

How can I make the footnote number associated with the reference be printed along
with the reference? (First entry should be numbered 1 and second numbered 3.)

\printbibliography

\end{document}

enter image description here

7
  • I try your solutions, but with error: File 'filecontents.sty' not found. How can they fix it?
    – JardaFait
    Sep 23, 2012 at 17:50
  • 1
    @jafan a) Remove all auxiliary files and compile again. b) Be sure to compile my example as-is.
    – lockstep
    Sep 23, 2012 at 17:52
  • Without effect. a) copy your solution b) cmd> xelatex exam.tex -> error File 'filecontents.sty' not found. Should I create yet another file?
    – JardaFait
    Sep 23, 2012 at 17:58
  • @lockstep Thank you! This solution works great. You really did me a favour there.
    – user19051
    Sep 24, 2012 at 18:29
  • 1
    @jafan " 'filecontents.sty' not found." Almost certainly means that the package filecontents is not installed on your computer.
    – user19051
    Sep 24, 2012 at 18:32

You must log in to answer this question.

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