0

How can I center the text (includes math) in a list (itemize or enumerate) item but leave the bullet to the left?

What I want:

| (i)                Lorem Ipsum Dolor $E=mc^2$                       |

What I get:

|                  (i) Lorem Ipsum Dolor $E=mc^2$                     |

I tried both \begin{center} and \centering. I also tried to add \hfill around the content.

Here is my code:

\begin{enumerate}[label=(\roman*)]
% First try
\item \begin{center}
    text
\end{center}
% Second try
\item \centering
    text
\end{enumerate}
% Third try
\item \begin{center} \hfill
    text
\hfill\end{center}
2
  • 1
    Welcome! What does \item \hfill text \hfill\mbox{} give?
    – user194703
    Commented May 1, 2020 at 16:49
  • Would the item text fit on a single line?
    – Bernard
    Commented May 1, 2020 at 17:48

1 Answer 1

2

With a simple \makebox[\linewidth], since by default, the contents of a \makebox is centred in the box width:

\documentclass{article}
\usepackage{showframe} 
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{amsmath} %
\usepackage{enumitem}

\begin{document}

\mbox{}
\begin{enumerate}[label=(\roman*)]
\item \makebox[\linewidth]
   {Some text}
\item\makebox[\linewidth]{$\begin{aligned}[t]
  a & =b + c \\
a' & = b' + c'
\end{aligned}$}
\end{enumerate}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .