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

I got a new PC with Windows 10 Pro operating system several days ago and decided to install TeXstudio + MiKTeX.
And I faced a problem compiling LaTeX file. The problem is when I try to add \usepackage{hyperref} or code stuff similar to this line (more detailed in the code with the comment line % problem is here if I add this line) I get an error which says: Argument of � has an extra }. \end{document}.
My code:
\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{color}
\definecolor{Black}{rgb}{0,0,0}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line
\usepackage{xcolor}
\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
\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}
\begin{document}
Random text
${\mathcal {E}}=-{{d\Phi_{B}} \over dt},$ where
${\mathcal {E}}$ — random letter.
\end{document}
Error I get:
Error
When I try this code in OverLeaf or on my notebook or without hyperref packages - everything's fine. But I need this package if, for example, I'll have to add references...
Did someone face similar problem? Maybe I need to install some other packages?

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}

Related

Title page Errors

% Thesis master document
\documentclass[final,12pt,a4paper,oneside]{book}
\setcounter{secnumdepth}{3}
\textheight =24.2 cm
\textwidth =15 cm
\topmargin =-15mm
\usepackage[round]{natbib}
\usepackage{amssymb}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{bm}
\usepackage{layout}
\usepackage {mathrsfs}
\usepackage{listings}
\usepackage{float}
\def\hang{\hangindent\parindent}
\def\rf{\par\noindent\hang}
\newtheorem{defin}{Definition}
\newtheorem{theorem}{Theorem}
\newtheorem{result}{Result}
\begin{document}
\baselineskip = 18pt
\pagestyle{plain}
\frontmatter
\include{Title}
\maketitle
\tableofcontents
\listoftables
%\listoffigures
\include{Introduction}
\mainmatter
\include{Chapter1}
\include{Chapter2}
\include{Chapter3}
\include{Chapter4}
\include{Conclusion}
%\include{Appendix}
\backmatter
\include{Bibliography}
\end{document}
I've got the above code in my masterfile as part of my thesis due today. it has been executing properly until now. I accidently deleted the \maketitle command but when I put it back, it won't just execute. I get the error attached. I'm not sure if I placed it in wrongly this time. Can someone please help?

No control sequence/no counter subfigure#save defined

I am new to overleaf. I am getting first 'No control sequence' on \subfloat. Then I included \usepackage{subfig} which is causing this new error 'no counter subfigure#save defined' on the same line. Along with that after including this package I am also getting 'Undefined control sequence' on \begin{document}. Any idea how can I tackle this? I want to insert multiple figures and I read that \subfigures is outdated and I should include subfloat instead. I would really really appreciate any possible help. Thank you
screenshoot of error
These are the packages that are included :
\documentclass[a4paper, 12pt, oneside]{Thesis} % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn
\usepackage{subfig}
\usepackage{graphicx}
%\usepackage[dvipsnames]{xcolor}
\graphicspath{ {images/} }
\usepackage{amsmath}
% Include any extra LaTeX packages required
\usepackage[square, numbers, comma, sort&compress]{natbib} % Use the "Natbib" style for the references in the Bibliography
\usepackage{verbatim} % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector} % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
\hypersetup{urlcolor=red, colorlinks=false} % Colours hyperlinks in blue, but this can be distracting if there are many links.
\usepackage{longtable}
\usepackage[table]{xcolor}
\usepackage[textsize=tiny]{todonotes}
\newcommand{\dara}{\textsf{da\textbar ra}}
\usepackage{csquotes}
\usepackage{ctable}
\usepackage{titlesec}
\usepackage[most]{tcolorbox}
\usepackage{tikz-er2}
\usepackage{url}
\usepackage{paralist}
\usepackage{pifont}
\usepackage{adjustbox}
\usepackage[T1]{fontenc}
\usepackage[scaled=0.85]{beramono}
\usepackage{listings}
\usepackage{tikz}
\usepackage{3dplot}
\usepackage{framed}
\usepackage{tabularx}
\usepackage{hyperref}
\usepackage{todonotes}
\usepackage{comment}
\usepackage{pifont}
\usepackage{amssymb}
\setcounter{tocdepth}{3}
\usepackage{multirow}
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algorithmic}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepackage{eurosym} %<-- For EURO symbol
\usepackage{filecontents}
\usepackage{minted}
\usemintedstyle{monokai}
\usepackage{array}
% \usepackage{forest}
\usepackage[table]{xcolor}

