# \abx@extras@<language> is added to \extra<language> without defining \abx@extras@<lanugage> #894

Open
opened this issue May 27, 2019 · 1 comment

Projects
2 participants

### komascript commented May 27, 2019

 If \extraslanguage is defined, biblatex adds \abx@extras@language to it without making sure, that \abx@extras@language is really defined. This results in an error message if \extraslanguage is executed but \abx@extras@english is not defined, e.g. \documentclass{article} \usepackage[british]{babel} \def\extrasenglish{\def\testname{Test}} \addto\extrasbritish{\extrasenglish} \usepackage{biblatex} \begin{document} Test \end{document}  results in an error message: ./test.aux:6: Undefined control sequence. \extrasenglish ...@resetpunct \abx@extras@english \abx@strings@english l.6 \babel@aux{british}{}  Note, this is a simplified example. In reality the problem occurs, while testing whether or not a term definition is part of either \captionsenglish or \extrasenglish. To solve the problem you could e.g., add \csname abx@extras@english\endcsname or \@namese{abx@extras@english} instead of \abx@extras@english.

### moewew added a commit to moewew/biblatex that referenced this issue May 28, 2019

 Don't expand \csname in extras<lang> (plk#894) 
 26c2072 

Collaborator

### moewew commented May 28, 2019 • edited

 Thanks for reporting this. A first fix is at 26c2072. Since we have etoolbox available I went for \csuse and not \@nameuse or an unexpanded \csname ...\endcsname, but the effect should be the same. That said, we should probably not add the macros at all if we don't load the language properly. ... edit: done in 9e50d57. Workaround at https://komascript.de/node/2242. See also https://tex.stackexchange.com/q/492862/35864.

### moewew added a commit that referenced this issue Jun 1, 2019

 Add extras/strings only if necessary (#894) 
It only makes sense to add \abx@extras@<lang> and \abx@strings@<lang>
to \extras<lang> for languages that are loaded properly (and not just
for inheritance reasons).
This avoids possibly undefined commands floating around.
 9e50d57