I am working on a research paper and have recently been getting a "missing \begin{document}" error even though I've included it in what I believe to be the proper place.


\usepackage{amssymb,latexsym, mathtools,setspace, amsmath, indentfirst,upgreek,multirow,graphicx,verbatim,float,cases}
\usepackage{graphicx, underscore, subcaption, amsmath, wrapfig}

% nicer captions for figures and tables  

% making larger margins

% File path to images

% Custom and Renewed Commands %

% some additionally defined commands
\newcommand{\Dt}[1]{\frac{\id #1}{\id t}}
\newcommand{\dt}[1]{\frac{\id #1}{\id t}}
\newcommand{\fref}[1]{Figure\ \ref{fig:#1}}
\newcommand{\frefs}[2]{Figures\ \ref{fig:#1}\ and\ \ref{fig:#2}}
\newcommand{\tref}[1]{Table\ \ref{tab:#1}}
\newcommand{\trefs}[2]{Tables\ \ref{tab:#1}\ and\ \ref{tab:#2}}
\newcommand{\eref}[1]{eqn.\ (\ref{eqn:#1})}
\newcommand{\erefs}[2]{eqns.\ (\ref{eqn:#1})--(\ref{eqn:#2}\mbox{)}}

\parskip 0.4cm

% style for reference citations in the text. Can be changed to other styles. Given in .bst file
\makeatletter \renewcommand{\@biblabel}[1]{#1.}\makeatother 

\title{Mathematical Modeling of Virus Spread in Plants}
\affil[1]{Department of Mathematics, University of Tennessee, Knoxville, TN}
\affil[2]{Department of Microbiology, University of Tennessee, Knoxville, TN}
\renewcommand\Affilfont{\itshape \small}
% ...

If you could help me identify the problem I would greatly appreciate it.

  • 3
    \author doesn't take any optional argument in the article class. And you can't have more than one. You're using the template for another class.
    – egreg
    May 23 '20 at 17:20
  • 1
    Do you really need all those packages? Consider removing them all, seeing what breaks, and adding back only what you really need. It may cause brief pain, but can help understanding in the long run. If you really do them all, kindly disregard this message. May 23 '20 at 19:44

The problem is that you're using commands from the authblk package, but you haven't loaded it. Adding


anywhere in the preamble will fix the problem.

I'm not sure why the error Missing \begin{document} is thrown. LaTeX does not always have the best error messages, unfortunately.

  • 2
    Without authblk the command \author[1]{Auth1} sets the author list to be "[", and then "1]..." is left over and appears like document body text. May 23 '20 at 20:26
  • Ahh, thanks @DonaldArseneau! May 23 '20 at 22:46

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.