我正在使用sapthesis
包裹。它允許透過命令指示多個檢查員\examiner
(例如\examiner{Jon Doe}
)。如果至少指定了一名審查員,則在第一個審查員之後附加字串(chairman)
。
因為我沒有主席,所以我需要去掉那根繩子。
這是一個最小的可重現範例:
\documentclass[a4paper,english,binding=0.6cm]{sapthesis}
\newcommand{\thesistitle}{XYZ}
\newcommand{\myname}{XXX}
\title{\thesistitle}
\author{\myname}
\IDnumber{XXX}
\course{XXX}
\courseorganizer{XXX}
\AcademicYear{XXX}
\advisor{XXX}
\authoremail{X@Y}
\copyyear{XXX}
\examdate{MY DATE}
\examiner{Jon Doe}
\examiner{Mary Smith}
\begin{document}
\frontmatter
\maketitle
\mainmatter
\end{document}
答案1
您可以在 中找到原始定義sapthesis.cls
,例如https://ctan.org/tex-archive/macros/latex/contrib/sapthesis或在本地 LaTeX 安裝目錄中。在第 320 行,我們找到以下程式碼:
\newcommand{\examiner}[2][]{%
\ifnum\SAP@examinercount=\z@
\SAP@examinertoks={#2 (\SAP@chairman\if|#1|\relax\else, #1\fi)}%
\else
\SAP@examinertoks=\expandafter{\the\SAP@examinertoks\\[0.75mm]#2 \if|#1|\relax\else (#1)\fi}%
\fi
\advance\SAP@examinercount\@ne}
您可以看到 ifnum-else 結構:如果目前考官計數器為零 ( \z@
),則列印 (主席)。
為了簡化,您可以刪除整個 if-else 並將 else 的主體保留為預設值。
要將此變更放入文件中,您需要\renewcommand
而不是\newcommand
,否則您將收到錯誤訊息,指出您嘗試定義的命令已存在。
@
另外,由於指令定義中有符號,需要對\makeatletter
and\makeatother
進行重新定義。
代碼:
\documentclass[a4paper,english,binding=0.6cm]{sapthesis}
\newcommand{\thesistitle}{XYZ}
\newcommand{\myname}{XXX}
\title{\thesistitle}
\author{\myname}
\IDnumber{XXX}
\course{XXX}
\courseorganizer{XXX}
\AcademicYear{XXX}
\advisor{XXX}
\authoremail{X@Y}
\copyyear{XXX}
% adapted from original definition at sapthesis.cls line 320
\makeatletter
\renewcommand{\examiner}[2][]{%
\SAP@examinertoks=\expandafter{\the\SAP@examinertoks\\[0.75mm]#2 \if|#1|\relax\else (#1)\fi}%
\advance\SAP@examinercount\@ne}
\makeatother
\examdate{MY DATE}
\examiner{Jon Doe}
\examiner{Mary Smith}
\begin{document}
\frontmatter
\maketitle
\mainmatter
\end{document}
結果: