[Tex/LaTex] Hypersetup environment warnings

hyperrefsubscriptstitleswarnings

This is my title page of my thesis and the code is as below

\documentclass{article}
\begin{document}
\hypersetup{
pdftitle={properties of F\textsubscript{2}},
pdfauthor={xxx},
pdfsubject={Masterthesis},
pdfkeywords={Master Thesis},
pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false} 
\end{document}

I get six warnings as below for using a subscript in this hypersetup environment. Is it the subscript causing the warning or something else? Could someone help me understand this better? Thank you.

Package hyperref Warning: Token not allowed in a PDF string
(PDFDocEncoding): (hyperref) removing '\mathsurround'
on input line.

Package hyperref Warning: Token not allowed in a PDF
string (PDFDocEncoding): (hyperref) removing '\z@' on
input line.

Package hyperref Warning: Token not allowed in a PDF
string (PDFDocEncoding): (hyperref) removing
'subscript' on input line.

Package hyperref Info: Option
'pdfnewwindow' set 'true' on input line.

Package hyperref Info: Option
'plainpages' set 'false' on input line.

Best Answer

I doubt your example compiles (no \usepackage{hyperref}).

Anyway, the following works without warnings:

\documentclass{article}
\usepackage{hyperref}

\hypersetup{
  pdftitle={\texorpdfstring{Properties of F\textsubscript{2}}{Properties of F2}},
  pdfauthor={xxx},
  pdfsubject={Masterthesis},
  pdfkeywords={Master Thesis},
  pdfpagelayout=OneColumn,
  pdfnewwindow=true,
  pdfstartview=XYZ,
  plainpages=false}

\begin{document}
Blah.
\end{document}

Explanation: text strings for PDF metadata can't contain fancy TeX markup. hyperref's \texorpdfstring command allows one to specify two versions of a given string: the first argument may contain (La)TeX markup and is used for typesetting, whereas the second argument is used when the string is embedded as PDF metadata (title, author, subject, etc.)

Related Question