# Flushleft package causes error

I managed to flushleft the article's title, author's name and the abstract, and to have an indent with the abstract and keywords. Although the code is executed on overleaf v2, once I compile the document I receive a warning message of the following content:

unclosed open group { found at \end{flushleft}

Additionally, the latex code above the error/warning message becomes red. Interestingly, I can still write text on overleaf and add new content. I'm kinda confused and am not sure what to do with it. I checked all the parenthesis and I can't see what is wrong in the flushleft part. A fresh pair of eyes might help.

Here is my preamble:

\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}}%
\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}

• I think you want \newenvironment{sciabstract}{\begin{quote}}{\end{quote}} -- note the extra braces... – Thruston Aug 28 '18 at 13:53
• I'm sorry, I don't follow. Can you be more explicit, please? – Jo-Achna Aug 30 '18 at 10:05
• You have missed out two braces from your definition. – Thruston Aug 30 '18 at 10:09
• Any idea how could I also align article's title, author's name, and affiliation? – Jo-Achna Sep 18 '18 at 10:37

You have missed out two braces from your definition.

Change this

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


to this

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


and it will work as you describe.

• That works perfectly with the Abstract and the Keywords but not with the first three lines (Article's title, author's name and affiliation). – Jo-Achna Aug 30 '18 at 11:00