6

How to center a text line within an itemize enivornment ?

What I tried:

\documentclass[a4paper]{article} 

\begin{document} 
\begin{itemize}
  \item {\centering text to center}
\end{itemize}
\end{document}

But the text is not centered, but on the left.

12
\documentclass[a4paper]{article}
\usepackage[showframe]{geometry}

\begin{document}
\begin{itemize}
  \item {\hfil text to center}
\end{itemize}
\end{document}

enter image description here

  • 2
    \item \hfil text to center would be enough. The latter \hfil is removed by the end of paragraph and replaced by \parfilskip. – Heiko Oberdiek Oct 21 '12 at 23:25
  • 1
    @HeikoOberdiek: Thank you for noting. I changed the answer appropriately. :-) – user11232 Oct 21 '12 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.