我正在尝试使用布尔声明选项将选项发送到样式文件

我正在尝试使用布尔声明选项将选项发送到样式文件

$Ok 尝试最少的例子:这是 doofus.tex

\documentclass[english]{letter}
\usepackage[T1]{fontenc}
\usepackage{color}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[epub]{doofus}
\usepackage{color}
\usepackage{ifthen}

\makeatother
\begin{document}
This is a test document for the the doofus boolean example;

Which one appears when I type $\doofus$?
\end{document}

以下是带有布尔声明选项的样式文件:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{doofus}%
[2014/01/01 v0.01a LaTeX doofus package]%\filedate\space\fileversion\space 
\typeout{Package doofus, \csname [email protected]\endcsname%
^^ Copyright (C) 2014 ^^J}

\RequirePackage{calc}
\RequirePackage{xkeyval}[2006/11/18]
\usepackage{ifthen}

\newboolean{@epubstate}
\setboolean{@epubstate}{false}
\DeclareOption{epub}{\setboolean{@epubstate}{true}}
\ProcessOptions%

\ifthenelse{\boolean{epubstate}}{\newcommand{\doofus}{\textcolor{black}{7\spadesuit}}}{\newcommand{\doofus}{\textcolor{red}{7\heartsuit}}}

以下是日志输出摘录:

! Undefined control sequence. \@gtempa ...ue \ifnum \@ne =\@ne \fi
\ifepubstate 
                                                  \relax \TE@setvaltrue \els... l.16 \ifthenelse{\boolean{epubstate}}
                                     {\newcommand{\doofus}{\textcolor{black}...

? X

相关内容