0
\documentclass[12pt,reqno,a4paper]{amsart}
\usepackage{extsizes}
\usepackage{blindtext}
\textheight 9.3in \textwidth 6.5in
\calclayout
\usepackage{mathtools}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\usepackage{hyperref}
\usepackage{mathrsfs}
\usepackage[all]{xy}
\usepackage[normalem]{ulem}
\newtheorem{lemma}{Lemma}[subsection]
\newtheorem*{question}{Question}
\theoremstyle{definition}
\newcommand{\mc}{\mathcal}
\newcommand{\mf}{\mathfrak}
\newtheorem*{solution}{Solution}
\newtheorem{definition}{Definition}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{exercise}{Exercise} 
\newtheorem{example}{Example}[section]
\usepackage{tikz-cd}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{datetime}
% \renewcommand{\baselinestretch}{2} 
\usepackage{color}
\pagestyle{myheadings}
\newcommand{\xra}{\xrightarrow}
\newcommand{\ra}{\rightarrow}
\title{A}
\author{B} 

\begin{document}
    \today
\begin{abstract}

\end{abstract} 

\maketitle 
\tableofcontents 
\section{asdsd}
\subsection{A $p\colon \underline{X}\ra \mc{D}$B} 

\end{document}

When I do not run \tableofcontents, I see no problem. If I run \tableofcontents, I see

line 3: Missing $ inserted. ...htarrow \mathcal {D}$B}}{2}{subsection.1.1}
line 3: Missing $ inserted. ...htarrow \mathcal {D}$B}}{2}{subsection.1.1}
: It is better to use one of the extsizes classes, if you can.
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `math shift'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\mskip'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\mathpunct'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\nonscript'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\mkern'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\thinmuskip'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\mskip'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `math shift'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\@@underline'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\hbox'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\mathsurround'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\z@'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `math shift'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\rightarrow'
line 48: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `math shift'
: Label(s) may have changed. Rerun to get cross-references right.

In above, first two came as errors in red font. It is mentioned as file document.toc Third is as a warning. It is mentioned as file extsizes.sty

Everything else came as warnings in the file document.tex

1 Answers1

1

The error is caused by using \underline in the subsection title, it can be solved by adding \protect in front of it. In addition all the warnings about Token not allowed in a PDF string can be avoided by providing an alternative text for the bookmarks:

\documentclass[12pt,reqno,a4paper]{amsart}
\usepackage{extsizes}
\usepackage{blindtext}
\textheight 9.3in \textwidth 6.5in
\calclayout
\usepackage{mathtools}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\usepackage{hyperref}
\usepackage{mathrsfs}
\usepackage[all]{xy}
\usepackage[normalem]{ulem}
\newtheorem{lemma}{Lemma}[subsection]
\newtheorem*{question}{Question}
\theoremstyle{definition}
\newcommand{\mc}{\mathcal}
\newcommand{\mf}{\mathfrak}
\newtheorem*{solution}{Solution}
\newtheorem{definition}{Definition}[section]
\newtheorem{remark}{Remark}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{exercise}{Exercise} 
\newtheorem{example}{Example}[section]
\usepackage{tikz-cd}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{datetime}
% \renewcommand{\baselinestretch}{2} 
\usepackage{color}
\pagestyle{myheadings}
\newcommand{\xra}{\xrightarrow}
\newcommand{\ra}{\rightarrow}
\title{A}
\author{B} 

\begin{document}
    \today
\begin{abstract}

\end{abstract} 

\maketitle 
\tableofcontents 
\section{asdsd}
\subsection{A \texorpdfstring{$p\colon \protect\underline{X} \ra \mc{D} $}{alternative text for bookmarks}B} 

\end{document}
  • Thank you. I do not understand what is a bookmark? – Praphulla Koushik Apr 30 '19 at 04:37
  • @PraphullaKoushik Bookmarks are the what your pdfviewers shows at the left besides the actual document where you can navigate between the different sections. This stuff: https://helpx.adobe.com/acrobat/using/page-thumbnails-bookmarks-pdfs/_jcr_content/main-pars/image_1.img.png/ed03.png –  Apr 30 '19 at 12:21