When I try to put in my package options with not yet defined macro (even if I use noexpand), the document fails to compile (even if I don't use the macro!). Any idea if it's fundamental or not? (I tried with kvoptions, but also with the regular system) Ideally I'd like to avoid \noexpand
but for now any solution is interesting!
MWE:
test.tex:
\documentclass{article}
\usepackage[conf={I would like to use not (yet) defined macro here}]{teststy}
% Uncommenting the following line produces errors:
% \usepackage[conf={The value is: \noexpand\number\noexpand\value{counterAllProofEnd}}]{teststy}
\begin{document}
\section{Options}
\show\pratendOptconf
\newcounter{counterAllProofEnd}
\pratendOptconf %% Should display "The value is: 0"
\stepcounter{counterAllProofEnd}
\pratendOptconf %% Should display 1 "The value is: 1"
\end{document}
teststy.sty:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{teststy}[2019/05/06 A test]
\RequirePackage{kvoptions}
%% https://tex.stackexchange.com/questions/109747/put-all-package-options-into-one-command
%% Forward the options list to the command \pratendOptdefconf
%% in order to use:
%% \usepackage[conf={normal}]{proofAtTheEnd}
\SetupKeyvalOptions{
family=pratendOpt,
prefix=pratendOpt,
}
\DeclareStringOption{conf}
\DeclareLocalOptions{conf}% \pratendOptdefconf contains the proof
\ProcessKeyvalOptions*
% \DeclareOption*{\PackageWarning{proofAtTheEnd}{Unknown}}
% \ProcessOptions\relax
\endinput