2

Here is an ECM:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\title{TWO PROBLEMS
 {\begin{tikzpicture}
  \path [decorate,decoration={text along path, text={around the}}]
   (0,0) sin (1,1) cos (2,0);
  \end{tikzpicture}}}

\begin{document}
  \begin{frame} \titlepage \end{frame}
\end{document}

This code gives me what I want, expect that the compiler shouts at me:

Use of \begin doesn't match its definition.
\inserttitle ->TWO PROBLEMS {\begin {
                                     tikzpicture}

Can anyone tell me how to mend this glitch? Thanks in advance! O.

1

1 Answer 1

6

The title is not only used on the title page, but also in other places, such as the pdf meta data. Your hack to add the tikzpicture to the title page collides with this usage.

I suggest to insert the image via the \titlegraphic{} macro, this is normally printed at the bottom of the title page, but if you would like it below the title, you could redefine the titlepage as following:

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\title{TWO PROBLEMS}

\titlegraphic{  \begin{tikzpicture}
    \path [decorate,decoration={text along path, text={around the}}]
     (0,0) sin (1,1) cos (2,0);
    \end{tikzpicture}}

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

\begin{document}
  \begin{frame} 
        \titlepage
   \end{frame}
\end{document}

enter image description here


A simpler approach, thankfully pointed out by @marmot, could be to use \titlegraphic{} together with absolute positioning on the page. This could save you from redefining the titlepage (if there is enough room for the image).

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\title{TWO PROBLEMS}

\titlegraphic{%
    \begin{tikzpicture}[overlay,remember picture] 
        \path [decorate,decoration={text along path, text={around the}}, shift={(current page.center)}] (0,0) sin (1,1) cos (2,0);
    \end{tikzpicture}
}


\begin{document}
    \begin{frame} 
        \titlepage
    \end{frame}
\end{document}
5
  • 1
    Perhaps add \titlegraphic{ \begin{tikzpicture}[overlay,remember picture] \path [decorate,decoration={text along path, text={around the}}, shift={(current page.center)}] (0,0) sin (1,1) cos (2,0); \end{tikzpicture}} as an alternative? You could then drop the stuff between \makeatletter and \makeatother altogether.
    – user121799
    Aug 8, 2018 at 15:09
  • 1
    @marmot Good thinking! Are you sure you don't want to add this as an answer yourself? This so much easier than my title page redefinition... Aug 8, 2018 at 15:13
  • 1
    Yes, I am sure I don't want to post an answer myself. This method is really just an alternative that works in that particular case. If the graphics is too large or the page layout is different, it won't work since it is an overlay.
    – user121799
    Aug 8, 2018 at 15:15
  • 1
    @marmot Done - thanks again for the idea! Aug 8, 2018 at 15:24
  • I had the dilemma that I needed the titlegraphic for something else. But this problem can be swithout overlays using a construction like \titlegraphic{\vspace*{-13em}<put your tikz title here>\\\vspace*{13em}\includegraphics{<actual title graphic>}}.
    – Ubiquitous
    Nov 13, 2018 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .