2

The minipage solution of this accepted answer is also what I'm looking for, that is,


this one :-)

enter image description here

not this one :-(

enter image description here


The commented-out part of the MWE below tries to implement that minipage solution, but throws an Missing \endcsname inserted error.

I doesn't have to be minipage for me, as long as it works and is equally simple and elegant :)

MWE:

\documentclass[a4paper]{article}

 \newlength{\mymyrandomlength}

 \settowidth\mymyrandomlength{hello world}

\usepackage{tabularx}

\begin{document}

\begin{tabularx}{\textwidth}{@{}*{1}{p{\mymyrandomlength}}|*{1}{X}@{}}

ABCDEFG
&

\begin{itemize}
\item bla bla bla
\item hello hello goodbye

\strut
\end{itemize}

\\

%\begin{minipage}[t]
%\begin{itemize}
%\item bla bla bla
%\item hello hello goodbye

%\strut
%\end{itemize}
%\end{minipage}
%\\

%\end{tabularx}

\end{tabularx}

% Missing \endcsname inserted.

\end{document}

Cf. also this Q&A which seems related.

2 Answers2

3

You're missing the mandatory argument for minipage:

\documentclass{article}
\usepackage{tabularx}
\begin{document}

\noindent
\begin{tabularx}{\textwidth}{@{}p{3cm}|X@{}}
ABCDEFG &
\begin{minipage}[t]{\hsize}
\begin{itemize}
\item bla bla bla
\item hello hello goodbye\strut
\end{itemize}
\end{minipage}
\\
\end{tabularx}

\end{document}

In an X column you can access the column width by \hsize.

enter image description here

egreg
  • 1,121,712
0

This is one possible solution -- Use of `\vspace{-xxcm}

enter image description here

Code

\documentclass[border=10pt]{standalone}%[a4paper]{article}

\usepackage{tabularx}
 \newlength{\mymyrandomlength}
 \settowidth\mymyrandomlength{hello world}

\begin{document}

\begin{tabularx}{\textwidth}{@{}*{1}{p{\mymyrandomlength}}|*{1}{X}@{}}
ABCDEFG&
\vspace{-0.5cm}
\begin{itemize}
\item bla bla bla
\item hello hello goodbye
\vspace{-0.5cm}
\end{itemize}
\end{tabularx}
\end{document}
Jesse
  • 29,686