![pgfornaments--切换到 han 图形,故障排除](https://linux22.com/image/463281/pgfornaments--%E5%88%87%E6%8D%A2%E5%88%B0%20han%20%E5%9B%BE%E5%BD%A2%EF%BC%8C%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4.png)
我该如何定制以下代码以使用 pgfornament-han 角图 #11 而不是 pgfornament #42?显然我需要更改加粗的数字,但我使用的其他策略似乎都不起作用。
请参阅此处第 24 页:https://ctan.math.illinois.edu/macros/latex/contrib/tkz/pgfornament/doc/ornaments.pdf
\usepackage{pgfornament}
\usepackage{tikz}
\usepackage{eso-pic}
\makeatletter
\AddToShipoutPicture{
\begingroup
\setlength{\@tempdima}{2mm}
\setlength{\@tempdimb}{\paperwidth-\@tempdima-2cm}
\setlength{\@tempdimc}{\paperheight-\@tempdima}
\put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimc}){
\pgfornament[anchor=north west,width=2cm,color=darkbone,opacity=.5]**{41}**}\put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdima}){%
\pgfornament[anchor=south west,width=2cm,,color=darkbone,opacity=.5,symmetry=h]**{41}**}
\put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdimc}){%
\pgfornament[anchor=north east,width=2cm,,color=darkbone,opacity=.5,symmetry=v]**{41}**}
\put(\LenToUnit{\@tempdimb},\LenToUnit{\@tempdima}){%
\pgfornament[anchor=south east,width=2cm,,color=darkbone,opacity=.5,symmetry=c]**{41}**}
\endgroup
}
\makeatother
答案1
需要指定object = pgfhan
使用汉饰。
将\@tempdimc
在第三个装饰之前被覆盖,这就是我在这里使用简单的 TeX 宏的原因。
代码
\documentclass{article}
\usepackage[object=pgfhan]{pgfornament}
\usepackage{eso-pic}
\usepackage{blindtext}
\definecolor{darkbone}{HTML}{836b56}
\makeatletter
\AddToShipoutPicture{%
\begingroup
\edef\@@tempdima{2mm}%
\edef\@@tempdimb{\the\dimexpr\paperwidth-\@tempdima-2cm}%
\edef\@@tempdimc{\the\dimexpr\paperheight-\@tempdima}%
\put(\@@tempdima,\@@tempdimc){%
\pgfornament[anchor=north west,width=2cm,color=darkbone!50]{11}}%
\put(\@@tempdima,\@@tempdima){%
\pgfornament[anchor=south west,width=2cm,color=darkbone!50,symmetry=h]{11}}%
\put(\@@tempdimb,\@@tempdimc){%
\pgfornament[anchor=north east,width=2cm,color=darkbone!50,symmetry=v]{11}}%
\put(\@@tempdimb,\@@tempdima){%
\pgfornament[anchor=south east,width=2cm,color=darkbone!50,symmetry=c]{11}}%
\endgroup
}
\makeatother
\begin{document}
\blinddocument
\end{document}