在下面的代码中,我只想要这一行此处输入文字...当我注释该行时保留在输出中\articlehistory{Physics}{07/06/2022}{28/06/2022}
。我该怎么做?
\documentclass{article}
\newcommand{\articlehistory}[3]{%
\def\type{#1}%
\def\recieved{#2}%
\def\accepted{#3}%
}
\makeatletter
\let\type=\@empty
\let\recieved=\@empty
\let\accepted=\@empty
\def\@setarticlehistory{%
Article type: \type;
Recieved: \recieved;
Accepted: \accepted.
}
\makeatother
\articlehistory{Physics}{07/06/2022}{28/06/2022}
\begin{document}
Text goes here...
\makeatletter
\ifx\@empty\articlehistory\else\@setarticlehistory\fi
\makeatother
\end{document}
答案1
你要
\ifx\@empty\accepted
因为它是具有条件定义的三个内部命令,所以
\ifx\@empty\articlehistory
始终为假,因为\articlehistory
具有固定的非空定义