我试图在 Latex 中的表格的一列中放置“普通”文本,并在多列环境中将项目放在相邻列中。不幸的是,左列中的文本向下滑动并且未对齐顶部。有人能帮助我吗?这是一个简单的例子:
\documentclass[
paper=a4,
paper=portrait,
onecolumn,
fontsize=12pt,
]{scrreprt}
\usepackage{multicol}
\usepackage{enumitem}
\begin{document}
\begin{tabular}[h]{|p{0.5\textwidth}|p{0.5\textwidth}|}\hline
Test 1 & Test\\ \hline
Test 2 & Test\\ \hline
Test 3 &
\begin{minipage}[t]{\linewidth}
\begin{multicols*}{2}
\begin{itemize}[nosep,after=\strut,leftmargin=1em]
\item item 1
\item item 2
\item item 3
\item item 4
\item item 5
\item item 6
\item item 7
\item item 8
\item item 9
\end{itemize}
\end{multicols*}
\end{minipage}\\ \hline
\end{tabular}
\end{document}
多谢!
答案1
您可以使用该adjustbox
包:
\documentclass[
paper=a4,
paper=portrait,
onecolumn,
fontsize=12pt,
]{scrreprt}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{adjustbox}
\begin{document}
\noindent
\begin{tabular}[h]{|p{0.47\textwidth}|p{0.47\textwidth}|}\hline
Test 1 & Test\\ \hline
Test 2 & Test\\ \hline
Test 3 &
\begin{adjustbox}{valign=t}
\begin{minipage}[t]{\linewidth}
\begin{multicols*}{2}
\begin{itemize}[nosep,leftmargin=1em]
\item item 1
\item item 2
\item item 3
\item item 4
\item item 5
\item item 6
\item item 7
\item item 8
\item item 9
\end{itemize}
\end{multicols*}
\end{minipage}
\end{adjustbox}\vskip0cm
\\ \hline
\end{tabular}
\end{document}