我采用了为长表添加行距?减少我的长表中的行间距。
\documentclass{article}
\usepackage{longtable}
\begin{document}
\renewcommand{\arraystretch}{0.7}
\begin{longtable}{ l | l | l }
a & b & a small phrase \\
a & b & a small phrase \\
a & b & a small phrase
\end{longtable}
\end{document}
生产
但如果我有一个p
专栏
\documentclass{article}
\usepackage{longtable}
\begin{document}
\renewcommand{\arraystretch}{0.7}
\begin{longtable}{ l | l | p{5 cm} }
a & b & a small phrase \\
a & b & a small phrase \\
a & b & here is a long sentence which wraps to the next line \\
a & b & a small phrase
\end{longtable}
\end{document}
段落行之间的间距不会减少。
我怎样才能减少段落行之间的间距?
我也读过长表有多列和 parbox 间距问题但是这个例子太复杂了,我不确定问题是否完全一样。
答案1
您还可以以一种干净的方式在本地设置行距,如下所示:
\documentclass{article}
\usepackage{longtable}
\usepackage{setspace}
\begin{document}
\begin{spacing}{.7}
\begin{longtable}{ l | l | p{5 cm} }
a & b & a small phrase \\
a & b & a small phrase \\
a & b & here is a long sentence which wraps to the next line, here is a long sentence which wraps to the next line \\
a & b & a small phrase
\end{longtable}
\end{spacing}
\end{document}
答案2
由于某种原因,我不喜欢 setspacing 包的输出,并努力寻找简单的修改\baselineskip
就可以了。也许这可以帮助将来的人们:
\documentclass{article}
\usepackage{longtable}
\usepackage{array} %<================= Added this
\begin{document}
%\renewcommand{\arraystretch}{0.7}
\begin{longtable}{ l | l | >{\baselineskip=10pt}p{5 cm} }
a & b & a small phrase \\
a & b & a small phrase \\
a & b & here is a long sentence which wraps to the next line \\
a & b & a small phrase
\end{longtable}
\end{document}
该符号在列>{declaration}
的每个实例前添加声明p{}
。另外,请注意,我添加了array
包。