错误:缺少 \begin{document。请帮忙!

错误:缺少 \begin{document。请帮忙!

当我使用 LuaLaTeX Typeset 在 TexWorks 中运行我的文档时,我首先收到一条错误消息:Error: Driver file pgfsys-luatex.def not found
经过一番研究,我下载了该文件并按以下方式pgfsys-luatex.def添加\RequirePackage{luatex85}https://sourceforge.net/p/pgf/bugs/384/

接下来,我收到错误:Error: File smartdiagram.sty not found.
因此我从下载了文件http://northstar-www.dartmouth.edu/doc/texmf-dist/tex/latex/smartdiagram/smartdiagram.sty并将其添加到我的工作目录。

最后,我遇到了一个非常烦人的错误,我无法解决:Error: Missing \begin{document}.我已确保文件已按照其他线程中的建议保存为 UTF-8。有人能帮我解决这个问题吗?请查看以下代码:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Twenty Seconds Resume/CV
% LaTeX Template
% Version 1.0 (14/7/16)
%
% Original author:
% Carmine Spagnuolo ([email protected]) with major modifications by 
% Vel ([email protected]) and Harsh ([email protected])
%
% License:
% The MIT License (see included LICENSE file)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[letterpaper]{twentysecondcv} % a4paper for A4
\usepackage{luatex85}
% Command for printing skill overview bubbles
\newcommand\skills{ 
~
    \smartdiagram[bubble diagram]{
        \textbf{Data}\\\textbf{Engineering},
        \textbf{Full Stack}\\\textbf{Web Dev},
        \textbf{~~~~~OOP~~~~~~},
        \textbf{Mobile}\\\textbf{Dev},
        \textbf{Machine}\\\textbf{Learning},
        \textbf{Test}\\\textbf{~~Automation~~},
        \textbf{Statistical}\\\textbf{Analysis}
    }
}

% Programming skill bars
\programming{{C $\textbullet$ C++  $\textbullet$ R / 3}, {Java $\textbullet$ SQL $\textbullet$ \large \LaTeX / 3.5}, {HTML5 $\textbullet$ JS $\textbullet$ Python / 5}}

% Projects text
\projects{
\textbf{DecAR} - An augmented reality interior decoration app for Android \\
        \textbf{CIS*6320} - An implementation of the Bicubic interpolation algorithm in C++
        \textbf{CIS*6650} - A comparative statistical study of SVM kernels, and number of hidden layers in ANN, on 5 UCI datasets
        \textbf{CIS*6660} - A data linkage project to integrate Canada's WWI casualties and 1901 Canadian census using an SVM
        \textbf{CIS*6650} - A statistical study of spurious correlations, such as correlating beer production with election outcome
}

%----------------------------------------------------------------------------------------
%    PERSONAL INFORMATION
%----------------------------------------------------------------------------------------
% If you don't need one or more of the below, just remove the content leaving the command, e.g. \cvnumberphone{}

\cvname{HARSH GADGIL} % Your name
\cvjobtitle{ Data Engineer } % Job
% title/career

\cvlinkedin{/in/hsgadgil}
\cvgithub{opensorceror}
\cvnumberphone{(647) 221 7999} % Phone number
\cvsite{hgadgil.com} % Personal website
\cvmail{[email protected]} % Email address

%----------------------------------------------------------------------------------------

\begin{document}

\makeprofile % Print the sidebar

%----------------------------------------------------------------------------------------
%    EDUCATION
%----------------------------------------------------------------------------------------
\section{Education}

\begin{twenty} % Environment for a list with descriptions
    \twentyitem
        {2015 - 2017}
        {}
        {MSc., Computer Science \textnormal{(GPA: 3.7/4.0)}}
        {\href{http://www.uoguelph.ca/}{University of Guelph, Canada}}
        {}
        {}
    \twentyitem
        {2009 - 2013}
        {}
        {BEng., Computer Engineering \textnormal{(GPA: 4.0/4.0)}}
        {\href{http://www.unipune.ac.in/}{University of Pune, India}}
        {}
        {}
    %\twentyitem{<dates>}{<title>}{<organization>}{<location>}{<description>}
\end{twenty}

\section{Research}
\begin{twenty}
    \twentyitem
        {2015 - 2017}
        {}
        {MSc. Candidate, Graduate Research Assistant}
        {\href{http://www.uoguelph.ca/}{University of Guelph}}
        {}
        {
        \textbf{Thesis}: Data Integration from Multiple Historical Sources to Study Canadian Casualties of WWI
        {\begin{itemize}
        \item Proposed a scalable stepwise deterministic method to reliably integrate datasets without labeled data. The method performs comparably with a method that incorporates a Support Vector Machine
        \item Constructed a rich longitudinal dataset to enable comphrehensive time-series analyses about WWI Canadian society and military
        \item \textbf{Tools}: R, Python, scikit-learn, BeautifulSoup, pandas, matplotlib \vspace{2mm}
        \end{itemize}}
        }
\end{twenty}

\section{Publications}
L. Antonie, H. Gadgil, G. Grewal, and K. Inwood, “Historical Data Integration - A Study of WWI Canadian Soldiers,” in 2016 IEEE 16th International Conference on Data Mining Workshops (ICDMW), pp. 186-193, IEEE, 2016. \vspace{2mm}

%----------------------------------------------------------------------------------------
%    EXPERIENCE
%----------------------------------------------------------------------------------------

\section{Experience}

\begin{twenty} % Environment for a list with descriptions
\twentyitem
        {April 2017 -}
        {Present}
        {Data Engineer}
        {\href{http://www.bell.ca/}{Bell}}
        {}
        {\begin{itemize}
        \item Currently involved in building a realtime data ingestion pipeline on a Kafka cluster using Spark Streaming, to detect SMS spammers on Bell's network in realtime
        \end{itemize}}
        \\
    \twentyitem
        {Sep 2015 -}
        {May 2016}
        {Co-founder \& Full Stack Developer}
        {\href{http://www.localxchange.ca/}{LocalXChange Inc.}}
        {}
        {
        {\begin{itemize}
        \item In a team of 2, raised \$8,000 in funding from The Hub incubator at the University of Guelph, to develop a prototype hyperlocal content platform, aimed at delivering local news and events from community organizations to local users in realtime (i.e., hyperlocal)
        \item In a team of 3, built hybrid mobile \& web apps with Ionic, Angular.js and MongoDB, surpassing 1,000 users within a month since launch
        \item Met with city officials, including the Mayor of Guelph, and university officials to discuss marketing \& business strategies for the platform 
    \end{itemize}}
        }
    \\   
    \twentyitem
        {Sep 2015 -}
        {Dec 2016}
        {Graduate Teaching Assistant}
        {\href{http://www.uoguelph.ca}{University of Guelph}}
        {}
        {
        {\begin{itemize}
        \item TA for CIS*2430 (OOP), CIS*4150 (Software Reliability \& Testing) and CIS*3530 (Database Systems \& Concepts) courses
    \end{itemize}}
        }
     \\
     \twentyitem
        {Dec 2013 -}
        {Apr 2015}
        {Test Automation Engineer}
        {\href{http://www.synechron.com/}{Synechron}}
        {}
        {
        \begin{itemize}
        \item Developed a \textit{Keyword Driven} and \textit{Behavior Driven} test automation framework for \href{https://www.microsoft.com/en-ca/dynamics/crm.aspx}{Microsoft Dynamics CRM}. Wrote an efficient recursive function to search multi-level frames, reducing development time by approximately two weeks. Won SPOT award {\includegraphics[scale=0.05]{img/trophy.png}}

        \textit{My work opened up a new position in the organization, enabling it to earn additional revenue of \$3,500 per month (estimated)}
        \item Demonstrated by proof of concept that rewriting a test automation framework for \href{https://www.microsoft.com/en-ca/dynamics/erp-ax-overview.aspx}{Microsoft Dynamics AX}, using an open source library (White) instead of a proprietary one (Coded UI), would enable the team to save \$4,000 annually by downgrading the prevailing edition of Microsoft Visual Studio from \textit{Premium} to \textit{Professional}
    \end{itemize}
        }

    %\twentyitem{<dates>}{<title>}{<location>}{<description>}
\end{twenty}

\end{document} 

答案1

嗯,这个简历课程有两个版本可供选择。

当我尝试使用类编译您的代码时,\ProvidesClass{twentysecondcv}[2015/02/28 CV class]我也遇到了错误Missing \begin{document}

看来您正在调用旧版本......

使用您提供的类,代码链接可以编译,不会出错!
请确保您的 TeX 文件和正确的类位于一个目录中...在我的电脑上,我有

在此处输入图片描述

不要忘记复制目录fonts...

相关内容