1

Consider the following Minimum Working Example (MWE):

\documentclass{article}
\usepackage{enumitem}
\usepackage{tabularx}

\begin{document}

    \begin{tabularx}{\textwidth}{| p{2cm} | p{2cm} |}
        Text &  \begin{itemize}
                    \item Text
                    \item Text
                \end{itemize}
                \\
    \end{tabularx}

\end{document}

Screenshot of the result:

Screenshot of the result


Description of the issue:

The behavior of \itemize to let its items begin in a new line looks ugly in this case.

How could I get it like this?

Screenshot of the desired state

I would prefer to avoid using a messy \vspace{-...pt} with hardcoded values to shift the items up.

3
\documentclass{article}
\usepackage{enumitem}
\usepackage{tabularx}

\begin{document}

    \begin{tabularx}{\textwidth}{| p{2cm} | p{2cm} |}
        Text &\csname @minipagetrue\endcsname  \begin{itemize}
                    \item Text
                    \item Text
                \end{itemize}
                \\
    \end{tabularx}

\end{document}

enter image description here

| improve this answer | |
3

There is a macro I found on this site,which makes LaTeX believe the cell is a minipage. However, there remains a vertical spacing at the bottom of the cell. This problem can be solved with enumitem, adding a negative vertical spacing at the end of the list. In addition, I advise to use the option wide=0pt in tables:

\documentclass{article}
\usepackage{enumitem}
\usepackage{tabularx}
\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother
\begin{document}

    \begin{tabularx}{.5\textwidth}{|X | >{\compress}X|}
 Some text & Some A SCAmore other\\
        Text & \begin{itemize}[wide=0pt, leftmargin=*, nosep, after =\vspace*{-\baselineskip}]
                    \item Text
                    \item Text
                \end{itemize}
                \\
 Another text & Still another
    \end{tabularx}

\end{document} 

enter image description here

| improve this answer | |

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.