I'm a complete newbie but have a little background in programming. I've been looking at a MWE located here provided by Yiannis Lazarides.
In the macro definition, we have
%% add an image to the DB, use the LaTeX macro
%% \g@addto@macro to store them at the DB location
\def\addtoDB#1#2{%
\ifx\@empty#1
\g@addto@macro{#1}{#2}
\else
\g@addto@macro#1{,#2}
\fi
}
What is the difference between \g@addto@macro{#1}{#2}
and \g@addto@macro#1{,#2}
?
#1
is a macro name, that corresponds to the list to which some item has to be added.\@empty
would be compared to\g@addto@macro
, resulting in a disaster.