# pdf meta data and title bar of pdf viewer

A convenient way to include a picture in the title page of a beamer document is to use \includegraphics inside the title environment. The drawback is that the filename of the document that shows up in the titlebar of some pdf readers includes also the filename of the picture and some positioning commands.

E.g., for the minimal working example

\documentclass{beamer}

\title{\hspace{-0.5cm} \includegraphics[width=0.1\textwidth]{pdflogo.pdf}\\ \hspace{0.5cm}\\ \large My Custom Title}
\author{Me}
\date

\begin{document}

\frame{\titlepage}

\end{document}


the result is (in Okular under Debian Linux)

As the Okular handbook writes (on p. 30) "Display document title in titlebar if available. Whether to show the current document title in the titlebar of Okular window. If no meta-data for title found in the document or this item is unchecked Okular shows filename of the document." I believe this is an issue with the meta-data.

However, changing the metadata via hyperref with

\usepackage{hyperref}
\hypersetup{
pdftitle={My Custom Title}
}


or pdfinfo with

\pdfinfo{/Title (My Custom Title)}


or adding a short title with

\title[My Custom Title]{\hspace{-0.5cm} \includegraphics[width=0.1\textwidth]{pdflogo.pdf}\\ \hspace{0.5cm}\\ \large My Custom Title}


does not solve the problem.

Question: Is there a way to change the metadata in a way that one can customize the titlebar entry of the pdf viewer (if taken from metadata)?

Note that this issue does not show up at most pdf viewers as they just use the filename in the titlepage (e.g, Acrobat reader under Windows or Mac, Sumatra under Windows). However, it does not seem to be Okular specific, as I could reproduce it with other viewers/programs (e.g., Evince and Gimp on Debian Linux).

Instead of spending time getting around the side effects from misusing the \title command you should better define your own title page template:

\documentclass{beamer}

\title{My Custom Title}
\titlegraphic{\includegraphics[height=1cm]{example-image-A}}
\author{Me}
\date{\today}

\defbeamertemplate{title page}{mystyle}[1][]
{
\vbox{}
\vfill
\begingroup
\centering
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\vskip1em
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}%
\endgroup
\vfill
}

\setbeamertemplate{title page}[mystyle]

\begin{document}

\frame{\titlepage}

\end{document}


Instead of the combo \defbeamertemplate + \setbeamertemplate you can use \defbeamertemplate* which will activate the new template directly.

As mentioned in this answer, you can pass option usepdftitle=false to beamer (\documentclass[usepdftitle=false,...]{beamer}). After that, \hypersetup{pdftitle=foo} should work as intended.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7699825167655945, "perplexity": 5948.324357323838}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560628000575.75/warc/CC-MAIN-20190626214837-20190627000837-00391.warc.gz"}