3

After adding bookmark:

\usepackage[ruled,linesnumbered]{algorithm2e}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{breqn}
\usepackage{cleveref}
\usepackage{cite}

\usepackage[bookmarks=true]{hyperref}
\usepackage{bookmark}

to my document, I receive warnings for 1) citing within subsubsection title, and 2) with all my equation citations which change to (??).

I'm using a specific documentclass of my school for writing my document. The 2 types of warnings are as follows:

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

2) LaTeX Warning: Reference `eq:something' on page x undefined on input line y.

How should I resolve the problem(s)?

Thank you

Elnaz
  • 1,427

1 Answers1

2

The problem with \cite in sectional titles can be solved by adding

\makeatletter
\pdfstringdefDisableCommands{\let\cite\@gobble}
\makeatother

to the document preamble (you lose the reference, but you wouldn't get it anyway, because in bookmarks macros cannot perform assignments, which are necessary for \cite to work). If you like to see the citation key, change

\let\cite\@gobble

into

\renewcommand{\cite}[1]{[#1]}

The second issue is due to cleveref being loaded before hyperref.

egreg
  • 1,121,712
  • Thank you. It resolved my problem. On the first issue: I have the reference in subtitle with \let\cite@gobble. – Elnaz Feb 20 '16 at 00:50
  • 2
    @Elnaz The hyperref package does a good job in redefining common commands so that they can give an approximate representation in bookmarks, but doesn't tackle \cite; a different solution could be \texorpdfstring{~\cite{key}}{} in the title. – egreg Feb 20 '16 at 00:57