如题,求解决方案,部分代码如下
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{textbook}
\RequirePackage{kvoptions}%设置键和键值
\RequirePackage{etoolbox}%提供自定义封面选项接口
\SetupKeyvalOptions{family=TextBook,prefix=TextBook@,setkeys=\kvsetkeys}
\newcommand{\ekv}[1]{\kvsetkeys{TextBook}{#1}}
%%声明颜色键及默认值%%
\DeclareStringOption[BLUE]{color}
%%声明答案键及默认值%%
\DeclareStringOption[true]{answer}
%%设置颜色键%%
\DeclareVoidOption{BLUE}{\ekv{color=BLUE}}
\DeclareVoidOption{GREEN}{\ekv{color=GREEN}}
\DeclareVoidOption{RED}{\ekv{color=RED}}
\DeclareVoidOption{PURPLE}{\ekv{color=PURPLE}}
%%设置答案键%%
\DeclareVoidOption{true}{\ekv{answer=true}}
\DeclareVoidOption{false}{\ekv{answer=false}}
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessKeyvalOptions*\relax
\LoadClass[12pt]{book}