%% -*- coding: utf-8 -*-
%% File: 00_shared/latex_styles/linker.tex

%% --- Linker for supplemtal material ---
\usepackage{xr}
\makeatletter
\newcommand*{\addFileDependency}[1]{% argument=file name and extension
  \typeout{(#1)}
  \@addtofilelist{#1}
  \IfFileExists{#1}{}{\typeout{No file #1.}}
}
\makeatother

\newcommand*{\link}[2][]{%
    \externaldocument[#1]{#2}%
    \addFileDependency{#2.tex}%
    \addFileDependency{#2.aux}%
}

%%%% EOF