Flushleft包导致错误

Flushleft包导致错误

我设法将flushleft文章的标题、作者姓名和摘要以及摘要和关键字缩进。虽然代码是在 overleaf v2 上执行的,但一旦我编译文档,就会收到以下内容的警告消息:

unclosed open group { found at \end{flushleft}

此外,错误/警告消息上方的 latex 代码变为红色。有趣的是,我仍然可以在 overleaf 上写文本并添加新内容。我有点困惑,不知道该怎么做。我检查了所有括号,但我看不出该flushleft部分有什么问题。一双新的眼睛可能会有所帮助。

以下是我的序言:

\documentclass[12pt]{article}
\usepackage[english]{babel}

\usepackage{lineno}
\usepackage [autostyle, english = american]{csquotes} % US EN quotation marks
\MakeOuterQuote{"}

\usepackage{hyperref}

\topmargin 0.02cm
\oddsidemargin 0.2cm
\textwidth 16cm 
\textheight 21cm
\footskip 1.0cm

\newenvironment{sciabstract}{%
\begin{quote}
\end{quote}}

\newcounter{lastnote}
\newenvironment{scilastnote}{%
\setcounter{lastnote}{\value{enumiv}}%
\addtocounter{lastnote}{+1}%
\begin{list}%
{\arabic{lastnote}.}
{\setlength{\leftmargin}{.22in}}
{\setlength{\labelsep}{.5em}}}
{\end{list}}

\usepackage{setspace}
\usepackage{lipsum}
\usepackage{authblk}
\usepackage{titling}


\title{Article's title}
\author{Author's name}
\affil{Affiliation}
\date{}

\pretitle{\begin{flushleft}\LARGE\bfseries} %flushleft 
\posttitle{\par\end{flushleft}}
\preauthor{\begin{flushleft}\large}
\postauthor{\par\end{flushleft}}
\predate{\begin{flushleft}}
\postdate{\par\end{flushleft}\vskip 0.5em}

%%%%%%%%%%%%%%%%% END OF PREAMBLE %%%%%%%%%%%%%%%%

\begin{document} 
\linenumbers
\maketitle 

\begin{sciabstract}
\small
abstract, abstract abstract, abstract, abstract, abstract, abstract, 
abstract, abstract, abstract, abstract, abstract, abstract, abstract, 
abstract, abstract, abstract, abstract, abstract, abstract, abstract, 
abstract, abstract, abstract, abstract, abstract, abstract, abstract, 
abstract, abstract, abstract, abstract, abstract, abstract, abstract, 
abstract, abstract, abstract, abstract, abstract  

\
\onehalfspacing

\noindent
\textbf{Keywords:} keywords, keywords, keywords, keywords, keywords, 
keywords, keywords, keywords
\end{sciabstract}

\section{Introduction}

Introduction, introduction, introduction, introduction, introduction, 
introduction, introduction, introduction, introduction, introduction, 
introduction, introduction, introduction, introduction, introduction, 
introduction, introduction, introduction, introduction, introduction, 
introduction, introduction, introduction, introduction,

\end{document}

答案1

您的定义遗漏了两个括号。

改变

\newenvironment{sciabstract}{%
\begin{quote}
\end{quote}}

对此

\newenvironment{sciabstract}{\begin{quote}}{\end{quote}}

它将按照您描述的方式工作。

相关内容