我通常使用负片inner sep
来缩小白色填充的节点以覆盖某些文本后面的一行,但是当我尝试将它与一些长文本一起使用时,它会停止变小并再次开始增长。(第一盘和第二盘)
我发现这个答案这解释了inner sep
在上的行为方式,我可以同时使用和来circle
解决问题。(inner xsep
inner ysep
第三盘)
我知道这inner sep
会变得非常消极,以至于它会自我逆转并再次开始增长。但问题是:
为什么在再次生长之前不先inner sep
达到零半径?
笔记:我知道有很多方法可以解决这个问题,但inner sep
对我来说使用更实用。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture} [ My Style/.style={circle, draw, fill=white} ]
% Vertical lines
\draw (0,2) -- (0,-8)
(3,2) -- (3,-8)
(6,2) -- (6,-8);
% First horizontal set (normal behavior)
\node[My Style, ] at (0,0) {long long text};
\node[My Style, inner sep=0pt ] at (3,0) {long long text};
\node[My Style, inner sep=-10pt] at (6,0) {long long text};
% Second horizontal set ('inner sep' stops shrinking)
\node[My Style, inner sep=-15pt] at (0,-3) {long long text};
\node[My Style, inner sep=-20pt] at (3,-3) {long long text};
\node[My Style, inner sep=-30pt] at (6,-3) {long long text};
% Third horizontal set (solved with both 'inner xsep' and ' inner ysep')
\node[My Style, inner xsep=-30pt, inner ysep=-4pt] at (0,-5) {long long text};
\node[My Style, inner xsep=-30pt, inner ysep=-10pt] at (3,-5) {long long text};
\node[My Style, inner xsep=-40pt, inner ysep=-10pt] at (6,-5) {long long text};
% Fourth horizontal set (small text or no text)
\node[My Style, inner sep=-5pt] at (0,-7) {text};
\node[My Style, inner sep=-0pt] at (3,-7) {};
\node[My Style, inner sep=-5pt] at (6,-7) {};
\end{tikzpicture}
\end{document}