# Hyperref error Incomplete \iffalse

I am trying to use hyperref package with my thesis, I put here a simplified version:

\documentclass[a4paper,twoside,12pt,notitlepage,openright]{article}
\usepackage[ansinew]{inputenc}
\usepackage[dvips,dvipdfmx]{graphicx} %[dvips] to used with .eps figures
\usepackage{bmpsize} % insert pdf figures
\usepackage{natbib}
\usepackage{lastpage}   % page count
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage[intoc]{nomencl} % including table of content
\usepackage{ifthen}
\usepackage[hmargin=3.0cm,vmargin=3.6cm]{geometry} % setting marginals
\usepackage{fancyhdr,extramarks}  % header ja footer manipulation
\usepackage{times}  % to change font to times
\usepackage{setspace} % for linespacing
\usepackage{color,soul} % for highlighting text
\usepackage[version=4]{mhchem} % for chemical formulas
\usepackage{url} % fix compilation error for url used in the references
\usepackage{gensymb} % degree celcius
\usepackage{enumerate} %use roman labels in enumerate

\singlespacing

\pagestyle{fancy}
\fancyhf{}% clearing the header and footer

\renewcommand\sectionmark[1]
{\markboth{\thesection\ #1}{}}         % section name to header
\renewcommand\subsectionmark[1]
{\markright{\thesubsection\ #1}}       % subsection name to header
\renewcommand{\footrulewidth}{0pt}      % no ruler between body and footer

\setlength{\nomitemsep}{-\parsep}   % removing default extra skip between entries at nomenclature

\numberwithin{equation}{section}    % equation numbers with section numbers
\numberwithin{table}{section}       % table numbers with section numbers
\numberwithin{figure}{section}      % figure numbers with section numbers

% makeindex command needs to run at command prompt to create nomenclature list file
\makenomenclature % makeindex main_v2.nlo -s nomencl.ist -o main_v2.nls
%\bibpunct{(}{)}{;}{a}{,}{,}%

\usepackage{hyperref}

\begin{document}

\pagestyle{empty}
\include{abstract}

\end{document}


Where abstract.tex is the following:

\section*{Abstract}

\textbf{My name}\\
\textbf{Title}\\
Year 2019\\
\pageref{LastPage} pages\\
XXXXXX\\
Cool dissertation\\
ISBN XXXX, ISBN XXXX (PDF), ISSN XXXXXX\\

something\\

more\\

Keywords: this, that, this that and that\\
UDC: XXXX : XXXX : XXXX\\


At first, adding \usepackage{hyperref} was returning an error because the number of arguments in \contentsline had to be changed from 3 to 4 (or to 5 as I saw recommended somewhere). After including another {}, it now returns the following error:

!Incomplete \iffalse; all text was ignored after line 53
<inserted text>
\fi
The file ended while I was skipping conditional text.
! Emergency stop


I can see this question was already asked \usepackage{hyperref} causing incomplete \iffalse error but no answer provided.

• Don't use two driver commands  \usepackage[dvips,dvipdfmx]{graphicx} That doesn't make sense. You can either compile with latex and dvips or with latex and dvipdfmx but not with both on the same time. (and if you use pdflatex both options are wrong, then better use no option at all). – Ulrike Fischer Aug 19 '18 at 11:15
• Why would you want to add the abstract to the table of contents without a page number? By the way, it should be \input{abstract} or you'd get an automatic page break. – egreg Aug 19 '18 at 14:07

\phantomsection

• Do you mean adding \phantomsection before \include{abstract}? – Mariana Aug 19 '18 at 11:33