TransWikia.com

Biblatex: printing a bibliography twice with different styles

TeX - LaTeX Asked on January 3, 2021

As the title says, I need to print a bibliography twice. I already finished the paper and cited everything using biblatex.

I basically need a bibliography with numerical style and after that another bibliography with all the entries listed in alphabetical order without the numbers, but rather the "verbose" style.

Is there any way to do this? As I understand it I need to specify bibstyle when I include the biblatex package.
Thanks in advance.

One Answer

In general it is not possible to switch citation or bibliography styles mid-document. But in many cases there are workarounds to achieve the desired effect.

Leaving aside the dashed option, there aren't many code differences between a numeric bibliography and a verbose-style bibliography (which is ultimately just an authortitle bibliography). The biggest difference is the bibliography environment and the name format for sortname. We just copy the relevant bits from authortitle.bbx.

The more interesting problem is sorting. Sorting is usually taken care of by so-called refcontexts. If you change the sorting you switch to a different refcontext. Sorting isn't the only thing controlled by a refcontext, so that switch may affect other details as well (in particular it may change disambiguation calculations). This should not be a concern in this setup, but could be in a different context. For us it is enough to tell biblatex explicitly to use sorting=none, in citations with assignrefcontextentries[sorting=none]{*}. (That is necessary because biblatex usually uses the last refcontext an entry was used in for citations. In our case that would be the second author-title bibliography, which has the wrong sort order.)

documentclass[british]{article}
usepackage[T1]{fontenc}
usepackage{babel}
usepackage{csquotes}

usepackage[backend=biber, style=numeric, sorting=none]{biblatex}

assignrefcontextentries[sorting=none]{*}

newcommand*{InitializeAuthorTitleBibliography}{%
  setlength{bibitemsep}{0pt}%
  DeclareNameAlias{author}{sortname}%
  DeclareNameAlias{editor}{sortname}%
  DeclareNameAlias{translator}{sortname}%
  DeclareNameWrapperAlias{author}{sortname}%
  DeclareNameWrapperAlias{editor}{sortname}%
  DeclareNameWrapperAlias{translator}{sortname}}

defbibenvironment{authotitlebib}
  {InitializeAuthorTitleBibliography
   list
     {}
     {setlength{leftmargin}{bibhang}%
      setlength{itemindent}{-leftmargin}%
      setlength{itemsep}{bibitemsep}%
      setlength{parsep}{bibparsep}}}
  {endlist}
  {item}

addbibresource{biblatex-examples.bib}

begin{document}
Lorem autocite{sigfridsson,worman}
dolor autocite{nussbaum}
ipsum autocite{geer}
amet autocite{sigfridsson,aksin,herrmann}

printbibliography

newrefcontext[sorting=nty]
printbibliography[env=authotitlebib, title={Author-Title refname}]
end{document}

Numeric citations, numeric bibliography, author-title bibliography.

Answered by moewe on January 3, 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