到目前为止
\documentclass{article}
\usepackage{tabularx}
\usepackage{enumitem}
\setlist{topsep=0em,nosep}
\begin{document}
\section{test}
\begin{tabularx}{\linewidth}{r|X}
test text 1 & \begin{minipage}{\linewidth}
test text 2
\begin{itemize}
\item test item 1
\item test item 2
\end{itemize}
\end{minipage}
\end{tabularx}
\end{document}
但是,我希望“测试文本 1”与“测试文本 2”内联。我该如何实现?
答案1
实现这种对齐的最简单方法是设置锚minipage
操作处的要点[t]
:
\documentclass{article}
\usepackage{tabularx}
\usepackage{enumitem}
\setlist{topsep=0em,nosep}
\begin{document}
\section{test}
\begin{tabularx}{\linewidth}{r|X}
test text 1 & \begin{minipage}[t]{\linewidth}
test text 2
\begin{itemize}
\item test item 1
\item test item 2
\end{itemize}
\end{minipage}
\end{tabularx}
\end{document}