3

This is a follow-up question to Using \footcite and \cite with \printbibliography

I have to have two kind of references in my document. Footnotes that reference web sources and the standard references at the end of the document.

The goal is, that the footnote references do not appear in the bibliography. Therefore, I used the referenced approach which works fine. The only problem is, that the references in the bibliography skip numbers. Is there any way around this?

\documentclass{article}
\usepackage[backend=biber, style=numeric]{biblatex}
\addbibresource{references.bib}

\DeclareBibliographyCategory{skipbib}
\DeclareCiteCommand{\myfootcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\addtocategory{skipbib}{\thefield{entrykey}}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}
Lorem ipsum \cite{handa_nepomuk_2013} test\myfootcite{colomb_ontology_2007} dolor\myfootcite{adams1995hitchhiker} sit amet. 

\printbibliography[notcategory=skipbib]
\end{document}

references.bib:

@book{adams1995hitchhiker,
  title={The Hitchhiker's Guide to the Galaxy},
  author={Adams, D.},
  isbn={9781417642595},
  url={http://books.google.com/books?id=W-xMPgAACAAJ},
  year={1995},
  publisher={San Val}
}

@book{colomb_ontology_2007,
    title = {Ontology and the semantic web},
    isbn = {9781586037291},
    pagetotal = {258},
    publisher = {{IOS} Press},
    author = {Colomb, Robert M.},
    date = {2007}
}

@letter{handa_nepomuk_2013,
    title = {Nepomuk in 4.13 and beyond},
    url = {https://mail.kde.org/pipermail/nepomuk/2013-December/004858.html},
    type = {E-mail},
    author = {Handa, Vishesh},
    urldate = {2014-12-01},
    date = {2013-12-12},
}

Result:

enter image description here

  • Welcome to TeX.SX! Please help us (and also you) and add a minimal working example with bibliography (MWEB), that illustrates your problem. Its much easier when we see compilable code, starting with \documentclass and ending with \end{document}. – Bobyandbob Aug 9 '17 at 21:20
1

Load biblatex with the option defernumbers. This was indeed a problem with my original answer. I have fixed that as well.

MWE (filecontents will overwrite an existing .bib file with the same name without warning)

\documentclass{article}
\usepackage[backend=biber, style=numeric, defernumbers]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{adams1995hitchhiker,
  title={The Hitchhiker's Guide to the Galaxy},
  author={Adams, D.},
  isbn={9781417642595},
  url={http://books.google.com/books?id=W-xMPgAACAAJ},
  year={1995},
  publisher={San Val}
}

@book{colomb_ontology_2007,
    title = {Ontology and the semantic web},
    isbn = {9781586037291},
    pagetotal = {258},
    publisher = {{IOS} Press},
    author = {Colomb, Robert M.},
    date = {2007}
}

@letter{handa_nepomuk_2013,
    title = {Nepomuk in 4.13 and beyond},
    url = {https://mail.kde.org/pipermail/nepomuk/2013-December/004858.html},
    type = {E-mail},
    author = {Handa, Vishesh},
    urldate = {2014-12-01},
    date = {2013-12-12},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareBibliographyCategory{skipbibliography}
\DeclareCiteCommand{\myfootcite}[\mkbibfootnote]
  {\usebibmacro{prenote}}
  {\addtocategory{skipbibliography}{\thefield{entrykey}}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\begin{document}
Lorem ipsum \cite{handa_nepomuk_2013} test\myfootcite{colomb_ontology_2007} dolor\myfootcite{adams1995hitchhiker} sit amet. 

\printbibliography[notcategory=skipbibliography]
\end{document}

cropped example output

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.