titling package in beamer class gives error: “! Undefined control sequence. \if@titlepage”

Using the titling package for a beamer class document results in an error even for the simplest possible setup (see example below). I did not find any documentation that would rule out using titling in a beamer class document. My question thus is:

• Can you help me getting the titling package to work?

• If not, are there good alternatives to make commands like \thetitle, \theauthor, \thedate available in a beamer document?

Description: The following MWE

\documentclass[10pt]{beamer}
\usepackage{titling} %
%
\title{Some title}
\author{A.N. Author}
\date{Some Day}
%
\begin{document}
\frame{\titlepage}
\end{document}


results in an error

! Undefined control sequence.

l.35 \if@titlepage

While the same code compiles fine when the titling package is not loaded. It also runs fine with the titling package when using the article class.

I am using pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) and compile in TeXStudio.

• don't use this package with beamer. Beamer has its own commands and templates here. See e.g. 10.1 Adding a Title Page in the documentation, which points to \insertauthor etc. – Ulrike Fischer Aug 7 '19 at 9:44
• Thanks Ulrike Fischer! Your answer is indeed what I looked for. Would you post it as an answer such that I can accept it? – user1966337 Aug 8 '19 at 13:12

You don't need the titlingpackage here, since title, authoretc. can be used by default.

\documentclass[10pt]{beamer}
%
\title{Some title}
\subtitle{Some subtitle}
\author{A.N. Author}
\date{Some Day}
%
\begin{document}
\frame{\titlepage}
\end{document}


• Sorry, but you do not answer the question. I indicated clearly that I would like to use the commands \theauthor, \thetitle, ... from the titling package. I am editing above to highlight this part of the question as code as should have done from the beginning. – user1966337 Aug 8 '19 at 13:05