使用 \item 命令时出现“此处没有结束行”错误

使用 \item 命令时出现“此处没有结束行”错误

在此行标题中获取错误:

\item {Hack 24} Worked in a team called Hackbox where I helped to create a version of the game Battleships.

以下是完整代码。我正在使用 Overleaf 撰写简历

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Medium Length Professional CV
% LaTeX Template
% Version 2.0 (8/5/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Trey Hunner (http://www.treyhunner.com/)
%
% Important note:
% This template requires the resume.cls file to be in the same directory as the
% .tex file. The resume.cls file provides the resume style used for structuring the
% document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\documentclass{resume} % Use the custom resume.cls style

\usepackage[left=0.75in,top=0.6in,right=0.75in,bottom=0.6in]{geometry} % Document margins
\newcommand{\tab}[1]{\hspace{.2667\textwidth}\rlap{#1}}
\newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
\name{Joshua Diamond} % Your name
\address{13 Langley Crescent Edgware HA8 9SZ} % Your address
%\address{123 Pleasant Lane \\ City, State 12345} % Your secondary addess (optional)
\address{Mob: +44 7908899764 \\ [email protected]} % Your phone number and email
\begin{document}

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\begin{rSection}{Education}

{\bf University of Nottingham} \hfill {\em Enrolled since September 2017} 
\\ Foundation Year in Engineering and Physical Science \hfill {Achieved 2:1}
\\ Computer Science with Artificial Intelligence {On course for a 2:1}  
%Minor in Linguistics \smallskip \\
%Member of Eta Kappa Nu \\
%Member of Upsilon Pi Epsilon \\


\end{rSection}
%----------------------------------------------------------------------------------------
%   TECHNICAL STRENGTHS SECTION
%----------------------------------------------------------------------------------------

\begin{rSection}{Technical Strengths}

\begin{tabular}{ @{} >{\bfseries}l @{\hspace{6ex}} l }
Programming Languages &  Proficient in C, Java, Python. Learning Javascript, SQL, C++ \\
Software \& Tools & HTML, Excel, Matlab \\
\end{tabular}

\end{rSection}

%----------------------------------------------------------------------------------------
%   WORK EXPERIENCE SECTION
%----------------------------------------------------------------------------------------

\begin{rSection}{Experience}
\begin{rSubsection} {Hackathons}
\item {Hack 24} Worked in a team called Hackbox where I helped to create a version of the game Battleships.
\item {Hack Sheffield}
\item Taught myself about PyGame.
\end{rSubsection}


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

\begin{rSubsection}{Coursework}

\item Linked Lists: Implemented insertion and merge sorts in C using Linked Lists 
\item Encryption: Used watermarking algorithm and created a GUI in MatLab for obfuscating text in PNG files.
\item 6502 CPU: Built a 6502 CPU from NAND Gates in Hardware Description Language (HDL).
\item Server and Client: Built a Server and Client in C to implement the RFC-867 Daytime Protocol.
\item Arm Assembly: Built a matching pairs game in Arm Assembly.
\end{rSubsection}
\end{rSection}
\end{document}

答案1

附带的示例resume.cls

\begin{rSubsection}{ACME, Inc}{October 2010 - Present}{Web Developer}{Palo Alto, CA}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.
\item Donec et mollis dolor. Praesent et diam eget libero Adobe Coldfusion egestas mattis sit amet vitae augue.
\item Nam tincidunt congue enim, ut porta lorem Microsoft SQL lacinia consectetur.
\item Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\item Pellentesque auctor nisi id magna consequat JavaScript sagittis.
\item Aliquam at massa ipsum. Quisque bash bibendum purus convallis nulla ultrices ultricies.
\end{rSubsection}

请注意,该rSubsection命令有四个参数,而您只需提供一个。

如果我提供虚拟参数,则不会出现错误。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Medium Length Professional CV
% LaTeX Template
% Version 2.0 (8/5/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Trey Hunner (http://www.treyhunner.com/)
%
% Important note:
% This template requires the resume.cls file to be in the same directory as the
% .tex file. The resume.cls file provides the resume style used for structuring the
% document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\documentclass{resume} % Use the custom resume.cls style

\usepackage[left=0.75in,top=0.6in,right=0.75in,bottom=0.6in]{geometry} % Document margins
\newcommand{\tab}[1]{\hspace{.2667\textwidth}\rlap{#1}}
\newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
\name{Joshua Diamond} % Your name
\address{13 Langley Crescent Edgware HA8 9SZ} % Your address
%\address{123 Pleasant Lane \\ City, State 12345} % Your secondary addess (optional)
\address{Mob: +44 7908899764 \\ [email protected]} % Your phone number and email
\begin{document}

%----------------------------------------------------------------------------------------
%   EDUCATION SECTION
%----------------------------------------------------------------------------------------

\begin{rSection}{Education}

{\bf University of Nottingham} \hfill {\em Enrolled since September 2017} 
\\ Foundation Year in Engineering and Physical Science \hfill {Achieved 2:1}
\\ Computer Science with Artificial Intelligence {On course for a 2:1}  
%Minor in Linguistics \smallskip \\
%Member of Eta Kappa Nu \\
%Member of Upsilon Pi Epsilon \\


\end{rSection}
%----------------------------------------------------------------------------------------
%   TECHNICAL STRENGTHS SECTION
%----------------------------------------------------------------------------------------

\begin{rSection}{Technical Strengths}

\begin{tabular}{ @{} >{\bfseries}l @{\hspace{6ex}} l }
Programming Languages &  Proficient in C, Java, Python. Learning Javascript, SQL, C++ \\
Software \& Tools & HTML, Excel, Matlab \\
\end{tabular}

\end{rSection}

%----------------------------------------------------------------------------------------
%   WORK EXPERIENCE SECTION
%----------------------------------------------------------------------------------------

\begin{rSection}{Experience}
\begin{rSubsection}{Hackathons}{aaa}{bbb}{ccc}
\item {Hack 24} Worked in a team called Hackbox where I helped to create a version of the game Battleships.
\item {Hack Sheffield}
\item Taught myself about PyGame.
\end{rSubsection}


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

\begin{rSubsection}{Coursework}{aaa}{bbb}{ccc}

\item Linked Lists: Implemented insertion and merge sorts in C using Linked Lists 
\item Encryption: Used watermarking algorithm and created a GUI in MatLab for obfuscating text in PNG files.
\item 6502 CPU: Built a 6502 CPU from NAND Gates in Hardware Description Language (HDL).
\item Server and Client: Built a Server and Client in C to implement the RFC-867 Daytime Protocol.
\item Arm Assembly: Built a matching pairs game in Arm Assembly.
\end{rSubsection}
\end{rSection}
\end{document}

我离开了\bf\em,但请注意,它们已被弃用20多年了。

提供所需数据aaa,而不是 、bbbccc

enter image description here

答案2

我建议,当你遇到麻烦时,复制你的文件并开始追踪代码中的祸根。删除与你的问题无关的所有内容,这些内容与你的问题完全无关,例如,如果你在包含图片时遇到问题,请删除除图片所需的部分和包之外的所有内容。另一种可能性是编写一个仅包含图片部分的新最小 tex 文件。如果它在那里工作,它应该在你的主文件中工作。如果它在主文件中不起作用,则可能是两个包发生冲突。

复制您的代码时我遇到的第一个问题是没有resume.sty。通过切换到article类,我想重现您的错误,但失败了,因为rSection包含在简历中而不是文章中。

在 overleaf 中我遇到了同样的问题,there is no line to end here尽管我们没有打电话\\\newline

幸运的是,我使用相同的模板来创建我的简历。(我使用的是原始版本,而不是 overleaf 模板)我查看了我的 .tex 文件,惊讶地发现我没有使用您的任何项目。我不知道您为什么要使用这些项目,所以只需将它们保留下来并按照以下步骤操作:

\begin{rSection}{Experience}    

    \textbf{ Latex genius }\hfill\textit{ BigBang - $\infty$ }\\
    {Earth} \textit{Hello}

如果你想在行首添加一个点,只需使用 $\bullet$。

当你遇到问题时,通常都是非常痛苦的,直到你解决问题。有时只需使用解决方法(编写自己的代码)。

顺便说一下你用过简历.sty

在我之前的评论版本中,我使用了\bf和,\em它们显然自 1994 年以来就已贬值 - 哎呀。谢谢 Troy!我从来没有遇到过它们的问题,因为我从来没有将它们合并在一起。您可以在此处阅读更多信息关联

我的方法可能不是最好的解决方案,因为我在学习 LaTeX 时写了这个方法,但我有一个漂亮的 pdf 文档。你应该参考 egreg 的答案。

相关内容