2

I'm trying to get an image centered within an itemize list preferably without the use of the center environment (since this induces a call of \item which I otherwise redefine so that pages are ended at the end of every item). But it seems as though my centering is not centering.

The minimal example below demonstrates the problem.

\documentclass{article}
\begin{document}

\begin{itemize}

\item Item text 
 \begin{center}
 I'm centered, which is nice.
 \end{center}

\item Item text 

 {\centering Why am I not centered?}

\end{itemize}
\end{document}
  • 4
    \centering is only processed (only takes effect) at the end of a paragraph. You closed the group (right brace) without a paragraph ending. Thus, add \par prior to right brace: {\centering Why am I not centered?\par} – Steven B. Segletes Oct 10 '18 at 10:08
  • Like @StevenB.Segletes said. You could add an explicit paragraph break: {\centering I'm centered!\par} – Martin Scharrer Oct 10 '18 at 10:13
  • 1
    @StevenB.Segletes: I would take it as a duplicate of tex.stackexchange.com/q/23650/2975. It is used for many similar questions already. – Martin Scharrer Oct 10 '18 at 10:15
  • Also related: Why can't I center a group? – Martin Scharrer Oct 10 '18 at 10:17
  • @MartinScharrer I think the solution is a duplicate. I found both questions but I obviously didn't look long enough. Thing is, I know why I want centering and not center. – Geoff Oct 10 '18 at 10:17