I have to check if the \author{} macro is empty because the output should change if this condition is set.
There are two ways the author can be empty:
\author{}- No
\author{}command in the document.
I tried with the \ifdefempty{\macro}{<true>}{<false>} command of etoolbox, which works fine for self defined macros like \def\testmacro{foo}, but for \author it always results on false.
How could I test if an author is set and then modify the output based on the result of this check? (The check should work as the \ifdefempty command)
\author{Me}command essentially does\def\@author{Me}, so you need to test\@authorfor emptiness. Beware that some classes initialize\@authorto be something else than empty. – egreg Sep 13 '17 at 15:12\author{}, nothing is printed, even though\@authoris probably not empty (as it also evaluates as false). I want to check if there is a content that is also printed on the page. – Sam Sep 13 '17 at 15:16\@authoris not initialized to empty. – egreg Sep 13 '17 at 15:18\show\@authorthen tex will stop (as for an error) and show you what the initial definition is with the class you are using – David Carlisle Sep 13 '17 at 15:19\makeat*commands. I now tried with them and it works, so could you please tell me what those do? I never got it. They seem to be pretty important. – Sam Sep 13 '17 at 15:23@character in the document so you can access the\@authorcommand (the idea being that this is a special command that would normally only be used in a class or package file). – musarithmia Sep 13 '17 at 15:24\makeatletterand\makeatotherdo? – egreg Sep 13 '17 at 15:28