2

My following Beamer script encounters an error of package hyperref warning: Token not allowed in a PDF string (Unicode): removing `\' on input line 8. What should I do if I want to create the attached titlepage without facing this error? Thank you!

\documentclass{beamer}
\usetheme{Madrid}

%Information to be included in the title page:

\title{Euclidean Geometry}

\author[Sukardi]{Shane Silverberg \\ NIM. 24622006 \\ Bandung Institute of Technology} %line8
\date[]{Tanggal 31 Agustus 2022}
\begin{document}
\frame{\titlepage}
\end{document}

enter image description here

1 Answer 1

5

To be precise, that's not an error, it's a warning. It's actually pretty harmless in this case, and you could just ignore it.

However if it bothers you for some reason, the reason you're getting it is that the pdf metadata cannot have linebreaks in it in the "Author" field. You can use the command \texorpdfstring to insert one thing in the document (first argument) and another thing in the PDF metadata (second argument). For example, you might just put your name there:

\documentclass{beamer}
\usetheme{Madrid}

%Information to be included in the title page:

\title{Euclidean Geometry}

\author[Sukardi]{\texorpdfstring{Shane Silverberg \\ NIM. 24622006 \\ Bandung Institute of Technology}{Shane Silverberg}}
\date[]{Tanggal 31 Agustus 2022}
\begin{document}
\frame{\titlepage}
\end{document}

(Or you could put the rest of the info, separated by commas or something else.)

Another way around this is to use beamer's \institute command, which is arguably more appropriate here:

\documentclass{beamer}
\usetheme{Madrid}

%Information to be included in the title page:

\title{Euclidean Geometry}

\author[Sukardi]{Shane Silverberg}
\institute{NIM. 24622006 \\ Bandung Institute of Technology}
\date[]{Tanggal 31 Agustus 2022}
\begin{document}
\frame{\titlepage}
\end{document}

(But that will look very slightly different from the original unless you change some settings in the theme.)

You must log in to answer this question.

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