我想要镜像一个tikzducks
有选项的图像book
。
使用xscale=1
作品,但书名没有很好地反映出来。
是否存在一种无需手动进行调整的方法\rotatebox
?
\documentclass{article}
\usepackage{tikzducks}
\setlength\parindent{0pt}
\begin{document}
Initial image:
\begin{tikzpicture}
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
Image with \verb|xscale=-1| option:
\begin{tikzpicture}[xscale=-1]
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
Image with \verb|xscale=-1| and \verb|\rotatebox| to adjust the book title
inclination (what I'd like to achieve):
\begin{tikzpicture}[xscale=-1]
\duck[book=\rotatebox{40}{\scalebox{0.5}{\TeX}}]
\end{tikzpicture}
\end{document}
答案1
这本书是一个节点,只有使用变换形状键时,节点才会变换(旋转等)。但自然这也会镜像文本,因此您需要使用 reflectbox 来恢复它::
\documentclass{article}
\usepackage{tikzducks}
\setlength\parindent{0pt}
\begin{document}
Initial image:
\begin{tikzpicture}
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
Image with \verb|xscale=-1| option:
\begin{tikzpicture}[xscale=-1,transform shape]
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
\begin{tikzpicture}[xscale=-1,transform shape]
\duck[book=\scalebox{0.5}{\reflectbox{\TeX}}]
\end{tikzpicture}
\end{document}
答案2
该问题已在 0.6 版中得到修复tikzducks
\documentclass{article}
\usepackage{tikzducks}
\setlength\parindent{0pt}
\begin{document}
Initial image:
\begin{tikzpicture}
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
\begin{tikzpicture}[xscale=-1]
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
\end{document}
现在给出