jolars / moloch

A LaTeX Beamer theme, forked from the metropolis theme
https://ctan.org/pkg/moloch
Creative Commons Attribution Share Alike 4.0 International
89 stars 5 forks source link

Missing author names on title page if shortauthor is empty #11

Closed samcarter closed 8 months ago

samcarter commented 8 months ago

Currently, your titlepage uses the following test for author names:

    %    \end{macrocode}
    %
    % Beamer's definition of |\insertauthor| is always nonempty, so we have
    % to test another macro initialized by |\author{...}| to see if the user has
    % defined an author. This solution was suggested by Enrico Gregorio in an
    % answer to \href{https://tex.stackexchange.com/questions/241306/}{this
    % Stack Exchange question}.
    %
    %    \begin{macrocode}
    \ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi

This will cause author names to be missing on the title page if the short author is empty, e.g. \author[]{Name}.

Beamer now uses something like this:

https://github.com/josephwright/beamer/blob/1b04c51a596a51530adeff278ca2c43aa963c9b1/base/themes/inner/beamerinnerthemeinmargin.sty#L68-L74

So in your case:

\documentclass{beamer}
\usetheme{moloch}

\author[]{names}

\makeatletter
\setbeamertemplate{title page}{
  \begin{minipage}[b][\textheight]{\textwidth}
    \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
    \vfill%
    \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
    \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
    \usebeamertemplate*{title separator}
    \expandafter\ifblank\expandafter{\beamer@andstripped}{}{%
      \usebeamertemplate*{author}%
    }
    \ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
    \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
    \vfill
    \null
  \end{minipage}% <- missing %
}
\makeatother

\begin{document}

\maketitle

\end{document}

(note: this new test caused a problem if combined with the usepdftitle=false class option. This has since been fixed in the beamer dev version, but it is not yet released to ctan, it should be included in beamer v3.72 or newer)

jolars commented 8 months ago

Thanks for the report!