[Tex/LaTex] writing in Sharelatex, got “File ended while scanning use of \@xargdef.” error


While trying to compute my report in ShareLaTeX I got the error stating

"File ended while scanning use of \@xargdef."

I've tried looking through the document for an error in curly bracketing {} but I can't seem to find any, haven't been able to find anything on what \@xargdef is either, any help is greatly appreciated.

I made a gist for the code of the document since it is quite long here: https://gist.github.com/ZzimonNanoq/527855642ed275fc0c67

the error message in its entirety is as follows:

File ended while scanning use of \@xargdef.
<inserted text>
<*> main.tex

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> main.tex

*** (job aborted, no legal \end found)

Here is how much of TeX's memory you used:
7316 strings out of 495028
109339 string characters out of 6181497
229851 words of memory out of 5000000
10500 multiletter control sequences out of 15000+600000
3940 words of font info for 15 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
42i,0n,43p,1192b,38s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

Best Answer

There are two problems noted in your source document.

  1. Definition of \namesigdate is missing a closing brace. The correct code would be:

    \newcommand{\namesigdate}[2][5cm]{% \begin{tabular}{@{}p{#1}@{}} #2 \\[2\normalbaselineskip] \hrule \\[15pt] \end{tabular}}

  2. Either \begin{comment} used unnecessarily on line 61 or it is not ended promptly in the document.

Fixing the above two issues will solve the problems.