示例代码:
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\NiceMatrixOptions{hvlines}
\linespread{1}\selectfont
linespread sets to 1.0
\begin{NiceTabular}{lr}[baseline=t]
align & l \\
\end{NiceTabular}
\begin{NiceTabular}{b{1cm}r}[baseline=t]
align & b \\
\end{NiceTabular}
\begin{NiceTabular}{p{1cm}r}[baseline=t]
align & p \\
\end{NiceTabular}
\begin{NiceTabular}{m{1cm}r}[baseline=t]
align & m \\
\end{NiceTabular}
\linespread{1.5}\selectfont
linespread sets to 1.5
\begin{NiceTabular}{lr}[baseline=t]
align & l \\
\end{NiceTabular}
\begin{NiceTabular}{b{1cm}r}[baseline=t]
align & b \\
\end{NiceTabular}
\begin{NiceTabular}{p{1cm}r}[baseline=t]
align & p \\
\end{NiceTabular}
\begin{NiceTabular}{m{1cm}r}[baseline=t]
align & m \\
\end{NiceTabular}
\linespread{2}\selectfont
linespread sets to 2
\begin{NiceTabular}{lr}[baseline=t]
align & l \\
\end{NiceTabular}
\begin{NiceTabular}{b{1cm}r}[baseline=t]
align & b \\
\end{NiceTabular}
\begin{NiceTabular}{p{1cm}r}[baseline=t]
align & p \\
\end{NiceTabular}
\begin{NiceTabular}{m{1cm}r}[baseline=t]
align & m \\
\end{NiceTabular}
\end{document}
输出:
答案1
的该错误nicematrix
已在的最新版本nicematrix
(2021/07/23 的 v 5.19) 中得到更正。
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\NiceMatrixOptions{hvlines}
\linespread{1}\selectfont
linespread sets to 1.0
\begin{NiceTabular}{lr}[baseline=t]
align & l \\
\end{NiceTabular}
\begin{NiceTabular}{b{1cm}r}[baseline=t]
align & b \\
\end{NiceTabular}
\begin{NiceTabular}{p{1cm}r}[baseline=t]
align & p \\
\end{NiceTabular}
\begin{NiceTabular}{m{1cm}r}[baseline=t]
align & m \\
\end{NiceTabular}
\linespread{1.5}\selectfont
linespread sets to 1.5
\begin{NiceTabular}{lr}[baseline=t]
align & l \\
\end{NiceTabular}
\begin{NiceTabular}{b{1cm}r}[baseline=t]
align & b \\
\end{NiceTabular}
\begin{NiceTabular}{p{1cm}r}[baseline=t]
align & p \\
\end{NiceTabular}
\begin{NiceTabular}{m{1cm}r}[baseline=t]
align & m \\
\end{NiceTabular}
\linespread{2}\selectfont
linespread sets to 2
\begin{NiceTabular}{lr}[baseline=t]
align & l \\
\end{NiceTabular}
\begin{NiceTabular}{b{1cm}r}[baseline=t]
align & b \\
\end{NiceTabular}
\begin{NiceTabular}{p{1cm}r}[baseline=t]
align & p \\
\end{NiceTabular}
\begin{NiceTabular}{m{1cm}r}[baseline=t]
align & m \\
\end{NiceTabular}
\end{document}