如何修改此條件語句以獲得所需的輸出?

如何修改此條件語句以獲得所需的輸出?

在下面的程式碼中,我只想要這一行文字在此...當我註釋該行時保留在輸出中\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
始終為 false,因為\articlehistory具有固定的非空定義

相關內容