
을 기반으로 문서 클래스를 만들고 있습니다 memoir
. 이를 위해 여러 클래스 옵션이 내 코드에 전달되도록 허용합니다. 인식되지 않는 옵션은 단순히 에 전달됩니다 memoir
.
a4paper
이제 내 질문은: 내 클래스의 사용자가 letterpaper
옵션으로 통과하더라도 어떻게 강제할 수 있습니까 ? 즉, 또는 같은 옵션을 전달할 수 있는 상태를 유지하면서 다른 문서 크기 옵션( letterpaper
, a5paper
, 등) 을 비활성화할 수 있습니까 ?ebook
ms
fleqn
답변1
나는 다음을 제안한다:
% declare options that should be passed to your code
% ...
% now specify which memoir options should not be used, using the following helper macro
\newcommand\warningoptionnotused@myclass
{%
\OptionNotUsed%
\ClassWarning{myclass}%
{%
Option '\CurrentOption'\space is incompatible with class
`myclass' and will be ignored.
}
}
\DeclareOption{letterpaper}{\warningoptionnotused@myclass}
\DeclareOption{a5paper}{\warningoptionnotused@myclass}
\DeclareOption{ebook}{\warningoptionnotused@myclass}
% do the same for all options that should be discarded...
% pass all other options to memoir
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
% process options
\ProcessOptions\relax
% then load memoir with the desired options
\LoadClass[a4paper]{memoir}