I am using Overleaf. If I click the blue-colored hyperlink for the footnote on the pdf file, it goes to the front page, not to the footnote as I intended. How should I fix this? I am using the following structure:
\documentclass[11pt,english]{extarticle}
\usepackage{listings}
\lstset{language=Matlab}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{booktabs}
\usepackage{float}
\usepackage{color}
\usepackage[title,titletoc,toc]{appendix}
\usepackage[nohead]{geometry}
\usepackage[bottom]{footmisc}
\usepackage{endnotes}
\usepackage{graphicx}
\usepackage[center,bf]{caption}
\usepackage{morefloats}
\usepackage{epstopdf}
\usepackage{rotating}
\usepackage{enumerate}
\usepackage{bbm}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\numberwithin{equation}{section}
\usepackage{fancyhdr}
\setlength{\parindent}{24pt}
\setlength{\headheight}{0in}
\usepackage{longtable}
\usepackage{import}
\usepackage{natbib}
\setlength{\bibsep}{0pt plus 0.3ex}
\usepackage{microtype}
\usepackage{multirow}
\usepackage{adjustbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This package makes you cross-reference across different tex files.
\usepackage{xr-hyper}
\usepackage[colorlinks=true,urlcolor=blue, linkcolor=blue, citecolor=blue]{hyperref}
\hypersetup{
filecolor=black
}
\makeatletter
\newcommand*{\addFileDependency}[1]{
\typeout{(#1)}
@addtofilelist{#1}
\IfFileExists{#1}{}{\typeout{No file #1.}}
}
\makeatother
\newcommand*{\myexternaldocument}[1]{
\externaldocument{#1}
\addFileDependency{#1.tex}
\addFileDependency{#1.aux}
}
%%% END HELPER CODE
\myexternaldocument{online_appendix}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{verbatim}
\usepackage{setspace}
\linespread{1.3}
\usepackage{pdflscape}
\usepackage{subcaption}
\usetikzlibrary{arrows,calc}
\usepackage{setspace}
\usepackage{ragged2e}
%%%%%%%%%%% Suppress Warning
\usepackage{silence}
\WarningFilter{latex}{Text page}
\WarningFilter{natbib}{Citation}
\WarningFilter{natbib}{There}
\usepackage{changepage}
\newlength{\wideitemsep}
\setlength{\wideitemsep}{\itemsep}
\addtolength{\wideitemsep}{5pt}
\let\olditem\item
\renewcommand{\item}{\setlength{\itemsep}{7pt}\olditem}
\newcommand{\sym}[1]{{#1}}
\long\def/#1/{}
%%%%%%
% Make Title appear in the top of the page
\usepackage{titling}
%\setlength{\droptitle}{-4em}
\setlength{\droptitle}{-2em}
%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Directly brought from Lyx %%%%
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
%\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm}
\geometry{verbose,tmargin=2.7cm,bmargin=2.7cm,lmargin=2.5cm,rmargin=2.5cm}
%\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2.3cm,rmargin=2.3cm}
\usepackage{amsthm}
\usepackage{amssymb}
%\usepackage{setspace}
%\doublespacing
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
\theoremstyle{plain}
\newtheorem{prop}[thm]{\protect\propositionname}
\ifx\proof\undefined
\newenvironment{proof}[1][\protect\proofname]{\par
\normalfont\topsep6\p@@plus6\p@\relax
\trivlist
\itemindent\parindent
\item[\hskip\labelsep\scshape #1]\ignorespaces
}{%
\endtrivlist@endpefalse
}
\providecommand{\proofname}{Proof}
\fi
\theoremstyle{plain}
\newtheorem{cor}[thm]{\protect\corollaryname}
\makeatother
\usepackage{babel}
\providecommand{\corollaryname}{Corollary}
\providecommand{\propositionname}{Proposition}
\providecommand{\theoremname}{Theorem}
\begin{document}
\title{\textbf{\large{}!!title}\thanks{!!acknowledgement}}
\date{{\normalsize{}!!date \endgraf
\vspace{0.5mm}
}}
\maketitle
%% Do not number title page
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
\thispagestyle{empty}%<=======
\endgroup
\newpage{}
\setcounter{page}{1}
\section{Introduction}
\label{section:introduction}
Words\footnote{hi}
\newpage{}
\begin{singlespacing} %\nocite{*}
\bibliographystyle{aer}
\bibliography{Reference}
\end{singlespacing}
\end{document}
\begin{document}. You may need to move the\myexternaldocumentstuff till after that as well. – frabjous Sep 07 '22 at 04:11\usepackagewithout understanding what the packages are doing and then the users put a desperate question "somethig is wrong" (like here). This doesn't confirm the opinion of "healthy" ecosystem :) – wipet Sep 07 '22 at 18:34