plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
520 stars 118 forks source link

\DeclareCaseLangs undefined after recent update #1090

Closed sieversMartin closed 2 years ago

sieversMartin commented 3 years ago

After the latest update I get ! Undefined control sequence. for \DeclareCaseLangs. As the macro is still documented and used in biblatex.sty, I must have missed something here.

\listfiles
\documentclass{article}
\usepackage{biblatex}
\DeclareCaseLangs{}% same with non-empty argument
\begin{document}
   Test
\end{document}
*File List*
 article.cls    2020/04/10 v1.4m Standard LaTeX document class
  size10.clo    2020/04/10 v1.4m Standard LaTeX file (size option)
biblatex.sty    2020/12/31 v3.16 programmable bibliographies (PK/MW)
pdftexcmds.sty    2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2019/12/03 v1.5 Providing info/warning/error messages (HO)
   iftex.sty    2020/03/06 v1.0d TeX engine tests
 ltxcmds.sty    2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
etoolbox.sty    2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
kvoptions.sty    2020-10-07 v3.14 Key value format for package options (HO)
kvsetkeys.sty    2019/12/15 v1.18 Key value parser (HO)
  logreq.sty    2010/08/04 v1.0 xml request logger
  logreq.def    2010/08/04 v1.0 logreq spec v1.0
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
  blx-dm.def    2020/12/31 v3.16 biblatex localization (PK/MW)
blx-compat.def    2020/12/31 v3.16 biblatex compatibility (PK/MW)
biblatex.def    2020/12/31 v3.16 biblatex compatibility (PK/MW)
standard.bbx    2020/12/31 v3.16 biblatex bibliography style (PK/MW)
 numeric.bbx    2020/12/31 v3.16 biblatex bibliography style (PK/MW)
 numeric.cbx    2020/12/31 v3.16 biblatex citation style (PK/MW)
biblatex.cfg    
l3backend-pdftex.def    2020-09-24 L3 backend support: PDF output (pdfTeX)
 english.lbx    2020/12/31 v3.16 biblatex localization (PK/MW)
   expl3.sty    2020-12-07 L3 programming layer (loader) 
blx-case-expl3.sty    2020/12/31 v3.16 expl3 case changing code for biblatex
  xparse.sty    2020-10-27 L3 Experimental document command parser
 ***********
moewew commented 3 years ago

Oh, bugger!

Thank you very much for reporting this issue. It's caused by delaying loading the case changer for #1058.

I'll have to see how we can fix this properly, but in the meantime a workaround is to use \AtBeginDocument so that the case changing code is already loaded when \DeclareCaseLangs is issued.

\documentclass{article}
\usepackage{biblatex}

\AtBeginDocument[biblatex/declarecaselangs]{%
  \DeclareCaseLangs{}%
}

\DeclareHookRule{begindocument}{biblatex/declarecaselangs}{after}{biblatex}

\begin{document}
   Test
\end{document}

Now also on TeX.SX: https://tex.stackexchange.com/q/578647/35864

moewew commented 3 years ago

This should be fixed by https://github.com/plk/biblatex/commit/15a62fb5bb227db5ef613aaa13778d92bd190f29 where we no longer delay loading the case changing code to \AtBeginDocument (because of https://tex.stackexchange.com/q/581409/35864).


That said, I find \DeclareCaseLangs{} a bit odd. If you don't want sentence casing, it would be more natural to redefine the titlecase field format not to apply \MakeSentenceCase (the default \DeclareFieldFormat{titlecase}{#1} in biblatex.def is not to apply sentence casing).

edit It seems that \DeclareCaseLangs{} was used in muya.bbx to suppress unified's sentence case

 \DeclareFieldFormat[%
  article,book,collection,incollection,inproceedings,thesis,unpublished]%
  {titlecase}{\MakeSentenceCase*{#1}}%

To do that job, I'd just go with

 \DeclareFieldFormat*{titlecase}{#1}%
sieversMartin commented 3 years ago

Got me :-) Thanks for the suggestion. I'll change that for my project.

moewew commented 2 years ago

biblatex 3.17 with the fix for this issue has been released and is available in both MikTeX and TeX live. The MWE from the first post now compiles without error.