Skip to content

unknown-keyhandler disables removing from unused options #1183

@Skillmon

Description

@Skillmon

Brief outline of the bug

If one activates an unknown handler in an l3keys-set the new option handler does no longer remove known keys from the list of unused options if used inside a class (in a package the handling seems fine).

Minimal example showing the bug

\RequirePackage{latexbug}       % <--should be always the first line (see CONTRIBUTING)!
\begin{filecontents}[overwrite]{\jobname.cls}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{\jobname}
\LoadClassWithOptions{article}

\DeclareKeys[testwork]{%
  test .code  = \newcommand{\foo}{#1},
  test .usage = load,
  % the following three lines give an equivalent definition of your bertha
  % option as defined with `\DeclareOption{bertha}{}`
  bertha .code = {},
  bertha .value_forbidden:n = true,
  bertha .usage = load,
  % if you use this unknown handler, you get "test" and "bertha" as unknown
  % options, if you omit it you get "a4paper" as unknown option
  unknown .code = {}
}
\ProcessKeyOptions[testwork]

\endinput
\end{filecontents}
\documentclass[a4paper,test=wtf,bertha]{\jobname}

\begin{document}
test \foo
\end{document}

Log file (required) and possibly PDF file

mwe_unknownbug.log

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions