tex Error: While including includegraphics - latex

I am getting the following error while compiling my .tex document:
! Argument of \#tempa has an extra }.<inserted text>\par \maketitle
I am using texstudio on macos and using miktex.
\documentclass
[a4paper, 12pt, oneside]{Thesis}
\graphicspath{Figures/}
\usepackage{graphicx}
\begin{document}
\frontmatter
\title {\vspace{+1cm}{\includegraphics[width=30mm]{logo.pdf}}\\
\vspace{+1cm}
test}
\authors {\texorpdfstring
{\href{ibrar.ahmad#gmail.com}{Ibrar Ahmed}}
{Ibrar Ahmed}
}
\addresses {\group\\\deptname\\\univname}
\maketitle
\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?

LaTeX Error: Option clash for package hyperref

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{import}
% links Symbol
\usepackage{bbding,pifont}
\usepackage[hidelinks]{hyperref}
% Redefinition:
\let\orighref\href
\newcommand{\hrefa}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{...code}{#1}}
\newcommand{\hrefb}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{xxx/}{#1}}
\newcommand{\hrefc}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{ccc}{#1}}
\newcommand{\hrefd}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv/}{#1}}
\newcommand{\hrefe}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv}{#1}}
\newcommand{\hreff}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv}{#1}}
% end links symbol
% personal data
\name{...}
\title{}
\address{..}{}{}
\phone[mobile]{+...4}
\email{xxx#a.com}
\extrainfo{\hrefd{xc.com}}
%\photo[64pt][0.4pt]{photo.jpg}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
Error:
LaTeX Error: Option clash for package hyperref.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.40 \begin{document}
The package hyperref has already been loaded with options:
[hidelinks]
There has now been an attempt to load it with options
[unicode]
Adding the global options:
hidelinks,unicode
to your \documentclass declaration may fix this.
Try typing <return> to proceed.
when i try to convert to pdf, i get an empty html file.
The moderncv class automatically loads the hyperref package. You can use \PassOptionsToPackage{hidelinks}{hyperref} to make sure it is loaded with the options you want.
(although your hidelinks option won't make a big difference because moderncv sets the line width of the link boxes to zero, so they are already invisible)
\PassOptionsToPackage{hidelinks}{hyperref}
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\usepackage{graphicx}
\usepackage{float}
\usepackage{import}
% links Symbol
\usepackage{bbding,pifont}
% personal data
\name{...}
\title{}
\address{..}{}{}
\phone[mobile]{+...4}
\email{xxx#a.com}
%\extrainfo{\hrefd{xc.com}}
%\photo[64pt][0.4pt]{photo.jpg}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
test
\url{stackoverflow.com}
\end{document}

*** (job aborted, no legal \end found) error in LaTex

I'm having an issue with LaTex.
I'm using Overleaf to ellaborate my thesis document, and when I try to compile it, I get this error:
<*> Preambulo.tex
*** (job aborted, no legal \end found)
I've seen other questions related to this issue, but none of them was helpful. The error seems to be in my Preambulo.tex file, which is a preamble that is supposed to include all the document settings. This is what my Preambulo.tex file looks like:
\documentclass[a4paper,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english,spanish,es-lcroman]{babel}
\usepackage{bookman}
\decimalpoint
\usepackage{graphicx}
\usepackage{amsfonts,amsgen,amsmath,amssymb}
\usepackage[top=3cm, bottom=3cm, right=2.54cm, left=2.54cm]{geometry}
\usepackage{afterpage}
\usepackage{colortbl,longtable}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{pdfpages}
\usepackage{url}
\usepackage[stable]{footmisc}
\usepackage{parskip} % para separar párrafos con espacio.
\usepackage{hyperref}
%%-----------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}
\setlength{\headheight}{1.5\headheight}
\cfoot{\thepage}
\addto\captionsspanish{ \renewcommand{\contentsname}
{Tabla de contenidos} }
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\renewcommand{\chaptermark}[1]{\markboth{\textbf{#1}}{}}
\renewcommand{\sectionmark}[1]{\markright{\textbf{\thesection. #1}}}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\newcommand{\bigrule}{\titlerule[0.5mm]}
\usepackage{appendix}
\renewcommand{\appendixname}{Anexos}
\renewcommand{\appendixtocname}{Anexos}
%\renewcommand{\appendixpagename}{Anexos}
%%-----------------------------------------------
%% Páginas en blanco sin cabecera:
%%-----------------------------------------------
\usepackage{dcolumn}
\newcolumntype{.}{D{.}{\esperiod}{-1}}
\makeatletter
\addto\shorthandsspanish{\let\esperiod\es#period#code}
\def\clearpage{
\ifvmode
\ifnum \#dbltopnum =\m#ne
\ifdim \pagetotal <\topskip
\hbox{}
\fi
\fi
\fi
\newpage
\thispagestyle{empty}
\write\m#ne{}
\vbox{}
\penalty -\#Mi
}
\makeatother
%%-----------------------------------------------
%% Estilos código de lenguajes: Consola, C, C++ y Python
%%-----------------------------------------------
\usepackage{color}
\definecolor{gray97}{gray}{.97}
\definecolor{gray75}{gray}{.75}
\definecolor{gray45}{gray}{.45}
\usepackage{listings}
\lstset{ frame=Ltb,
framerule=0pt,
aboveskip=0.5cm,
framextopmargin=3pt,
framexbottommargin=3pt,
framexleftmargin=0.4cm,
framesep=0pt,
rulesep=.4pt,
backgroundcolor=\color{gray97},
rulesepcolor=\color{black},
%
stringstyle=\ttfamily,
showstringspaces = false,
basicstyle=\scriptsize\ttfamily,
commentstyle=\color{gray45},
keywordstyle=\bfseries,
%
numbers=left,
numbersep=6pt,
numberstyle=\tiny,
numberfirstline = false,
breaklines=true,
}
\lstnewenvironment{listing}[1][]
{\lstset{#1}\pagebreak[0]}{\pagebreak[0]}
\lstdefinestyle{consola}
{basicstyle=\scriptsize\bf\ttfamily,
backgroundcolor=\color{gray75},
}
\lstdefinestyle{CodigoC}
{basicstyle=\scriptsize,
frame=single,
language=C,
numbers=left
}
\lstdefinestyle{CodigoC++}
{basicstyle=\small,
frame=single,
backgroundcolor=\color{gray75},
language=C++,
numbers=left
}
\lstdefinestyle{Python}
{language=Python,
}
\makeatother
Does anyone know how to fix this issue? Thank you very much in advance.
For anyone interested on this problem, the issue seems to be that the main file selected in my overleaf project was wrong: it was Preamble.tex instead of main.tex
I went to the menu in the upper left corner of the page and changed the main file to main.tex. Now it works fine.
I received the same error because I was trying to compile my settings.tex file (which similarly lists all my document settings) instead of compiling my main.tex file. Make sure you are compiling the correct document.

Latex chapter refrencing giving the last chapter last section reference

I have a problem referencing a chapter. I used a label bellow each title however, it is not giving the right reference. I tried some fixes but it did not work (nameref, varioref, cleveref)
my latex code is as follows
\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[french,arabic,english]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\graphicspath{{images/}}
\usepackage{float}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{arabtex}
\usepackage{multirow}
\usepackage{threeparttable}
\usepackage{utf8}
\usepackage{longtable}
\usepackage{url}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{breakcites}
\usepackage{hhline}
\usepackage{xcolor}
\usepackage{colortbl}
%\usepackage{asect}
\usepackage{tocbibind}
\usepackage{tocloft}
\usepackage{acro}
\input{annexes/abreviations}
\usepackage[colorlinks]{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
citecolor=violet
}
% ref packages
\usepackage{nameref}
% folowing must be in this order
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\input{chapters/chap1.tex}
\input{chapters/chap2.tex}
\input{chapters/chap3.tex}
\input{chapters/chap4.tex}
\bibliographystyle{apalike}
\bibliography{bibliography}
\end{document}
in chapter 1
\chapter{title1}
\label{chap1}
here is defined the label{chap1}
\section{section1}
this is section1
\section{section1}
this is section1
\section{section1}
this is section1
in chapter 3
\chapter{title3}
\label{chap3}
text reference Chapter \ref{chap1}
However, the reference shows the last section of chapter 1
I am using texmaker quick build to compile the code. Here is the complete example on overleaf https://www.overleaf.com/read/rxkmhxcbcgqc
we can also notice that referencing the first chapter does not work.
A minimal non-working example would be
\documentclass{book}
\usepackage[arabic,english]{babel}
\begin{document}
\chapter{title}\label{key}
test \ref{key}
\end{document}
You can work around this problem using the approach from https://tex.stackexchange.com/a/238442/36296
\documentclass{book}
\usepackage[arabic,english]{babel}
\makeatletter
\def\#part[#1]#2{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV##part[\textRL{#1}]{\textRL{#2}}%
\else\SAV##part[\textLR{#1}]{\textLR{#2}}%
\fi}
\def\#spart#1{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV#spart{\textRL{#1}}%
\else\SAV#spart{\textLR{#1}}%
\fi}
\def\#chapter[#1]#2{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV##chapter[\textRL{#1}]{\textRL{#2}}%
\else\SAV##chapter[\textLR{#1}]{\textLR{#2}}%
\fi}
\def\#schapter#1{%
\addtocontents{toc}{\xstring\select#language{\main#Arabi#language}}%
\if#rl\SAV#schapter{\textRL{#1}}%
\else\SAV#schapter{\textLR{#1}}%
\fi}
\makeatother
\begin{document}
\chapter{title}\label{key}
test \ref{key}
\end{document}

Missing \begin{document}. \chapter{E Latex new blank page

I started to use Latex to write my notes and I've been having some problems when I start a new chapter or blank page
\chapter{ECS, Lambda, Batch, Lightsail}
\section{ECS}
\begin{enumerate}
\item first time
\end{enumerate}
and this is my main
\documentclass[a4paper,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[margin=1.0in]{geometry}
\begin{document}
\author{José Santiago Molano Perdomo}
\title{Aws Cloud Practicioneer}
\date{}
\let\cleardoublepage\clearpage
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\include{./TeX_files/chapter01}
\include{./TeX_files/chapter02}
\include{./TeX_files/chapter03}
\include{./Tex_files/chapter04}
\include{./Tex_files/chapter05}
\include{./Tex_files/chapter06}
\include{./Tex_files/chapter07}
\include{./Tex_files/chapter08}
\backmatter
% bibliography, glossary and index would go here.
\end{document}
I get this error when I try compile chaper 08
Undefined control sequence. \chapter
Missing \begin{document}. \chapter{E
Undefined control sequence. \section
Emergency stop.
Overfull \hbox (20.0pt too wide) in paragraph
The character é in the author name is invalid to UTF-8. Please change to \'{e}

Resources