5

I would rotate the whole tikzpicture by a particular angle. I use the package rotating for this purpose as mentioned in https://tex.stackexchange.com/a/199471/. But the Problem is that I would like to keep the inserted text upright. For example in the below image, the symbol "u" has been skewed. There is a related question in How to rotate the position of a node but not the text inside it but it does not use the 'rotating` package. The motivation is that when drawing a picture it is easier to draw the picture upright, then rotating it because the computation is easier.

To be precise, I would like that the node together with the text to be rotated but the text appear to be upright.

\documentclass{article}
\usepackage{tikz}
\usepackage{rotating}

\begin{document}
 \begin{turn}{-37}
\begin{center}
\begin{tikzpicture}[scale=1]
\draw [->] (3.5, 1.5)-- (4.25, 3.75); 
\node at (4.45, 3.75) {$u$}; 
\end{tikzpicture}
\end{center}
\end{turn}

\end{document} 
  • Use the rotate key, i.e., add rotate=-37 to the options of tikzpicture. The contents of a rotatebox or a turn environment is rotated as a whole, you cannot exempt certain parts of it. – gernot Apr 20 '17 at 7:28
  • Just for the records: Your code does not compile. You cannot put a center environment into a turn box. – gernot Apr 20 '17 at 7:36
10

The answer to the question in the headline is easy: No, this is not possible, for the simple reason that the commands in the rotate package by design rotate everything within their scope.

But you don't need an extra package. The tikzpicture environment has the option rotate, which will rotate everything except for the labels.

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=1,rotate=0]
\draw [->] (3.5, 1.5)-- (4.25, 3.75); 
\node at (4.45, 3.75) {$u$}; 
\end{tikzpicture}
\begin{tikzpicture}[scale=1,rotate=-37]
\draw [->] (3.5, 1.5)-- (4.25, 3.75); 
\node at (4.45, 3.75) {$u$}; 
\end{tikzpicture}
\begin{tikzpicture}[scale=1,rotate=30]
\draw [->] (3.5, 1.5)-- (4.25, 3.75); 
\node at (4.45, 3.75) {$u$}; 
\end{tikzpicture}
\end{document} 

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.