Why am I getting "Argument of "?" has an extra } \end{titlepage}" when downloading overleaf project which compiles fine there [duplicate]

I got a new PC with Windows 10 Pro operating system several days ago and decided to install TeXstudio + MiKTeX.
And I faced a problem compiling LaTeX file. The problem is when I try to add \usepackage{hyperref} or code stuff similar to this line (more detailed in the code with the comment line % problem is here if I add this line) I get an error which says: Argument of � has an extra }. \end{document}.
My code:
\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{color}
\definecolor{Black}{rgb}{0,0,0}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line
\usepackage{xcolor}
\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
\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}
\begin{document}
Random text
${\mathcal {E}}=-{{d\Phi_{B}} \over dt},$ where
${\mathcal {E}}$ — random letter.
\end{document}
Error I get:
Error
When I try this code in OverLeaf or on my notebook or without hyperref packages - everything's fine. But I need this package if, for example, I'll have to add references...
Did someone face similar problem? Maybe I need to install some other packages?
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}

Argument of ? has an extra } [duplicate]

I got a new PC with Windows 10 Pro operating system several days ago and decided to install TeXstudio + MiKTeX.
And I faced a problem compiling LaTeX file. The problem is when I try to add \usepackage{hyperref} or code stuff similar to this line (more detailed in the code with the comment line % problem is here if I add this line) I get an error which says: Argument of � has an extra }. \end{document}.
My code:
\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{color}
\definecolor{Black}{rgb}{0,0,0}
\usepackage[unicode, colorlinks, linkcolor=Black]{hyperref} % problem is here if I add this line
\usepackage{xcolor}
\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
\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}
\begin{document}
Random text
${\mathcal {E}}=-{{d\Phi_{B}} \over dt},$ where
${\mathcal {E}}$ — random letter.
\end{document}
Error I get:
Error
When I try this code in OverLeaf or on my notebook or without hyperref packages - everything's fine. But I need this package if, for example, I'll have to add references...
Did someone face similar problem? Maybe I need to install some other packages?
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}

Lyx modifying moderncv empty space

I am new on latex and lyx. I have to realize a resume and used moderncv. Do you know how I can have the space behing my picture being reduced ? (The one hatched in red) . As everything is supposed to fit in one page with a cv, it is important for me.
Thanks for your help
%% LyX 2.3.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{float}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{xmpmulti}
\usepackage{enumitem}
\moderncvtheme[grey]{classic}
\firstname{John}
\familyname{Do}
\title{Title}
\address{adress}{city}
\mobile{+33 6 §§ §§ §§ §§}
\email{john.do#ens.psl.eu}
\photo[100pt]{Mii_Artwork.png}
\makeatother
\usepackage{babel}
\begin{document}
\maketitle
\section{Formation}
\cventry{2021/2022}{Master de Science cognitive}{Ecole normale supérieure rue d'Ulm}{Paris}{France}{}
\end{document}
Quick hack: add \vspace{-1.5cm} after \maketitle :
`
%% LyX 2.3.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{float}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{xmpmulti}
\usepackage{enumitem}
\moderncvtheme[grey]{classic}
\firstname{John}
\familyname{Do}
\title{Title}
\address{adress}{city}
\mobile{+33 6 §§ §§ §§ §§}
\email{john.do#ens.psl.eu}
\photo[100pt]{example-image}
\makeatother
\usepackage{babel}
\begin{document}
\maketitle
\vspace{-1.5cm}
\section{Formation}
\cventry{2021/2022}{Master de Science cognitive}{Ecole normale supérieure rue d'Ulm}{Paris}{France}{}
\end{document}

Resources