0

I tried using the solution here https://tex.stackexchange.com/a/373581/100078 with XeLaTeX. It always gives the error Undefined control sequence "\DeclareSortingNamekeyScheme".

This is the code i'm trying to compile:

\documentclass{article}

\usepackage[backend=biber, style=authoryear]{biblatex}

\DeclareSortingNamekeyScheme{
  \keypart{
    \namepart{given}
  }
  \keypart{
    \namepart{prefix}
  }
  \keypart{
    \namepart{family}
  }
  \keypart{
    \namepart{suffix}
  }
}

\DeclareNameAlias{sortname}{default}

\begin{document}
\cite{sigfridsson,worman,geer,cicero,nussbaum,knuth:ct:a}
\printbibliography
\end{document}

This seems to be taken straight out of the docs and it still does not work.

I have given up on trying to find the solution to fix this. Any help, please?

P.S. I want to sort the authors by their first name, then last name. I tried another method (in place of default), but even this does not produce the effect.

\DeclareNameAlias{sortname}{first-last}

P.S. Doesn't matter what the references are. Biber compiles (if XeLaTeX produces its .bcf file).

The error log corresponding to the error:

(/usr/share/texlive/texmf-dist/tex/latex/biblatex/biblatex.cfg
File: biblatex.cfg 
)))
! Undefined control sequence.
l.5 \DeclareSortingNamekeyScheme
                                {
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
l.6   \keypart
              {
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
l.7     \namepart
                 {given}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...         
garyF
  • 113
  • 4
    Please add a compilable code to your question (not only a link) and show the complete error message (copy it from the log file) ... – Mensch Oct 18 '17 at 14:36
  • 3
    Your texsystem (and so your biblatex) is probably to old for this command. – Ulrike Fischer Oct 18 '17 at 14:55
  • 2
    Please correct \documentclassarticle} to \documentclass{article}. Add before the line \listfiles, compile 3 times and check the log file. At the end you find a list of used packages and version numbers. Please add this list to your question! BTW: With a current MiKTeX I can compile your MWE without errors! – Mensch Oct 18 '17 at 16:06
  • \DeclareSortingNamekeyScheme was introduced in version 3.3 (released 2016-03-01), so probably your biblatex version is too old. The current version is 3.7. When you update to 3.3 or newer read Biblatex 3.3 name formatting. – moewe Oct 19 '17 at 08:44
  • Any news here? Could you find out which version of biblatex you are running? Could you do an update? Did it help? – moewe Oct 22 '17 at 10:45
  • @moewe Thanks for the tip. It looks like the version is the issue. I have Ubuntu 14.04 which only comes with the binary for an older version (3.14) (released on 20140215). Unfortunately, i'm stuck on this for the time being until i complete my report. I did a workaround by bracing the author's entire name. I'll upgrade my OS later, and will update here if that helps. – garyF Oct 22 '17 at 13:31
  • May I ask why you were trying to use the answer you linked in the first place? It is highly unusual to sort by given name. – moewe Oct 22 '17 at 13:36
  • I strongly believe that this "last name" referral should go away. Why? Because people's names differ widely across the world: https://www.w3.org/International/questions/qa-personal-names. ​ ​ ​ ​ So instead of having "last-name, first-initials" in my references, i just put the complete name as appeared in the paper. And for easy lookup, i want them sorted normally (as if the entire name was a single string). But Bib does this weird thing of writing the full name, but sorted on the last name. P.S: I also cite them by full name. – garyF Oct 22 '17 at 13:49
  • 1
    In that case it is indeed easiest to put the names in braces. That makes sure it is never split into its given and family part. With the code from the other answer you will only change the sorting, for other purposes the name is still split. The radical solution is to tell Biber/BibTeX that the name consists of only one part by wrapping it in braces. (That will also mean less code to set these things up for you.) – moewe Oct 22 '17 at 14:10

1 Answers1

1

\DeclareSortingNamekeyScheme was introduced in version 3.3 and renamed in 3.8 to \DeclareSortingNamekeyTemplate. You are running an older version of biblatex that defines neither of the two commands. In order to use this command you will have to update your biblatex and Biber versions.

But since your aim is to always treat names as an inseparable unit and don't want to split into first and last names, your best bet is to wrap all names in a set of curly brackets, that way they will be treated as atomic.

author = {{Anne Elk} and {Elizabeth Ditor}},

Will always come out the same even with the standard settings, you don't even need to change the sortname format or \DeclareSortingNamekeyScheme.

Since the name parsing and splitting is done by the backend, there is no biblatex solution to treat a name as atomic if it wasn't input as atomic. We can only try to manipulate everything so that it looks as though the name is never split, but that is much more work than just putting the name in curly brackets.

moewe
  • 175,683