我有一个itemize
列表longtblr
:
\documentclass{article}
\usepackage[a4paper,margin=1mm]{geometry}
\usepackage{lipsum}
\usepackage{paracol}
\usepackage{tabularray}
\usepackage{enumitem} % <-- for a compact itemize list
\begin{document}
\DefTblrTemplate{firsthead, middlehead,lasthead}{default}{}
\begin{longtblr}[
presep=-4pt,postsep=0pt
]{
colspec = {lX},
colsep=4pt,
hline{odd}={solid},
row{odd}={belowsep=0pt},
row{even}={abovesep=0pt},
cell{even}{1} = {c=2}{wd=\textwidth-8pt,halign=j}
}
01/01/2020 $-$ 31/12/2022 & \textbf{First}\\
\begin{itemize}[noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]
\item first item
\item second item
\item third item
\item fourth item
\item fifth item
\item sixth item
\end{itemize} &\\
01/01/2018 $-$ 31/12/2019 & \textbf{Second}\\
\lipsum[2] &\\
\end{longtblr}
\end{document}
如何删除列表01/01/2020 $-$ 31/12/2022 & \textbf{First}\\
开始/顶部之间的垂直空白itemize
?
答案1
在tabularray
文档第 5.10 节 Library varwidth
- 和
\UseTblrLibrary{varwidth}
- 和
measure=vbox,stretch=-1
完整代码
\documentclass{article}
\usepackage[a4paper,margin=1mm]{geometry}
\usepackage{lipsum}
% \usepackage{paracol}
\usepackage{tabularray}
\UseTblrLibrary{varwidth}%<-- added
\usepackage{enumitem} % <-- for a compact itemize list
\begin{document}
\DefTblrTemplate{firsthead, middlehead,lasthead}{default}{}
\begin{longtblr}[
presep=-4pt,postsep=0pt
]{
colspec = {l X},
colsep=4pt,
hline{odd}={solid},
row{odd}={belowsep=0pt},
row{even}={abovesep=0pt},
cell{even}{1} = {c=2}{wd=\textwidth-8pt,halign=j},
measure=vbox,stretch=-1,%<-- added
}
01/01/2020 $-$ 31/12/2022 & \textbf{First}\\
\begin{itemize}[noitemsep,nosep]
\item first item
\item second item
\item third item
\item fourth item
\item fifth item
\item sixth item
\end{itemize} &\\
01/01/2018 $-$ 31/12/2019 & \textbf{Second}\\
\lipsum[2] &\\
\end{longtblr}
\end{document}