5

I stumbled upon the following warning and error, consecutively. I see no reason why they would correlate.


LaTeX Warning: You have requested, on input line 447, version
               `2011/01/03' of package etoolbox,
               but only version
               `2009/08/06 v1.8 e-TeX tools for LaTeX'
               is available.

! Undefined control sequence.
\reserved@a ...x}[2011/01/03]\AfterEndEnvironment 
                                                  {table}{\ltx@ifpackageload...
l.447 }

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.447 }

Miminal working example:

\documentclass{article}

\usepackage{tablefootnote}

\begin{document}

\begin{table}[h]
    \centering
    \begin{minipage}{0.48\textwidth}
        \centering
        %\tablewidth=\textwidth
        \begin{tabular}{ |l| }
            content \tablefootnote{footnote content.} 
        \end{tabular}
    \end{minipage}\hfill
\end{table}


\end{document}

MWE compiled


What causes pdflatex not to recognize \begin{document}?

Moreover, the footnote is not printed at the bottom of the page.

  • 2
    Your problem is: Your version of etoolbox is way outdated. – Johannes_B Mar 16 '17 at 17:17
  • 1
    @Johannes_B yes but that wasn't the question, the question was why does that trigger a missing document error. – David Carlisle Mar 16 '17 at 17:18
  • 2
    It is always the first error you need to fix. AtEndEnvironment wasn't yet implemented in 2009, hence the error. The missing begin document is the next error because LaTeX now thinks it needs to typeset something, and \begin{document} wasn't seen yet. – Johannes_B Mar 16 '17 at 17:18
14

It is best to ignore every error after the first.

! Undefined control sequence.
\reserved@a ...x}[2011/01/03]\AfterEndEnvironment 
                                                  {table}{\ltx@ifpackageload...
l.447 }

so TeX was reading \AfterEndEnvironment{table}

It gives the error that \AfterEndEnvironment is not defined, so if you do not stop there it carries on and sees {table} but this is (now) just text in a group, not the argument to a command, so it starts to typeset a paragraph, and latex flags that as an errror as you are not supposed to have text before \begin{document}

  • 1
    @MusséRedi Yes, it is. – Johannes_B Mar 16 '17 at 17:33
  • 1
    @MusséRedi yes of course it will not work at at all as the commands used are not defined. – David Carlisle Mar 16 '17 at 17:34
  • 1
    If you are using TexLive, you could use tlmgr in "user mode" to install the packages automatically, in your home folder... – Stobor Mar 16 '17 at 22:42
  • 1
    @Stobor probably not actually. Given the age of etoolbox shown, it must be an old texlive whose repositories will now be frozen so the OP would have to install texlive 2016 which can not be done via tlmgr from an old version. – David Carlisle Mar 16 '17 at 22:44
  • 1
    @MusséRedi you could switch to one of the online systems eg sharelatex – David Carlisle Mar 16 '17 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.