Open devangel77b opened 4 years ago
Please can you post an example?
\documentclass{article}
\usepackage[option1]{mwe}
\begin{document}
\checkMweOptions
\end{document}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mwe}[mwe testing for bug in etoolbox with DeclareOption]
\RequirePackage{etoolbox}
\newbool{booloption0}
\newbool{booloption1}
\newbool{booloption2}
\DeclareOption{option0}{\booltrue{booloption0}}
\DeclareOption{option1}{\booltrue{booloption1}}
\DeclareOption{option2}{\booltrue{booloption2}}
\ExecuteOptions{}
\ProcessOptions\relax
\newcommand{\checkMweOptions}{
\ifbool{booloption0}{option0}{notoption0}
\ifbool{booloption1}{option1}{notoption1}
\ifbool{booloption2}{option2}{notoption2}
}
Hmmm now the MWE is working. It's something with my installation or a side effect with something else I am using in my actual files. Sorry to have bothered you.
Is there any known reason I wouldhave to also do \documentclass[option1]{article}
to get the booleans to be set correctly during options processing?
I'm not sure what you mean
@devangel77b article
is one of the standard classes, hence normally you cannot add new class options to it. Instead, you can define your own document class based on article
.
Not sure if this is a bug; has anyone else seen problems when using booltrue+DeclareOption, and ifbool... seeing that the booleans are not being set? I have not yet been able to tell if it is an issue with options or with booleans in etoolbox; when done on their own in a simple article with no options etoolbox booleans seem to work correctly, but when done within options declared in a package they seem not to be set.