What does it do and what are its applications? I am currently testing the subtitle of my beamer presentation for its string length to decide about line spacings. Could it be simpler using \empty?
If I just try \empty{word}, it seems that nothing happens. Of course, I do not expect to get a string length, but I thought that I could check the title for being empty or not.
This is how I add space by checking beamer's subtitle:
\usepackage{xstring}
\StrLen{\insertsubtitle}[\subtitlelen]
\ifnum\subtitlelen>0{
\vskip0.2cm
}\fi
I try to clarify my question as requested in the comments: I thought that I could check for \empty. \StrLen is easy to understand because you can output that value as text. However, this does not work for \empty so I wondered how one would use it to accomplish the same task.
\let\empty\@emptyand earlier\def\@empty{}. So it is a macro without arguments that expands to nothing. – cgnieder Dec 01 '13 at 16:45\emptyand\@emptyto test whether an argument or another macro is empty ("string" length zero). There are also packages that do this and eTeX solutions that do this without using\[@]empty. The sequence\empty{word}is nothing special. In fact,{word}is not an argument here but simply the letterswordin a group since\emptydoesn't take an argument. What do you want to know? What\emptydoes? It does nothing, see the linked question. Do you want to know about string lengths? Check thexstringpackage ([tag:xstring]) or related questions on TeX.sx. – Qrrbrbirlbel Dec 01 '13 at 16:54