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