![自动构建(或绘制)PStricks 非文本对象的边界框](https://linux22.com/image/240936/%E8%87%AA%E5%8A%A8%E6%9E%84%E5%BB%BA%EF%BC%88%E6%88%96%E7%BB%98%E5%88%B6%EF%BC%89PStricks%20%E9%9D%9E%E6%96%87%E6%9C%AC%E5%AF%B9%E8%B1%A1%E7%9A%84%E8%BE%B9%E7%95%8C%E6%A1%86.png)
是否有一个命令或宏可以绘制并自动调整对象的边界矩形的大小pstricks
,例如圆形 - 即使对象经历旋转等变换,也能有效地将其紧密地框起来。
例如,
\documentclass[english, landscape, a4paper]{slides}
\usepackage{pstricks}
\begin{pspicture}(1,-1)(20,17)
\pscircle(5,5){2} % I'd like to draw the bounding box of this object
\end{pspicture}
编辑:我遇到的困难是计算框架或边界框的尺寸。
答案1
\psframebox[shadow,framesep=...,...]{%
pstricks object with a pspicture environment
}
或者如果你没有外部pspicture 环境
\documentclass[english, landscape, a4paper]{slides}
\usepackage{pstricks} \SpecialCoor
\makeatletter
\def\psCircleSquare{\pst@object{psCircleSquare}}
\def\psCircleSquare@i(#1)#2{{%
\use@par
\rput(#1){\psframe(!#2 neg dup)(!#2 dup)}%
\pscircle(#1){#2}%
}}
\makeatother
\begin{document}
\psset{unit=0.5}
\begin{pspicture}(1,-1)(20,17)
\psCircleSquare[shadow](5,5){2}
\end{pspicture}
\end{document}