I have two Expl packages:
pkga.sty
and pkgb.sty
. Both accept boolean key hyper
. I want to nest pkgb
setup in pkga
, so can I pass hyper=true|false
from my document to pkga
, which in turn passes it to the pkgb
.The problem is that I am getting the error
when I try to use any method to pass value of boolean variable defined inKey 'pkgb/hyper' accepts boolean values only
pkga
to key hyper
in pkgb
.Here's the minimum (non) working example (EDIT: added
filecontents
usage):Code: Select all
\documentclass{article}
\begin{filecontents}[overwrite]{pkga.sty}
\ProvidesExplPackage{pkga}{2024-10-31}{0.0.1}{pkga}
\keys_define:nn { pkga } {
hyper .bool_set:N = \l_pkga_hyper_bool,
hyper .initial:n = true,
}
\ProcessKeyOptions
\RequirePackage[
% THESE ARE WORKING FINE:
% hyper=false,
% hyper={false},
% NONE OF THESE IS WORKING:
% hyper=\l_pkga_hyper_bool,
% hyper={\bool_to_str:N \l_pkga_hyper_bool},
hyper={\bool_if:NTF \l_pkga_hyper_bool {true} {false}},
]{pkgb}
\end{filecontents}
\begin{filecontents}[overwrite]{pkgb.sty}
\ProvidesExplPackage{pkgb}{2024-10-31}{0.0.1}{pkgb}
\keys_define:nn { pkgb } {
hyper .bool_set:N = \l_pkgb_hyper_bool,
hyper .initial:n = true,
}
\ProcessKeyOptions
\NewDocumentCommand{\mycommand}{ m }{
#1\\
\bool_if:NTF \l_pkgb_hyper_bool {Use~hyper}{Do~not~use~hyper}
}
\end{filecontents}
\usepackage[hyper=false]{pkga}
\begin{document}
\mycommand{Hello}
\end{document}
What I am doing wrong? Any help will be appreciated.
Regards,
Luke