如何在 tikz 中水平翻转装饰物?

如何在 tikz 中水平翻转装饰物?

这张图片中有两个类似的装饰品。我需要水平翻转其中一个(如镜像)。

\documentclass[20pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{paperheight=5in,paperwidth=7in,margin=10mm, top=1cm}
\usepackage{tikz, pgfornament, tikzrput}
\usepackage{bookman}
\usepackage{eso-pic}
\usepackage[utf8]{inputenc}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor} 
\usepackage{pdfrender}
\usepackage{pdfpages}
\makeatletter
\makeatother
\definecolor{mygreen}{RGB}{23,78,25}
\begin{document}
\pagenumbering{gobble}
\centering
{
\begin{tikzpicture}
\node at (2,-5) {
\scalebox{2}{\textup{%
\textpdfrender{%
  TextRenderingMode=2,
  LineWidth=.1ex,
  StrokeColor=mygreen,
  FillColor=mygreen,
}{\large LAVENDER }}}
};
\begin{scope}[color=red,
                every node/.style={inner sep=0pt}]
\node[minimum size=0cm](vecbox){};
 \node[anchor=north west, yshift=-10cm, xshift=-5cm, rotate=90] at 
(vecbox.west)
{\pgfornament[width=10cm]{87}};
        \node[anchor=north east, yshift=0cm, xshift=7cm, rotate=90] at 
(vecbox.east)
{\pgfornament[width=10cm]{87}};
\end{scope}
\end{tikzpicture}
}
\end{document}

在此处输入图片描述

答案1

与 @marmoth 在其评论中提出的想法类似,但稍微修正/简化了您的代码:

\documentclass[20pt]{extarticle}
%\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{%showframe,
          paperheight=5in,paperwidth=7in,
          margin=10mm}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage{tikz, pgfornament, tikzrput}
\usetikzlibrary{positioning}

\usepackage{bookman}
\usepackage{eso-pic}
%\usepackage[utf8]{inputenc}
\usepackage{pdfrender}
\usepackage{pdfpages}
%\makeatletter
%\makeatother
\definecolor{mygreen}{RGB}{23,78,25}

\begin{document}
\thispagestyle{empty}
%\pagenumbering{gobble}
\begin{center}
\begin{tikzpicture}[node distance = 44mm and 66mm]
%
\node[font=\large] (n1)  {\scalebox{2}{\textup{%
                            \textpdfrender{%
                            TextRenderingMode=2,
                            LineWidth=.1ex,
                            StrokeColor=mygreen,
                            FillColor=mygreen}%
                            {LAVENDER}}}};
\coordinate[above=of n1] (n2);
    \begin{scope}[color=red]
\node[rotate=90, left =of n2]   {\pgfornament[width=10cm]{87}};
\node[rotate=90, right=of n2, 
      xscale=-1]                {\pgfornament[width=10cm]{87}}; % horizontally mirrored by xscale=-1
    \end{scope}
\end{tikzpicture}
\end{center}
\end{document}

在此处输入图片描述

相关内容