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!
  • It's almost certainly possible that you can reproduce the same error with a smaller code (and then you can post it in your question, which people usually prefer) -- can you try to make your document smaller, such that it has the same problem? Commented Dec 29, 2015 at 1:58

1 Answer 1


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.

  • The closing brace fixed it, thanks! The \begin{comment} parts were just failed attempts at finding the error ^^'. Commented Dec 29, 2015 at 14:25
  • You can just try by removing it OR add appropriate 'end comment' Commented Dec 29, 2015 at 15:06
  • I mean \end{comment}. Commented Dec 30, 2015 at 4:32
  • yeah, I had some end comment sections in there but I just forgot to remove the \begin{comment} as well. Thanks :) Commented Jan 2, 2016 at 6:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .