I'm having trouble apparently with the \addcontentsline
command:
! Argument of \addcontentsline has an extra }.
<inserted text>
\par
l.157 \addcontentsline
{toc}{section}{Introduction}
Here's the code that fails:
\section*{Introduction}
\markboth{Introduction}{Introduction}
\addcontentsline{toc}{section}{Introduction}
\vspace*{-2.4mm}
I'm using an article
class document:
\documentclass[a4paper,12pt,twoside]{article}
What's wrong with this command? Does it need an extra package? I am using TeXmaker on Ubuntu 16.04, compiling the document with PDFLaTeX.
I'm using hyperref
like this:
\usepackage[
unicode=true,
bookmarks=true,
bookmarksnumbered=true,
bookmarksopen=true,
bookmarksopenlevel=1,
breaklinks=false,
pdfborder={0 0 1},
backref=false,
colorlinks=false
]
{hyperref}
And the \addcontentsline
is not refined.
Here is a MWE: http://pastebin.com/raw/nnqXJkHh
MWE
\documentclass[a4paper,12pt,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage[frenchb]{babel}
\addto\extrasfrench{
\providecommand{\og}{\leavevmode\flqq~}\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}
}
\usepackage[showframe=false,headheight=-1mm, top=2cm, bottom=2.4cm, left=2.4cm, right=2cm, footskip=20pt]{geometry}
\setlength\parindent{0pt}
\usepackage{lmodern}
\usepackage{atbegshi}
\usepackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\widowpenalty=9999
\clubpenalty=9996
\usepackage{aeguill}
\usepackage{eurosym}
\usepackage{gensymb}
\usepackage{caption}
\captionsetup{justification=centering}
\usepackage{subcaption}
\usepackage{multicol}
\usepackage{vwcol}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{natbib}
\usepackage{enumitem}
\usepackage{floatrow}
\usepackage{calc} % To calculate width for \FBwidth
\usepackage{amssymb}
\usepackage{multirow}
\usepackage[normalem]{ulem}
\floatsetup{
heightadjust=object,
valign=t
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% en-têtes et pieds de pages :
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength\headheight{26pt} %% just to make warning go away. Adjust the value after looking into the warning.
%\rhead{{\color{blue}\rule{1cm}{1cm}}}
\fancyhf{} % clear head and foot !
\fancyhead[LO,RE]{\footnotesize{\itshape{\nouppercase{\textcolor{gray}{\leftmark}}}}}
\fancyhead[RO,LE]{\includegraphics[width=3.2cm]{logo.png}}
\fancyfoot[C]{\textcolor{gray}{\thepage}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\headrule}{{\color{red}%
\hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage{textcomp} % <-------------- problem with def of : \mencl \t
\usepackage{color}
\usepackage{tocvsec2}
\usepackage{tikz}
\usepackage{pstricks}
\usepackage{graphicx}
\usepackage{type1cm}
\usepackage{eso-pic}
\usepackage{tocloft}
\usepackage[hyphens]{url}
\usepackage[
unicode=true,
bookmarks=true,
bookmarksnumbered=true,
bookmarksopen=true,
bookmarksopenlevel=1,
breaklinks=false,
pdfborder={0 0 1},
backref=false,
colorlinks=false
]
{hyperref}
\hypersetup{
pdftitle={Title},
pdfauthor={Author},
pdfkeywords={key1, key2, key3},
colorlinks=false,
linkbordercolor={0 0.8 0.2},
linktoc=section
}
\linespread{1}
\usepackage{rotating}
\usepackage{watermark}
\raggedbottom
\usepackage[bottom]{footmisc}
\captionsetup[figure]{textfont={it}}
\captionsetup[subfigure]{textfont=it,singlelinecheck=off,justification=raggedright}
\usepackage{titling}
\setlength{\droptitle}{-18mm} % This is your set screw
\graphicspath{{images/}}
\pdfobjcompresslevel=0
\usepackage{authblk}
\makeatletter
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1pt\hskip\tabcolsep}}
\makeatother
\setcounter{tocdepth}{3}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{gobble}
\renewcommand{\tablename}{Tab}
%\setlength{\droptitle}{-24mm}
\title{Title}
\author{\normalsize{Author} \\
\texttt{
\scriptsize{
\href{mailto:[email protected]}{[email protected]}
}
}
}
\date{\small{july 2016}}
\maketitle
\tableofcontents
\listoffigures
\listoftables
%\newpage{}
\clearpage
\pagenumbering{arabic}
\setcounter{page}{1}
\pagestyle{fancy}
\vspace*{-17.2mm}
\newpage{}
\section*{Introduction}
\markboth{Introduction}{Introduction}
\addcontentsline{toc}{section}{Introduction}
\vspace*{-2.4mm}
text
\newpage{}
\section*{Problematic}
\markboth{Problematic}
\addcontentsline{toc}{section}{Problematc}
\vspace*{-2.4mm}
text
\end{document}
\addcontentsline
? Or are you usinghyperref
? That's most likely the cause of your problem. From that fragment we can't say much, howeverhyperref
, yes. See update for options.hyperref
package to insert mails, url, and so on. This worked on an old version of texlive/texmaker I had.)MWE
in pastebin, but not here :-(