0

I'm trying to center/align right the content of bullets in an itemize nested in a p column of a longtable. I use the following code:

\documentclass{article}

\usepackage[dvipsnames,table]{xcolor}

\usepackage{enumitem} \usepackage[landscape, margin=1in]{geometry} \usepackage{longtable} % for 'longtable' environment

\begin{document}

\begin{longtable}{p{0.1\linewidth} p{0.2\linewidth} p{0.7\linewidth} } # & question & answer \ \hline \endhead 127 & what are your names? & \begin{itemize} \item {\centering blo\par} \item bla \item {\raggedleft blu\par} \end{itemize} \end{longtable}

\end{document}

However, the resulting list also centers the bullet associated with the first item:

enter image description here

Is there anyway to prevent it from doing this without the use of a minipage environment?

1 Answers1

1

Here is a solution, using \parbox or \makebox depending on whether the item contents is multilined or not. I added a pair of vertical rules to visualise better, and set the bullet indent to 0:

\documentclass{article}

\usepackage[dvipsnames,table]{xcolor}

\usepackage{enumitem} \usepackage[landscape, margin=1in]{geometry} \usepackage{longtable} % for 'longtable' environment

\begin{document}

\begin{longtable}{p{0.1\linewidth} p{0.2\linewidth} | p{0.7\linewidth}| } # & question & answer \ \hline \endhead 127 & what are your names? & \begin{itemize} \item \parbox{\linewidth}{\centering blo} \item bla \item \makebox[\linewidth][r]{blu} \end{itemize} \end{longtable}

\end{document}

enter image description here

Bernard
  • 271,350