It is not entirely clear whether you want to eliminate the indentation entirely or whether you want the items to be indented but not the labels. A.Ellett interpreted your question in one way and I in another.
Here's my answer based on my interpretation. This takes it that you want to eliminate the indentation entirely so that the list is like a series of numbered paragraphs.
\documentclass{article}
\usepackage{enumitem,kantlipsum}
\begin{document}
\kant[1]
\begin{enumerate}[wide, labelwidth=!, labelindent=0pt]
\item \kant[2]
\item \kant[3]
\item \kant[4]
\item \kant[5]
\end{enumerate}
\kant[6]
\end{document}
wide
is a convenience style for non-indented lists which are paragraph-like.
More specifically (page 8 of the manual), this key is equivalent to setting
align=left, leftmargin=0pt, labelindent=\parindent, listparindent=\parindent, labelwidth=0pt, itemindent=!
That is, align the label left within the label box, set the leftmargin
to zero, indent labels and paragraphs by \parindent
, set the width of labels to zero and calculate an appropriate indentation for items based on the other values.
We then tweak this by overriding some of the settings used by wide
:
labelindent=0pt
(overriding the value set by wide
) says not to indent the label relative to the left margin.
labelwidth=!
tells enumitem
to calculate the appropriate width for the label (again overriding the value set by wide
).
Alternatively, the following is based on A.Ellett's interpretation which understood you to want indented items but non-indented labels:
\documentclass{article}
\usepackage{enumitem,kantlipsum}
\begin{document}
\kant[1]
\begin{enumerate}[leftmargin=*]
\item \kant[2]
\item \kant[3]
\item \kant[4]
\item \kant[5]
\end{enumerate}
\kant[6]
\end{document}
leftmargin=*
calculates an appropriate value for leftmargin
based on the current label.
Use \State
to begin a new line for each simple statement (as you have done later for "something"):
\documentclass{article}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithmic}
\Function{newCenterCalculation}{$data[vector]$}
\State {data\Call{.forEach}{point$\Rightarrow$}}
\For{i $<$ point.size()}
\State {something}
\EndFor
\EndFunction
\end{algorithmic}
\end{document}
Best Answer
TeX puts space at the end of each non-empty line if the line doesn't end by multi-letter control sequence (spaces after such control sequence are ignored always). The spaces from end-lines are typically ignored in vertical mode. But it is not your case, TeX is in horizontal mode in your example.
At the end of first line you have
\\
. Space is inserted here, because it is not multi-letter control sequence. But the macro\\
expands to\hfil\break
and the space is ignored as discardable item after such\break
.At the second line you have invisible item
\vrule
with zero width. The line ends by}
, i.e. the space is inserted after the invisible item. This is a space what you want to remove. Typical solution is to add the%
at the end of the line.Third line is similar to the first: the space after
\\
is removed as discardable item after\break
. Fourth line is similar of the second. The space form the end line after invisible item is inserted.