3

I am trying to use biblatex, biblatex-apa, and biber in my document, but I think the dreaded biblatex update from last year or so is tripping me up.

My case is most like this one, but I cannot use the suggested answer to change my backend to bibtex, as biblatex-apa requires biber be the backend. However, when I do change the backend to bibtex and don't use the APA style, it compiles without error, though not in the format necessary for the journal.

Ideally I'd like help making these programs, biber, biblatex-apa, and biblatex play nice with my XeLaTeX (2016), but I guess if there's a comparable way of getting APA-like or similar enough formatting while using backend=bibtex, that would be okay too.

Thank you!

Sample document text:

\documentclass[12pt]{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{mybib.bib}
\begin{document}
\maketitle
\cite{foo}
\printbibliography
\end{document}

The code generated when compiled is like so:

This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./xz-zz-xing.tex
LaTeX2e <2016/03/31> patch level 3
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/share/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty)
(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/share/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/share/texmf-dist/tex/latex/tipa/t3enc.def
(/usr/share/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texmf-dist/tex/latex/graphics-def/xetex.def))))
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty)
(/usr/share/texmf-dist/tex/xelatex/xunicode/xunicode.sty
*** Reloading Xunicode for encoding 'EU1' ***
) (/usr/share/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(/usr/share/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
(/usr/share/texmf-dist/tex/generic/babel/babel.sty
(/usr/share/texmf-dist/tex/generic/babel-english/english.ldf
(/usr/share/texmf-dist/tex/generic/babel/babel.def
(/usr/share/texmf-dist/tex/generic/babel/xebabel.def))))
(/usr/share/texmf-dist/tex/latex/csquotes/csquotes.sty
(/usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texmf-dist/tex/latex/csquotes/csquotes.def)
(/usr/share/texmf-dist/tex/latex/csquotes/csquotes.cfg))
(/usr/share/texmf-site/tex/latex/biblatex/biblatex.sty
(/usr/share/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ltxcmds.sty))
(/usr/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texmf-dist/tex/latex/logreq/logreq.sty
(/usr/share/texmf-dist/tex/latex/logreq/logreq.def))
(/usr/share/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texmf-dist/tex/latex/url/url.sty)
(/usr/share/texmf-dist/tex/generic/xstring/xstring.sty
(/usr/share/texmf-dist/tex/generic/xstring/xstring.tex))
(/usr/share/texmf-site/tex/latex/biblatex/blx-dm.def)
(/usr/share/texmf-site/tex/latex/biblatex-apa/dbx/apa.dbx)
(/usr/share/texmf-site/tex/latex/biblatex/blx-compat.def)
(/usr/share/texmf-site/tex/latex/biblatex/biblatex.def)
(/usr/share/texmf-site/tex/latex/biblatex-apa/bbx/apa.bbx
(/usr/share/texmf-site/tex/latex/biblatex/bbx/standard.bbx)
! Illegal parameter number in definition of \blx@defformat@d.
<to be read again> 
                   3
l.368 ...{\usebibmacro{name:apa:last-first}{#1}{#3
                                                  }{#4}{#5}{#7}?}}
? 
! Illegal parameter number in definition of \blx@defformat@d.
<to be read again> 
                   4
l.368 ...ebibmacro{name:apa:last-first}{#1}{#3}{#4
                                                  }{#5}{#7}?}}
? 
! Illegal parameter number in definition of \blx@defformat@d.
<to be read again> 
                   5
l.368 ...macro{name:apa:last-first}{#1}{#3}{#4}{#5
                                                  }{#7}?}}
? 

It carries on like that for many more lines until it decides to start tackling the document, which compiles without more problems, but with a wacky bibliography.

Also, when I run biber, I get lots of warnings but no errors, and there is not a compatibility issue, as my biblatex is 3.4r-1, and my biber is 2.5, which are compatible according to the compatibility matrix in the PDF documentation.

I hope this is enough information to get some help!

  • Welcome to TeX.SX! – Heiko Oberdiek Apr 01 '17 at 05:04
  • 1
    If you add \listfiles to your preamble, the .log will definitely list what version of each package you are using. I have no issues with your file (though you should use the biblatex-examples.bib to generalize your MWE), but I have biblatex 3.7, biblatex-apa 7.4, and biber 2.7.... – jon Apr 01 '17 at 05:12
  • Hi @jon. Sorry I didn't use biblatex-examples. Anyway if those three versions work for you, then I might just have to fight gentoo linux, which desperately wants to manage TeX packages on its own, hence the earlier versions, and get teh ones you say. Would be nice to know for sure if there is something that makes the versions in my example completely obsolete and un-fixable, or if i (or anyone in a similar situation) simply must update to your versions. – the_kraken Apr 01 '17 at 05:58
  • You don't give your biblatex-apa version, but this is with almost absolute certainty a mismatch between your biblatex/Biber version and your biblatex-apa version. Since you are using gentoo linux and probably their repository TeX live there is not much you can do. I'd prefer to use vanilla TeX live where you are in charge of packages via tlmgr. – moewe Apr 01 '17 at 10:51
  • @moewe thank you for the response. I am growing increasingly convinced that it is a gentoo-specific issue for having such an outdated biblatex-apa, but I just don't know for sure until I figure out how to get around gentoo's ridiculously slow texlive support on portage. Indeed the biblatex-apa version is stuck at 6.6 on gentoo and those stubborn folks are so adamant on their portage repository that they insist that if it's not there, it simply shouldn't be yet, and you should figure something else out

    i will try to install biblatex-apa in a more recent version and see if that fixes things

    – the_kraken Apr 01 '17 at 10:55
  • You can try the newest biblatex-apa from CTAN (https://www.ctan.org/pkg/biblatex-apa), but I fear it might be too new for your biblatex (the current version is 3.7). You could try and get the correct version (probably by trial and error with a bit of guessing by the dates) from github, you only need apa.cbx, apa.bbx, apa.dbx and all the .lbx files. – moewe Apr 01 '17 at 11:07
  • OK, I checked. With biblatex 3.4/Biber 2.5 you need biblatex-apa 6.9, you can get it from https://github.com/plk/biblatex-apa/releases/tag/v6.9 – moewe Apr 01 '17 at 11:09
  • hi @moewe, i've found this thread, finally, which is basically the same as mine: http://tex.stackexchange.com/questions/336326/errors-for-using-style-apa-with-biblatex

    I suspect the situation is similar enough to warrant closing. thank you for pointing me in the right direction. Indeed it seems like I must get around gentoo's own package manager to get biblatex-apa 6.9

    – the_kraken Apr 01 '17 at 11:09
  • @the_kraken -- Note that even on gentoo you should be able to create $TEXMFHOME (usually ~/texmf, but you can probably test with kpsewhich --var-value TEXMFHOME). The 'trick' is that the directory structure must match the way it is set out in $TEXMFDIST, so the files biblatex-apa should go somewhere like $TEXMFHOME/tex/latex/biblatex-apa/ (but the docs at $TEXMFHOME/doc/latex/biblatex-apa). Then note that the normal path-searching order is $TEXMFHOME before $TEXMFLOCAL before $TEXMFDIST ... so you must remember that you're relying on the manual install when gentoo updates. – jon Apr 02 '17 at 01:02
  • thanks @jon. I've managed to manually install biblatex-apa and I tried to match the current versions I had via moewe's suggestion, but still more errors. now I will try with all the versions updated, since that should be possible to do – the_kraken Apr 02 '17 at 09:51

1 Answers1

2

The problem is due to a version mismatch.

You are running biblatex 3.4 and Biber 2.5. But only biblatex-apa 6.6. The correct biblatex-apa version for your biblatex would be 6.9.

On a non-repository system of TeX live (see e.g. How to install “vanilla” TeXLive on Debian or Ubuntu?) you could simply use tlmgr to update all packages involved to the correct CTAN versions. The CTAN versions (almost) always match, currently we have biblatex 3.7, Biber 2.7 and biblatex-apa 7.4.

Since you are stuck with your non-updatable TeX distribution, you will have to install the correct version of biblatex-apa manually. Get it from https://github.com/plk/biblatex-apa/releases/tag/v6.9 and follow the instructions (Method 3: 'Install manually') from How do I install an individual package on a Linux system?.

moewe
  • 175,683
  • @the_kraken Let me know if it worked for you. – moewe Apr 01 '17 at 11:16
  • just a quick update: biblatex-apa v. 6.6 gets me more errors.

    it turns out I can get access to biblatex 3.7 and biblatex-apa 7.4 on gentoo, it's just that biblatex 3.7 is "unstable" and biblatex-apa 7.4 is in a different package, not the actual one called biblatex-apa! i can probably install biber 2.7 as a binary as well, which is what I guess most gentoo folks do.

    will report back after i try things with those versions.

    – the_kraken Apr 02 '17 at 09:44
  • the current versions of the three packages: biblatex (3.7), biblatex-apa (7.4), and biber (2.7) play nice together and everything is working now. hopefully others find this useful if they have same dumb problem I did. the moral is to be careful of the versions of everything that you have! – the_kraken Apr 02 '17 at 10:02
  • 2
    for gentoo users: biblatex 3.7 must be selected in your /etc/portage/package.accept_keywords file (both are currently in the "testing" phase.

    biblatex-apa 7.4 can be gotten in the texlive-bibtexextra package.

    biber really should be gotten in binary form and manually installed herehttps://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/

    – the_kraken Apr 02 '17 at 10:08
  • @the_kraken Good to know. Can you get the newest Biber from 'testing' as well? If not that is a serious flaw, and the developers should think about that. Testing should contain all the newest packages and binaries for TeX, not just some. Normally manual installation of biblatex and Biber is strongly discouraged. Manually installing smaller packages like biblatex-apa is not great, but it is certainly safer than big packages like biblatex that could potentially come with lots of dependencies. – moewe Apr 02 '17 at 11:34
  • according to the sourceforge file I linked, the current version is 2.7, the one I have.

    I think my issue was more on gentoo's end than TeX's about compatibility. tlmgr simply is not supported on the system, as its own package manager, portage, insists on handling everything, and that functions at a must slower pace than TeX.

    also as I understand it, the biber team vigorously updates with new versions of perl so your perl must be updated to the bleeding edge version in order to use biber, which is not recommended by gentoo folks for perhaps good reasons

    – the_kraken Apr 02 '17 at 12:11
  • @the_kraken Yes 2.7 is the correct version. I was just saying that if you can get biblatex 3.7 from your Linux distro they should also ship Biber 2.7. – moewe Apr 02 '17 at 12:14
  • added an edit to previous comment about biber situation on gentoo – the_kraken Apr 02 '17 at 12:15