14

I would like to mirror an image of tikzducks which has the book option.

Using xscale=1 works, but the title of the book is not well mirrored.

Does it exist a way to adjust it without doing it manually with \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}

enter image description here

15

The book is a node , and nodes are only transformed (rotated etc) if you use the transform shape key. But naturally this will also mirror the text, so you need reflectbox to get it back::

\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}

enter image description here

3

This problem has been fixed in version 0.6 of the 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}

now gives

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.