
아래 코드에서는 다음 줄만 원합니다.여기에 텍스트가 표시됩니다...라인에 주석을 달 때 출력에 남아 있습니다 \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