![是什么导致节点逐渐向下移动?](https://linux22.com/image/264643/%E6%98%AF%E4%BB%80%E4%B9%88%E5%AF%BC%E8%87%B4%E8%8A%82%E7%82%B9%E9%80%90%E6%B8%90%E5%90%91%E4%B8%8B%E7%A7%BB%E5%8A%A8%EF%BC%9F.png)
请仔细思考下图,是什么使得\psframebox
节点逐渐向下移动?
\documentclass[preview,border=15pt]{standalone}
\usepackage{pst-node}
\addtopsstyle{gridstyle}{griddots=0}
\psset
{
framearc=0.5,
framesep=0.5,
linewidth=0.5,
colsep=1,
rowsep=1,
mnode=r,
}
\def\A{\psframebox{\pspicture(2,1)\psframe*[linecolor=blue](2,1)\endpspicture}}
\begin{document}
\begin{preview}
\pspicture[showgrid=top](6,20)
\rput[tl](1,20){%
\psmatrix
\A \\
\A \\
\A \\
\A \\
\A \\
\endpsmatrix}
\endpspicture
\end{preview}
\end{document}
答案1
看起来好像在行分隔符后添加了一些额外的垂直空间。 -1bp 的更正:
\begin{preview}
\newdimen\rfix \rfix=1cm \advance\rfix-1bp
\pspicture[showgrid=top,rowsep=\rfix](6,20)
似乎解决了这个问题。
\documentclass[preview,border=15pt]{standalone}
\usepackage{pst-node}
\addtopsstyle{gridstyle}{griddots=0}
\psset
{
framearc=0.5,
framesep=0.5,
linewidth=0.5,
colsep=1,
rowsep=1,
mnode=r,
}
\def\A{\psframebox{\pspicture(2,1)\psframe*[linecolor=blue](2,1)\endpspicture}}
\begin{document}
\begin{preview}
\newdimen\rfix \rfix=1cm \advance\rfix-1bp
\pspicture[showgrid=top,rowsep=\rfix](6,20)
\rput[tl](1,20){%
\psmatrix
\A \\
\A \\
\A \\
\A \\
\A \\
\endpsmatrix}
\endpspicture
\end{preview}
\end{document}
答案2
来自 Herbert 在 PSTricks 邮件列表中的回答:
这与 PSTricks 无关...
\rput[tl](1,20){\offinterlineskip\psmatrix\A\\\A\\\A\\\A\\\A\\\endpsmatrix}
\documentclass[preview,border=15pt]{standalone}
\usepackage{pst-node}
\addtopsstyle{gridstyle}{griddots=0}
\psset
{
framearc=0.5,
framesep=0.5,
linewidth=0.5,
colsep=1,
rowsep=1,
mnode=r,
}
\def\A{\psframebox{\pspicture(2,1)\psframe*[linecolor=blue](2,1)\endpspicture}}
\begin{document}
\begin{preview}
\pspicture[showgrid=top](6,20)
\rput[tl](1,20){%
\offinterlineskip
\psmatrix
\A \\
\A \\
\A \\
\A \\
\A \\
\endpsmatrix}
\endpspicture
\end{preview}
\end{document}
对于那些有兴趣了解是什么原因导致行间跳跃的人来说,下面是我所添加的内容。
% DG/SR modification begin - Nov. 27, 1998 - Patch 8
%\let\mscount\@multicnt
\ifx\mscount\@undefined\let\mscount\@multicnt\fi
% DG/SR modification end
\def\psmatrix{\begingroup{\ifnum0=`}\fi % Don't want to expand any &.
\@ifnextchar[{\psmatrix@i}{\ifnum0=`{\fi}{}\psmatrix@ii}}
\def\psmatrix@i[#1]{%
\ifnum0=`{\fi}{}%
\psset{#1}%
\psmatrix@ii}
\def\psmatrix@ii{%
\KillGlue
\edef\psm@beginmath{%
\ifmmode$\m@th\ifinner\textstyle\else\displaystyle\fi\fi}%
\edef\psm@endmath{\ifmmode$\fi}%
\let\\\psm@cr
\advance\psmatrixcnt by \@ne
\def\psm@thenode{M-\the\psmatrixcnt-\the\psrow-\the\pscol}%
\tabskip\z@
\psrow=\@ne
\pscol\z@
\psset{shortput=tablr}%
\leavevmode
\vbox\bgroup\halign\bgroup&%
\begingroup
\global\advance\pscol by \@ne
\csname psrowhook\romannumeral\psrow\endcsname
\csname pscolhook\romannumeral\pscol\endcsname
\psm@beginnode##\psm@endnode\endgroup
\cr}
%
\def\endpsmatrix{%
\crcr\egroup\unskip\egroup
\endgroup}
\lineskip 粘连是 TeX 构造垂直框方式的一个基本特性