biblatex icon indicating copy to clipboard operation
biblatex copied to clipboard

`autolang=hyphen` plus `related` not working

Open pcdi opened this issue 1 year ago • 4 comments

I cannot use autolang=hyphen together with related under biber version: 2.20.

M(n)WE:

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{german}

\usepackage[autolang=hyphen]{biblatex}

\begin{filecontents}{\jobname.bib}
 @Book{GermanOriginal,
  title            = {German Original},
  langid           = {german},
  related          = {EnglishTranslation},
}

@Book{EnglishTranslation,
  title            = {English Translation}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

Errors:

debug.tex:26: LaTeX Error: \begin{document} ended by \end{hyphenrules}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.26 \end
         {document}
debug.tex:26: Undefined control sequence.
\blx@break #1&->\blx@done 
                          \undef \blx@do \undef \blx@done 
l.26 \end
         {document}

pcdi avatar Apr 03 '24 15:04 pcdi

Thank you very much for reporting this.

I haven't quite figured out what exactly is wrong here, but the problematic commit is quite definitely https://github.com/plk/biblatex/commit/134da03fd355bf342cb919940fbc16267fe7651f.

moewew avatar Apr 03 '24 21:04 moewew

This actually revealed a bug that's been with us quite a bit longer than https://github.com/plk/biblatex/commit/134da03fd355bf342cb919940fbc16267fe7651f. The definition of \blx@endlang was not always correct when no language switching needed to be done. That should be fixed in https://github.com/plk/biblatex/commit/533b1ee6ab1d7b1b61d830125ebad6375204cf81.

@plk We probably need a biblatex-only release of 3.20a soon, because I'm guessing this issue will pop up in other contexts as well.

The language code uses a lot of \lets and I'm wondering if we can simplify stuff a bit if we just use \defs. I'll investigate...

moewew avatar Apr 04 '24 16:04 moewew

That's fine @moewew - just tell me when ...

plk avatar Apr 04 '24 16:04 plk

Will do. I'm currently hoping we might include the fixes/whatever we need for https://github.com/plk/biblatex/issues/1348 as well, if I can figure out what to do about it soon-ish.

moewew avatar Apr 04 '24 16:04 moewew