EDIT: Much shorter problem definition
Having defined a title by
\title[short]{long}
how can I later add something to the title? The simple assumption
\title[\insertshorttitle]{\inserttitle plus x}
obviously does not work due to recursion. I managed to get a version working using \expandafter with only the full title:
\expandafter\title\expandafter{\inserttitle plus x}
But so far I haven't found out how to also include the short title in this. Also, adding something before \inserttile does not seem to work either, only after inserttitle.
Original Question:
In our group, we are required to use a given beamer class for presentations. Unfortunately. the vertical placement of the title is bad for titles that use two lines. As we cannot modify the beamer class itself, we use a slightly dirty hack to move the title into an appropriate position with a vspace.
I would like to automate this hack and make it transparent to the other users. So far, I have come up with the following solution that can be included at the beginning of a presentation (as a package for example):
\newlength{\ITI@titleheight}
\newcommand{\ITI@computeheight}{...}
\newcommand{\ITI@titleoffset}{\vspace*{\ITI@titleheight}}
\g@addto@macro\beamer@lastminutepatches{\ITI@computeheight\expandafter\title\expandafter{\expandafter\ITI@titleoffset\inserttitle}}
Basically the following happens:
At the beginning of the beamer presentation, the macro \ITI@computeheight is expanded and computes an offset height \ITI@titleheight. I have left out the details of the macro as they are not important. Then, \title is redefined, basically only a \vspace command is added to the previous title.
My current problem is that with the redefinition of the title, the short title gets lost. And I have no clue how to correctly use \expandafter or other commands to make it work.
The following code works when using a predefined short title (1 in this case):
\g@addto@macro\beamer@lastminutepatches{\ITI@computeheight\expandafter\title\expandafter[\expandafter1\expandafter]\expandafter{\expandafter\ITI@titleoffset\inserttitle}}
But when actually using \insertshorttitle, Latex gets into an infinite loop as it wants to expand the new short title over and over again:
\g@addto@macro\beamer@lastminutepatches{\ITI@computeheight\expandafter\title\expandafter[\expandafter\insertshorttitle\expandafter]\expandafter{\expandafter\ITI@titleoffset\inserttitle}}