LaTeX | hyperref error | Argument of � has an extra }. \end{document}

A quote from the hyperref maintainer:

But I would recommend to drop utf8x/ucs. Most improvements in the handling of utf8 which e.g. allow you to use them in \labels and filenames are undone by utf8x/ucs.

If the ucs package and utf8x inputenc option is removed, your code compiles.


  • Furthermore you should remove the pdftex from graphicx. It will automatically choose the best suited option to match your compilation chain.

  • You should also not load the same package multiple times, in particular not with different options

  • And load hyperref after the other packages (there are only very view exceptions)

  • No need to load color if you also load xcolor


\documentclass[10pt,a4paper]{report}
\usepackage{cmap}
\usepackage{setspace}
\onehalfspacing
\usepackage{multicol}
\usepackage{textcomp}
\usepackage{verbatim}
\usepackage{floatrow,calc}
\DeclareFloatSeparators{mysep}{\hspace{3cm}}
\thisfloatsetup{floatrowsep=mysep}
%\usepackage{ucs}
\usepackage[
%pdftex
]{graphicx}
\usepackage{epstopdf}
\usepackage{amssymb,amsmath}
\DeclareGraphicsExtensions{.pdf, .png, .jpg}
\usepackage[labelsep=period]{caption}
%\usepackage[utf8x]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[russian, english]{babel}
\usepackage[left=3cm, right=1.5cm, top=1.5cm, bottom=2cm]{geometry}
\usepackage{indentfirst}
\usepackage{xcolor}
\definecolor{Black}{rgb}{0,0,0}

\fontfamily{ptm}
\parindent=1cm
\sloppy
\bibliographystyle{unsrt}
%\usepackage{hyperref} % problem is here if I add this line

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{\leftmark}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{1pt}

\usepackage{subfig}

\usepackage{epigraph} %%% to make inspirational quotes.

\usepackage{amsfonts}
%\usepackage{xcolor}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line

\definecolor{linkcolor}{HTML}{000000}
\definecolor{urlcolor}{HTML}{000000}
\hypersetup{pdfstartview=FitH, linkcolor=linkcolor, urlcolor=urlcolor, colorlinks=True} % problem is here if I add this line


\begin{document}

Random text
    
${\mathcal {E}}=-\frac{{d\Phi_{B}} }{ dt},$ where

${\mathcal {E}}$ — random letter.   

\end{document}

Leave a Comment