2

I try to rotate the shape "tape" with no effect. Please take a look at the following MWE:

\documentclass{minimal}

\usepackage{tikz}
\usetikzlibrary{shapes}

\begin{document}
\begin{tikzpicture}
    \node[shape=tape, shape border rotate=90, draw, fill=yellow!20, text width=2cm] {A39F 47CA\\\ldots};
\end{tikzpicture}

\end{document}

I would expect the shape to have its curvy lines vertical but they are still horizontal, as if I would not use the shape boarder rotate=90 at all.

Does anyone have an idea how to achieve the appearence of the shape with the curvy lines vertical? What i try to achieve is something like on the picture below (but without the second sheet and written content instead of just lines):

enter image description here

Thanks for your help!

6
  • 1
    transform shape? Commented Jun 9, 2020 at 21:49
  • 1
    The pgfmanual clearly says (on p, 231 of v3.1.5) that Some shapes (but not all), support a special kind of rotation. This rotation affects only the border of a shape and is independent of the node contents, but in addition to any other transformations. The tape shape is not one of the shapes which are supported. So you can do what @HenriMenke suggest, or use fit for the tape shape, and the rotate fit key.
    – user194703
    Commented Jun 9, 2020 at 22:25
  • 1
    @Schrödinger'scat I had a quick look whether this can be made into an error instead of silently failing, because nobody reads the manual. Unfortunately, this mechanism is not very generic, so I'd have to add error handling code to each and every shape in existence. Commented Jun 9, 2020 at 22:34
  • 1
    @HenriMenke Yes, I had the same thoughts and conclusion, which can be found (implicitly) in the P.S. of the answer I wrote. In principle one could go a different way: issue a warning unless the shape border is rotatable. But this has other downsides, e.g. when users want to use the key in a scope, so it is probably not practical (either?).
    – user194703
    Commented Jun 9, 2020 at 22:36
  • 2
    @Rmano Well, at least for me this would have made a difference when I saw this behavior for the first time. And yes, these online tools, or more generally the attitude to throw users under the bus, are a problem, but at least from the TikZ/pgf side one could do better. Anyway, apparently Henri sees a way to make all shape boundaries rotatable, which would of course solve the problem.
    – user194703
    Commented Jun 10, 2020 at 13:58

1 Answer 1

1

Welcome! The pgfmanual clearly says (on p, 231 of v3.1.5) that

Some shapes (but not all), support a special kind of rotation. This rotation affects only the border of a shape and is independent of the node contents, but in addition to any other transformations.

The tape shape is not one of the shapes which are supported.

However, what you always can do is to use fit, along with the rotate fit key, to rotate the shape boundary. Since you also want to fill it, you may want to work with layers, e.g. use the backgrounds library.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{shapes.symbols,fit,backgrounds}

\begin{document}
\begin{tikzpicture}
    \node[text width=2cm] (F) {A39F 47CA\\\ldots};
    \scoped[on background layer]{
    \node[shape=tape,rotate fit=90, fit=(F),draw,
    fill=yellow!20] {};}
\end{tikzpicture}
\end{document}

enter image description here

P.S. If you want to argue that there should be some more information, either a list of supported shapes or a warning that gets issued if the shape is not in the list, I would tend to agree. Whether or not it is possible to implement such things with reasonable efforts is another question.

2
  • Thank you very much, this is really helpful. I looked at the pgf manual on p323 (v3.1.5) and i would have expected the note you quoted to be somewhere with the explanation of the option pgf/shape border rotate. Also a list of supported shapes or a warning would have helped me, but I understand issues arising from throwing a warning under certain circumstances.
    – user217894
    Commented Jun 10, 2020 at 9:09
  • 1
    @user217894 There is some ongoing discussion under github.com/pgf-tikz/pgf/issues/815.
    – user194703
    Commented Jun 10, 2020 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .