私はsapthesis
パッケージ。コマンド\examiner
(例: \examiner{Jon Doe}
) を介して複数の審査官を指定できます。少なくとも 1 人の審査官が指定されている場合は、最初の審査官の後に文字列 が追加されます(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
と が必要です。\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}
結果: