# Remove indent of first item without producing empty line

I would like to add keywords to my article. I used \renewcommand{\abstractname}{Keywords} to create the environment in style of the abstract.

If I now add keywords using \itemize, the first item will be indented. I can remove the indent by applying \noindent but it will produce an empty line prior to the list (line 2).

Is there a way to remove the indent without adding the empty line?

I would like to avoid using \vspace, since it will lead to line 3 moving on top of line 2 and I need proper line-numbering. Additionally, I would like to avoid global commands that would alter the indentation of other sections. I could not find a suitable key in the documentation of the enumitem package either which would account for this.

I assume this can be done. Someone please push me in the right direction. Best wishes and many thanks!

MWE:

\documentclass[11pt,a4paper]{article}

\usepackage{lineno}
\usepackage{enumitem}

\begin{document}
\linenumbers

\renewcommand{\abstractname}{Keywords}

\begin{abstract}
\noindent
\begin{itemize}[leftmargin=*]

\item One
\item Two
\item Three

\end{itemize}
\end{abstract}
\end{document}


I propose to define a new keywords list, itemize-like, with the relevant parameters, to emulate the abstract environment:

\documentclass[11pt,a4paper]{article}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{lineno}
\usepackage{enumitem}
\newlist{keywords}{itemize}{1}
\setlist[keywords]{label=\textbullet, labelindent=2.5em, topsep=3pt, partopsep=0pt, itemsep=0pt, leftmargin=*, rightmargin=2.5em, before=\noindent\makebox[\textwidth]{\bfseries Keywords}}

\begin{document}
\linenumbers

\begin{keywords}
\item One. Some text some text some text some text some text some text some text some text some text
\item Two
\item Three
\end{keywords}

\end{document}


• Thanks for your answer. Your approach works to create the environment without the empty line. However, you can notice that the header is not perfectly centred over the width of the page. Is this due to the box being asymmetric? – Tor Aug 10 '18 at 8:31
• @Tor: No, it's me forgetting before=\noindent\makebox... in the list parameters. I've fixed it. Please see if it's OK for you now. – Bernard Aug 10 '18 at 9:38
• Yes, that fixes the problem and your solution works for me too. Thanks again! – Tor Aug 13 '18 at 7:53

I'd define a specific environment; I'd remove the vertical space after the header, unless the first line of keywords is long.

\documentclass[11pt,a4paper]{article}

\usepackage{lineno}
\usepackage{enumitem}

\usepackage{lipsum}

\newenvironment{keywords}
{%
\small{\centering\bfseries\keywordsname\par}%
\begin{itemize}[leftmargin=3.75em,nosep]
}
\providecommand{\keywordsname}{Keywords}

\begin{document}
\linenumbers

\begin{abstract}
\lipsum[3]
\end{abstract}

\begin{keywords}
\item One
\item Two
\item Three
\end{keywords}

\lipsum[4]

\end{document}


• (+1) for your excellent answer. – Marian G. Aug 9 '18 at 19:20
• Thanks for your reply. The first line is long so I deleted the "nosep" and added "rightmargin" to match my abstract environment. This seems to solve my issue without further shortcomings. I´m surprised this environment is not present in this documentclass already. Adding keywords to a paper seems very common to me. – Tor Aug 10 '18 at 8:56
• @Tor Some more specialized classes have support for a keywords section. I would not waste space with a bulleted list. – egreg Aug 10 '18 at 8:58

This could be a possible workaround. Since, you are already using enumitem package, you would have known the customisability of enumerate environment.

By exploiting the options in that, and using resume, label with itemindent options, we can achieve what you want.

\documentclass[11pt,a4paper]{article}

\usepackage{lineno}
\usepackage{enumitem}
\begin{document}
\linenumbers

\renewcommand{\abstractname}{Keywords}

\begin{abstract}
\begin{enumerate}[label = \textbullet, itemindent=-1.5em]
\item one
\end{enumerate}
\begin{enumerate}[label = \textbullet, resume]
\item two
\item three
\end{enumerate}
\end{abstract}
\end{document}


I assumed you are using one-column format and hence set the indent spacing itemindent=-1.5em. Suppose, if it is two-column try using itemindent=-1em.

This gives:

• Thank you for your reply. It gets rid of the indent and the empty line. However, the vertical spacing between the two \enumerate environments does not seem consistent. – Tor Aug 10 '18 at 8:07

Here is another approach that defines the keywords environment. In addition, you can set the value \keywordsmargin to control the width of the environment.

\documentclass[11pt,a4paper]{article}

\usepackage{lineno}
\usepackage{enumitem}
\usepackage{lipsum}

\def\keywordsmargin{.15}

\newenvironment{keywords}[1]%
{%
\par\vskip1em
\leftskip=\keywordsmargin\textwidth
\rightskip=\leftskip
{\centering\bfseries Keywords\par}
#1%
}%
{}

\begin{document}
\linenumbers

\begin{keywords}
\begin{itemize}[itemsep=0pt,leftmargin=\leftskip]
\item One
\item Two
\item Three
\end{itemize}
\end{keywords}

\end{document}


The result is as expected.