有了这段代码,我修改了一下:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{tikzrput}
\usepackage[object=vectorian]{pgfornament}
\newtcolorbox{frameT}{enhanced, colframe=black,colback=gray!5, boxrule=2pt,arc=6pt,outer arc=60pt,frame hidden, after skip = -12pt, interior style={left color = orange, bottom color = purple}, opacityback = 0.06}
\begin{document}
\begin{frameT} % Frame not around whole picture
\begin{center}
\begin{picture}(0,0)%
\rput(0,0){\Huge Title}%
\rput[t](0,-1){\pgfornament[width=7cm]{75}}
\rput(-0.05,-4){\Large Name}%
\rput[l](-2.6,-4){\pgfornament[width=1cm]{3}}%
\rput[r](2.6,-4){\pgfornament[width=1cm,symmetry=v]{3}}%
\end{picture}
\end{center}
\end{frameT}
\end{document}
它提供了一幅漂亮的装饰画,然而彩色盒子没有完全封闭。
我如何实现这个目标?
答案1
通过使用,\begin{picture}(0,0)
您基本上将图片的大小设置为 0。您可以为图片选择合适的大小(可能需要更改一些坐标...)或者,作为快速破解,使用图片周围的小页面手动添加一些高度:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{tikzrput}
\usepackage[object=vectorian]{pgfornament}
\newtcolorbox{frameT}{
enhanced, colframe=black,colback=gray!5, boxrule=2pt,arc=6pt,outer arc=60pt,frame hidden, after skip = -12pt, interior style={left color = orange, bottom color = purple}, opacityback = 0.06
}
\begin{document}
\begin{frameT} % Frame not around whole picture
\begin{minipage}[t][5cm]{\textwidth}
\centering
\vskip0.5cm
\begin{picture}(0,0)%
\rput(0,0){\Huge Title}%
\rput[t](0,-1){\pgfornament[width=7cm]{75}}
\rput(-0.05,-4){\Large Name}%
\rput[l](-2.6,-4){\pgfornament[width=1cm]{3}}%
\rput[r](2.6,-4){\pgfornament[width=1cm,symmetry=v]{3}}%
\end{picture}
\end{minipage}
\end{frameT}
\end{document}