latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
126 stars 34 forks source link

Missing "Unused global option(s)" warning #110

Closed komascript closed 3 years ago

komascript commented 3 years ago

If I use babel, LaTeX does not longer report unused global option(s). E.g.:

\listfile
\documentclass[thisoptionisunknown]{article}
\usepackage[english]{babel}
\begin{document}
\end{document}

should IMHO report:

LaTeX Warning: Unused global option(s):
    [thisoptionisunknown].

but it does not.

Running `LaTeX' on `test' with ``pdflatex  -file-line-error  --synctex=1 -interaction=nonstopmode test.tex''
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-10-27> xparse <2020-03-03>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2020/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2020/texmf-dist/tex/generic/babel/babel.def
(/usr/local/texlive/2020/texmf-dist/tex/generic/babel/txtbabel.def))
(/usr/local/texlive/2020/texmf-dist/tex/generic/babel-english/english.ldf))
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./test.aux) (./test.aux)

 *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)
   babel.sty    2020/10/27 3.51 The Babel package
 english.ldf    2017/06/06 v3.3r English support from the babel system
l3backend-pdftex.def    2020-09-24 L3 backend support: PDF output (pdfTeX)
 ***********

 )
No pages of output.
Transcript written on test.log.

TeX Output finished at Mon Nov 30 18:56:10
jbezos commented 3 years ago

The warning has to be shown, indeed. I've labelled this issue as a bug and I'll try to fix for the next release.

u-fischer commented 3 years ago

The fix still defines \ds@option for all class options and this could confuse packages testing for it

 \documentclass[blub]{article}
 \makeatletter
 \show\ds@blub

 \usepackage[ngerman]{babel}

 \makeatletter
 \show\ds@blub

 \begin{document}
    abc
\end{document}

gives

Package babel Info: Making " an active character on input line 122.
)))
> \ds@blub=macro:
->.

We wonder if babel could reset undefined options to \relax.

komascript commented 3 years ago

Please reopen, because defining all \ds@<option> of the class options list as empty, if <option>.ldf and babel-<option>.tex do not exist, breaks packages, that do test for the exist of \ds@<option>, e.g., package scrbase.

You should at least, make sure, that \ds@<option> is undefined (or at least \relax) after babel has been finished. You could do so, e.g. adding \AtEndOfPackage{\expandafter\let\csname ds@#1\endcsname\undefined} after \@namedef{ds@#1}{} in line 1065 and 1091 of babel.sty.

FrankMittelbach commented 3 years ago

@komascript agreed. @jbezos this violates the option mechanism of LaTeX in my opinion. Babel should not pretend that such options are set if they aren't.