可能需要看一下 \tkzSetUpLine
的定义, 当命令结束并且换行时, 应当添加注释符号, 否则可能产生空格, 这应该是 TeX 的特性. 也需要查看主命令内部所调用的命令的定义代码是否出现这种情况, 当出现多层次调用时, 需要检查的代码就多了.
\documentclass[border=3pt]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\makeatletter
\def\tkzSetUpLine{\pgfutil@ifnextchar[{\tkz@SetUpLine}{\tkz@SetUpLine[]}}
\def\tkz@SetUpLine[#1]{%
\pgfkeys{%
tkzsuline/.cd,
line width = \tkz@euc@linewidth,
color = \tkz@euc@linecolor,
style = \tkz@euc@linestyle,
% add = {\tkz@euc@lineleft} and {\tkz@euc@lineright},
}%
\pgfqkeys{/tkzsuline}{#1}%
\tikzset{%
line style/.append style ={%
line width = \tkz@line@width,
color = \tkz@line@color,
style = \tkz@line@style,
% add = {\tkz@line@left} and {\tkz@line@right},
line cap = round,
#1}
}%
}%
\begin{tikzpicture}
\tkzDefPoints{0/0/A,1/1/B}
\tkzDrawSegments[thick](A,B)
\end{tikzpicture}
\begin{tikzpicture}[thick]
\tkzDefPoints{0/0/A,1/1/B}
\tkzDrawSegments(A,B)
\end{tikzpicture}
\begin{tikzpicture}[line style/.append style={line width=1pt}]
\tkzDefPoints{0/0/A,1/1/B}
\tkzDrawSegments(A,B)
\end{tikzpicture}
\tkzSetUpLine[line width=1pt]%
\tkzSetUpLine[line width=1pt]%
\tkzSetUpLine[line width=1pt]%
\begin{tikzpicture}
\tkzDefPoints{0/0/A,1/1/B}
\tkzDrawSegments(A,B)
\end{tikzpicture}
\end{document}
在 tikzpicure
环境内部, 文本字符被设置为 \nullfont
, 一般没有这个问题.
tkz-euclide 包的主要优势在于提供了一些计算工具, 不在于设置样式. 我倾向于只用这个包做计算.
问 tkz-euclide宏包中设置全局样式的神秘边界问题?