**Attachments**
Attachment A: interview .............................. 1
Attachment B: worddoc ................................ 5


So I can print my Word files seperate from my Latex file.

My document:

\documentclass[11 pt, twoside, openright, tikz]{report}
\begin{document}
{\let\cleardoublepage\clearpage
\tableofcontents} %error here
\bibliographystyle{apalike}
\end{document}


Gives the error:

Runaway argument?
File ended while scanning use of \contentsline.
<inserted text>
\par
l.131 \tableofcontents
}

• Please, test your MWE after deleting the auxiliary files (.aux, .toc). After compiling twice, there is only a warning about an unused global option tikz, no error (with \\error here replaced with % error here). – Heiko Oberdiek Oct 1 '16 at 12:03
• @HeikoOberdiek I am actually using Overleaf, so i cant remove those files I guess. – user3201911 Oct 1 '16 at 12:07

## Example with page numbers

The attachments are added at the end of the document/table of contents. Since deferred writing will not work after the last page, the writing is changed to \immediate\write by \zref@wrapper@immediate.

\documentclass{report}
\usepackage{zref-base}

\begin{document}
\tableofcontents
\chapter{Regular chapter}
\section{Regular section}

\clearpage
\begingroup
\makeatletter
\protect\contentsline{#1}{#2}{#3}%
}%
}%
\zref@wrapper@immediate{%
}%
\endgroup
\end{document}


## Example without page numbers and dots

\NoDottedTocLine is inserted into the .toc file to remove the dots.

\documentclass{report}
\usepackage{zref-base}
\makeatletter
\def\@tocline#1#2#3#4#5{%
\ifnum #1>\c@tocdepth \else
\vskip \z@ \@plus.2\p@
{\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
\parindent #2\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima #3\relax
{#4}\nobreak
% \leaders\hbox{$\m@th % \mkern \@dotsep mu\hbox{.}\mkern \@dotsep % mu$}%
\hfill
\nobreak
\hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
\par}%
\fi
}
\newcommand*{\NoDottedTocLine}{%
\let\@dottedtocline\@tocline
}
\makeatother

\begin{document}
\tableofcontents
\chapter{Regular chapter}
\section{Regular section}

\clearpage
\begingroup
\makeatletter
\protect\contentsline{#1}{#2}{#3}%
}%
}%
\zref@wrapper@immediate{%

• It gives an error in my code. But somehow Because an other weird error occurs in my .bib file I cant see the error. But could it give an error because {\let\cleardoublepage\clearpage \tableofcontents} is in my code? – user3201911 Oct 1 '16 at 11:05
• @user3201911 There is no MWE in the question. Thus, you have to adapt/apply the code of the answer to your real document. I do not even know, if your document class has chapters (book, report, ...) or not (article, ...). – Heiko Oberdiek Oct 1 '16 at 11:10
• @user3201911 The code in the answer is also based on class report. Please, update the question with a minimal working example (MWE). – Heiko Oberdiek Oct 1 '16 at 11:17