-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ltkeys: Global options starting surrounded by spaces in the input are not removed from the unused option list #1238
Comments
Fixed in dev? |
It is fixed in |
As far as I understood this issue is fixed however I came across this while implementing an expl3 class and the following MWE still show this issue (with TeXLive 2024, up-to-date on macOS, up-to-date) \RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!
\begin{filecontents}{democlass.cls}
\ProvidesExplClass {democlass} {2024/07/22} {1} {demo}
\LoadClassWithOptions { scrbook }
\tl_new:N \l_demo_word_tl
\keys_define:nn { democlass } {
word .tl_set:N = \l_demo_word_tl,
}
\ProcessKeyOptions [ democlass ]
\newcommand{\myword}{\tl_use:N \l_demo_word_tl}
\end{filecontents}
\documentclass[word =xx]{democlass}
% Any preamble code goes here
\usepackage{bugreport}
\begin{document}
Test: \myword
\end{document} Am I doing something wrong or is this bug still persistent? |
@tweh It seems the problem only reproduces with Koma-Script document classes like \documentclass[foo =xx]{scrbook}
\makeatletter
% article.cls, unused options: <foo>
% scrbook.cls, unused options: <foo >, note the trailing space
\PackageError{debug}{unused options: <\@unusedoptionlist>}{}
\makeatother
\begin{document}
content
\end{document} |
Looks like \RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!
\begin{filecontents}[force]{democlass.cls}
\LoadClass{article}
\DeclareKeys {word .code = \OptionNotUsed}
\ProcessKeyOptions
\end{filecontents}
\documentclass[word =xx]{democlass}
\begin{document}
\end{document} In log
Lines 1522 to 1527 in 22375e7
|
One way is to add space-trimming to \ExplSyntaxOn
% \def\@remove@eq@value#1=#2\@nil{#1} % before
\def\@remove@eq@value#1=#2\@nil{\tl_trim_spaces:n{#1}}
\ExplSyntaxOff Lines 1524 to 1526 in 22375e7
Lines 1744 to 1745 in 22375e7
|
@muzimuzhi Make a PR? |
See latex3#1238. Co-authored-by: Jonathan Spratte <jspratte@yahoo.de>
Brief outline of the bug
The current code used to remove keys from the unused options list doesn't first strip spaces from the key name, which results in false-positives in the unused options list.
Minimal example showing the bug
Log file (required) and possibly PDF file
bugreport.log
The text was updated successfully, but these errors were encountered: